c# - GridView SelectedValue is null after selecting a row -
i have simple gridview select button. in gridview.rowcommand event when select row want read gridview.selectedvalue null. time gridview.selectedvalue valued right data when select row twice.
protected void gridview1_rowcommand(object sender, gridviewcommandeventargs e) { code_bimehtextbox.text = gridview1.selectedvalue.tostring();//selectedvalue null after clicking select button after clicking again works right }
you using wrong event. when using select button should use selectedindexchanging , selectedindexchanged events. here can find complete list of buttons/events: gridview.rowcommand event
Comments
Post a Comment