asp.net - GridView: Retrieve value of TemplateField in RowDeleting event -
Click on a fresh button when users are forced to list my gridview:
Grv_xyz.dataSource = lstVendorInfo; Grv_zyz.DataBind ();
I have another
& lt; Columns & gt; & Lt; Asp: CommandField HeaderText = "Delete" ShowDeleteButton = "True" ShowHeader = "True" /> & Lt; Asp: TemplateField Header Text = "Seller ID" & gt; & Lt; Item style width = "10%" border collar = "#fiffef" borderwidth = "1px" /> & Lt; ItemTemplate & gt; & Lt; ASP: Hyperlink Navigate URL = "#" id = "ABCID" Runat = "Server" text = '& lt;% # Bind ("ABC")%> & Gt; & Lt; / Asp: hyperlink & gt; & Lt; / ItemTemplate & gt; & Lt; Header Style Border Collar = "#FFF" /> & Lt; / ASP: TemplateField & gt; & Lt; / Column & gt;
The problem is the cell has the following text property: ""
.
Secure void grv_vendor_rowDeleting (Object Sender, GridVidelEventEurges E) {ShowResult (); Table cell cell = grv_vendor.rows [e.RowIndex]. Cell [4]; }
How can I save the value inside a TemplateField in the RowDeleting event?
Thank you very much.
A template field contains controls, so the price must be accessed by them. For example, if you have a label inside TemplateField and want to use its value, you would write:
as your label Label = e.Item.FindControl (" YourLabelID "); String val = yourLabel.Text;
Comments
Post a Comment