asp.net - find controls from emptydatatemplate in gridview -



asp.net - find controls from emptydatatemplate in gridview -

i using emptydatatemplate entering new info in grid while there no existing data,but not able find controls in emptydatetemplate

protected void gvnavigationdtls_rowcommand(object sender, gridviewcommandeventargs e) { if (e.commandname.equals("einsert")) { gridviewrow emptyrow = gvnavigationdtls.controls[0].controls[0] gridviewrow; if (((textbox)emptyrow.findcontrol("txtcode")).text == "")

in page load checked writing next code

gvnavigationdtls.databind(); command c = gvnavigationdtls.controls[0].findcontrol("txtcode"); if (c != null) { }

but c null,that means not able find command utilize it, please help,thanks in advance

protected void gvnavigationdtls_rowcommand(object sender, gridviewcommandeventargs e) { if (e.commandname.equals("einsert")) { textbox txtcode=(textbox)gvnavigationdtls.controls[0].controls[0].findcontrol("txtcode"); txtcode.text="your value"; } }

asp.net gridview

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -