object typeconversion syntax error
-
Below is the code written in row editing event of data gridview(in assumption that row editing can only be done if some control like textbox is there) (TextBox)(GridView2.Rows[0].Cells [2]) = "a"; But is this syntax of object conversion correct?It is giving error as system cannot convert type string to system.web.ui.webcontrols
-
Below is the code written in row editing event of data gridview(in assumption that row editing can only be done if some control like textbox is there) (TextBox)(GridView2.Rows[0].Cells [2]) = "a"; But is this syntax of object conversion correct?It is giving error as system cannot convert type string to system.web.ui.webcontrols
-
Below is the code written in row editing event of data gridview(in assumption that row editing can only be done if some control like textbox is there) (TextBox)(GridView2.Rows[0].Cells [2]) = "a"; But is this syntax of object conversion correct?It is giving error as system cannot convert type string to system.web.ui.webcontrols
Try
((TextBox)(GridView2.Rows[0].Cells [2])).Text = "a";
:)