asp.net - Click Event for ImageButton Inside RadGrid -
i have asp.net imagebutton inside radgrid (in column) when clicked opens popup window. can expand same radgrid reveal nested grid. have button inside here need assign click event such opens same popup. how fire off imagebutton click that's housed inside radgrid?
here aspx , "imgedit" need fire off:
<mastertableview datakeynames="suggestionid"> <editformsettings captionformatstring="edit suggestion: {0}" captiondatafield="title" insertcaption="add suggestion" editformtype="webusercontrol" popupsettings-width="655px" usercontrolname="~/commonusercontrols/suggestioncontrol.ascx"> </editformsettings> <columns> <telerik:gridtemplatecolumn uniquename="editaction" headerstyle-width="32px" itemstyle-wrap="false" resizable="false"> <itemtemplate> <asp:imagebutton id="imgedit" runat="server" commandname="edit" resizable="false" imageurl="/esdnet/images/icons/pencil.png" tooltip="edit suggestion" visible='<%# eval("canedit") %>' />
you can achieve same in different ways:
1) directly attach button click event of imagebutton
protected void imgedit_click(object sender, imageclickeventargs e) { // code }
2) using commandname:
protected void radgrid1_itemcommand(object sender, telerik.web.ui.gridcommandeventargs e) { if(e.commandname=="edit") { } }
3) if commandname edit ,then autometically fire editcommand
protected void radgrid1_editcommand(object sender, telerik.web.ui.gridcommandeventargs e) { }
Comments
Post a Comment