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

How to ajaxify a GridButtonColumn ?

1 Answer 113 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Gotcha
Top achievements
Rank 1
Gotcha asked on 17 Nov 2011, 08:47 PM
Hi I need to ajaxify a column in a grid in a Usercontrol... i did a search and found an example on how to achieve it but the sample was using an asp button...
How can i achieve the same thing without the use of the asp:button

<telerik:GridButtonColumn ButtonType="PushButton" CommandName="ViewResults" 
FilterControlAltText="Filter ViewButton 
column"<BR>                                    
Text="View Results" UniqueName="ViewButton" DataTextField="CRM_TRACKING_ID" 
HeaderText="CRM Tracking ID"><BR></telerik:GridButtonColumn>

Also, just to confirm, Can i still use this snippet even if mine is called from a user control with a RadAjaxManagerProxy? The AjaxManager is from my Master Template...

    protected void RadGrid1_ItemCreated(object sender, Telerik.WebControls.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            ImageButton ImageButton1 = (ImageButton)item["TemplateColumn"].FindControl("ImageButton1"); 
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(ImageButton1, TextBox1, null); 
        } 
    } 

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 18 Nov 2011, 05:38 PM
Hello Gotcha,

You can see how functionality similar to the desired can be implemented here.
When there is a RadAjaxManagerProxy in the usercontrol and RadAjaxManager in the page, I recommend that you add the setting to the manager:
protected void RadGrid1_ItemCreated(object sender, Telerik.WebControls.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        ImageButton ImageButton1 = (ImageButton)item["TemplateColumn"].FindControl("ImageButton1");
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(ImageButton1, TextBox1, null);
    }
}
Please examine the RadAjax and WebUserControls topic for additional information.

I hope this helps.

All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Ajax
Asked by
Gotcha
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or