This is a migrated thread and some comments may be shown as answers.

get image control in databound

1 Answer 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ARUN RAJA
Top achievements
Rank 1
ARUN RAJA asked on 29 Jul 2010, 03:51 PM
hi
   how to get html image button control in telerik radgrid in databound event

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Jul 2010, 05:52 AM
Hello Arun,

You need to add the runat=server tag in that html control. Then you can access that control in ItemDataBound event by using following code snippet.

ASPX:
<telerik:GridTemplateColumn>
   <ItemTemplate>
      <input id="Button1" type="image" runat="server" value="button" />
   </ItemTemplate>
</telerik:GridTemplateColumn>

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
       if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            System.Web.UI.HtmlControls.HtmlInputImage btn1 = (System.Web.UI.HtmlControls.HtmlInputImage)item.FindControl("Button1");
        
    }

Thanks,
Princy.
Tags
Grid
Asked by
ARUN RAJA
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or