Datagrid edit problem
-
Hello, I have this code System.Web.UI.WebControls.TextBox textpersid = new System.Web.UI.WebControls.TextBox(); textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]; and I always get the error: Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.DataGridLinkButton' to type 'System.Web.UI.WebControls.TextBox'. Can someone help me on this? Thanks alot, Commickey
Hi Try this one.... textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[0]; or textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[1]; Abhijeet
-
Just go in HTML and in that put textbox inside.For ex: I hope this will help u.
-
Hi Try this one.... textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[0]; or textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[1]; Abhijeet
-
Just go in HTML and in that put textbox inside.For ex: I hope this will help u.
-
Hello, I have this code System.Web.UI.WebControls.TextBox textpersid = new System.Web.UI.WebControls.TextBox(); textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]; and I always get the error: Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.DataGridLinkButton' to type 'System.Web.UI.WebControls.TextBox'. Can someone help me on this? Thanks alot, Commickey
Just go in HTML and in that put textbox inside.For ex: I hope this will help u.
-
Hello, I have this code System.Web.UI.WebControls.TextBox textpersid = new System.Web.UI.WebControls.TextBox(); textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]; and I always get the error: Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.DataGridLinkButton' to type 'System.Web.UI.WebControls.TextBox'. Can someone help me on this? Thanks alot, Commickey
Just go in HTML and in that put textbox inside.For ex: asp:TemplateColumn I hope this will help u.
-
hi I am trying that but its not working.U just need to go to the HTML code and add Inside this u will see and inside this u will find I hope now u can c and also u got help from me. Thanks and Regards.
-
hi I am trying that but its not working.U just need to go to the HTML code and add
Commickey wrote:
Inside this u will see
Commickey wrote:
and inside this u will find
Commickey wrote:
I hope now u can c and also u got help from me. Thanks and Regards.
-
Hello, I have this code System.Web.UI.WebControls.TextBox textpersid = new System.Web.UI.WebControls.TextBox(); textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]; and I always get the error: Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.DataGridLinkButton' to type 'System.Web.UI.WebControls.TextBox'. Can someone help me on this? Thanks alot, Commickey
Just use TemplateColumn u will find edititemtemplate.
-
Hello, I have this code System.Web.UI.WebControls.TextBox textpersid = new System.Web.UI.WebControls.TextBox(); textpersid = (System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]; and I always get the error: Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.WebControls.DataGridLinkButton' to type 'System.Web.UI.WebControls.TextBox'. Can someone help me on this? Thanks alot, Commickey
<datagrid> <columns> <asp:templatecolumn> <itemtemplate> <asp:label id = "label" runat = server"></asp:label> </itemtemplate> <edititemtemplate> <asp:textbox id = "textbox" runat = server></asp:textbox> <edititemtemplate> </asp:templatecolumn> </columns> </datagrid>
-- modified at 6:26 Monday 12th June, 2006