Public void gridview_rowcomman (Object sender, eventage E)
{
Gridview grid = (gridview) E. commandsource;
Label lblfid = (Label) grid. Rows [convert. toint32 (E. commandargument)]. cells [0]. findcontrol ("lblfid ");
Checkbox check = (checkbox) grid. Rows [convert. toint32 (E. commandargument)]. cells [0]. findcontrol ("chkfid ");
If (E. commandname = "delcomman ")
{
Bool flag = false;
If (check. Checked = true)
{
Stringbuilder sb = new stringbuilder ();
SB. Remove (0, SB. Length );
SB. append (sb. appendformat ("delete from cf_sys_dic where FID = '{0}'", lblfid. Text. Trim ()));
Flag = RC. pexcute (sb. tostring ());
If (! Flag)
Scriptmanager. registerstartupscript (this, this. GetType (), "deltopic", "alert ('Sorry, deletion failed! '); ", True );
Else
Gridview1.databind ();
}
}
Else
{
Scriptmanager. registerstartupscript (this, this. GetType (), "deltopic", "alert ('" + lblfid. Text. tostring () + "');", true );
}
}