asp.net - How can i remove the text parameter from grid view control on runtime through C# -
<asp:templatefield headertext="type"> <itemtemplate> <asp:textbox id="typeid" runat="server" text='<%# eval("type") %>' /> </itemtemplate> </asp:templatefield>
i want remove attribute text='<%# eval("type") %>'
programmatically on page load.
you can in rowdatabound
shown below :
protected void gridviewname_rowdatabound(object sender, gridviewroweventargs e) { try { if (e.row.rowtype == datacontrolrowtype.datarow) { //hide textbox textbox txtboxtobehidden= (textbox)e.row.findcontrol("txtboxtobehidden"); txtboxtobehidden.visible = false; } } catch (exception ex) { // error code } }
Comments
Post a Comment