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

RadAjaxManager Telerik help sample code

5 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Madhan
Top achievements
Rank 1
Madhan asked on 08 Nov 2012, 01:45 PM
I am trying to execute "Ajaxify particular templated gridview buttons" code from the below link.

http://www.telerik.com/help/aspnet-ajax/ajax-ajaxify-particular-templated-gridview-buttons.html#seeAlsoToggle

the imagebutton works well and updated textbox. but the buttonfield(standard postback on textbox) is not getting updated.Please help.

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 Nov 2012, 09:35 AM
Hello Madhan,

Could you please share the exact code you are using for ajaxifying the problematic fields? Thus we will be able to investigate on your implementation and do our best to provide a proper solution.

Kind regards,
Maria Ilieva
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.
0
Madhan
Top achievements
Rank 1
answered on 13 Nov 2012, 03:05 PM
Thanks for the response, Maria. Sure, I have included the code for ajaxifying the problematic fields. Please help.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="GridView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridView1" />
                    <telerik:AjaxUpdatedControl ControlID="TextBox" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <asp:TextBox ID="TextBox1" runat="server" Width="400px" Text="not updated"></asp:TextBox>
         
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName] FROM [Customers]">
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" AllowPaging="True" runat="server"
            OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated">
            
            <Columns>
                <asp:TemplateField HeaderText="TemplateField">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton1" CommandName="MyCommand" CommandArgument='<%# Eval("CustomerID") %>'
                            ImageUrl="~/images/arrow.gif" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                 
                       <asp:ButtonField ButtonType="Button" HeaderText="ButtonField" CommandName="Test"
            Text="Button" ImageUrl="~/images/arrow.gif" />
 
                     
            </Columns>
        </asp:GridView>
</div>
 
 
protected void GridView1_RowCreated(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.PreRender += new System.EventHandler(Row_PreRender);
        }
    }
 
    protected void GridView1_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        TextBox1.Text = string.Format("CommandName:{0}, CommandArgument:{1}", e.CommandName, e.CommandArgument);
         
    }
 
    protected void Row_PreRender(object sender, System.EventArgs e)
    {
 ImageButton ImageButton1 = ((ImageButton)(((Control)(sender)).FindControl("ImageButton1")));// error: imagebutton was null
               RadAjaxManager1.AjaxSettings.AddAjaxSetting(ImageButton1, TextBox1);
}
0
Madhan
Top achievements
Rank 1
answered on 15 Nov 2012, 09:35 PM
Can anyone please help me on this as soon as possible? Thanks
0
Madhan
Top achievements
Rank 1
answered on 16 Nov 2012, 11:07 AM
Thanks for the help. Its working now. I didn't understood the concept properly before. Now, Everything works... and please excuse my post.
0
Maria Ilieva
Telerik team
answered on 16 Nov 2012, 12:21 PM
Hi Madhan,

Thank you for updating us on this issue. We are glad you were able to isolate the problem on your end. Do not hesitate to contact us back in case any other issues appear or if further assiatance is needed.

Kind regards,
Maria Ilieva
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
Grid
Asked by
Madhan
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Madhan
Top achievements
Rank 1
Share this question
or