How to taken value in event rowEditing of gridview on asp.net -


code

 protected void grv_rowediting(object sender, gridviewediteventargs e)     {          string name = (grv.rows[e.neweditindex].cells[1].controls[0] textbox).text;     } 

or string name grv.rows[e.neweditindex].cells[1].value.tostring(); //not work.

you need databind gridview again able access control in edititemtemplate. try this:

gridview1.editindex = e.neweditindex;  gridview1.datasource = somedatasource; //bind grid find control  gridview1.databind();  textbox txt= gridview1.rows[e.neweditindex].findcontrol("textboxid") textbox;  string name = txt.text 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -