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
-
In editItemTemplate there is linkbutton or textbox.If there is a linkbutton then change it to textbox.
-
Hello, the only option in the edititemtemplate is a linkbutton or push button... so how do I change this to a textbox? Thanks alot, Commickey
linkbutton or push button is your project options or you are saying only two two controls are available in the edititemtemplate.If your case is latter one then you can check it again , there is checkbox, button, image,label,textbox controls etc available in the edititemtemplate.You can use any of them
-
linkbutton or push button is your project options or you are saying only two two controls are available in the edititemtemplate.If your case is latter one then you can check it again , there is checkbox, button, image,label,textbox controls etc available in the edititemtemplate.You can use any of them
-
hello, thanks alot, I am using Visual studio 2003 and it has only two controls in the edititemtemplate which are link button and push button... So how u I change this to a textbox?
-
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
-
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.
-
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