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

GridView link button in RadAjaxManger

10 Answers 174 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Harin Yadav
Top achievements
Rank 2
Harin Yadav asked on 02 Jul 2012, 10:38 AM
HI

i have linkbutton with commandargments to find the selectd value  inside a Gridview which on click navigates to new page with selectd value  in Quey String whic is used in landing page to show some data,this GridView  is ajaxified using radajaxmanger.
 
we shows 100 rows grouping 10rows are a group,

in page load if we click 14th row i..e  4th row in second group its giving correct values in command arguments
after a search im showing only rows of 2nd group i..e 11 to 20 rows
now if i clik the 14th row in  command arguments its giving 4th row of  first group

two days back only we have implemented  radajaxmanger,from then we are facing this issue

Please help me




10 Answers, 1 is accepted

Sort by
0
Harin Yadav
Top achievements
Rank 2
answered on 04 Jul 2012, 05:42 AM
can any one replay
0
Maria Ilieva
Telerik team
answered on 04 Jul 2012, 02:19 PM
Hello Harin,

Could you please let me know what the ajax setting you are implementing are? Please elaborate a bit more on your scenario. Also it will be helpful if you post your aspx page markup with the related code behind file or open a regular support ticket and send us a small runnable example which demonstrates the described issue. Thus we will be able to gather more details about your scenario, debug the application and investigate the problem.
Looking forward for your reply.



Greetings,
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
Harin Yadav
Top achievements
Rank 2
answered on 04 Jul 2012, 06:10 PM
HI Maria

im using RadAjaxManager on the Gridview

scenario
Link button in  Ajaxified  GridView  on click not giving correct Text
Example:
Suppose if have 100 rows in my Grid on Page load on clicking  the 14th link i take the link text in onclcik this is working fine
Now after Search Grid has 10 rows i..e  row10 t0 row20 if i click the same 14th row  which is at 4th position it gives me the text of 4th link intital page load..


i found one more issue if i dnt load Grid view on page  load and load it on button Click the link click event is not firing and grid is disappearing in the page,...

ASPX
<script type="text/javascript">
            function AjaxRequestStart() {
                $('[id$=Button1]').attr('disabled', 'true');
            }
            function AjaxResponseEnd(sender, args) {
                $('[id$=Button1]').removeAttr('disabled');
            
        </script>
        <telerik:radajaxmanager id="RadAjaxManager1" runat="server">
            <ajaxsettings>
                <telerik:AjaxSetting AjaxControlID="Button1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="GVDetailForecastBySeg" LoadingPanelID="RadAjaxLoadingPanel1"/>                         
                    </UpdatedControls>
                </telerik:AjaxSetting>               
            </ajaxsettings>
            <clientevents onrequeststart="AjaxRequestStart" onresponseend="AjaxResponseEnd" />
        </telerik:radajaxmanager>
        <telerik:radajaxloadingpanel id="RadAjaxLoadingPanel1" runat="server" skin="" transparency="1">
            <div class="loading" style="background-color: #fff; height: 100%; width: 100%; background-color: AliceBlue;">
                <br />
                <asp:Label ID="Label1" Text="Loading... Please wait..." runat="server" size="12px"
                    Font-Bold="true" Font-Names="Arial"></asp:Label>
                <br />
                <asp:Image ID="Image1" runat="server" ImageUrl="../Images/SmallUpdate2.gif" AlternateText="loading" />
            </div>
        </telerik:radajaxloadingpanel>
  
  
<table width="99%" bordercolor="#C0C0C0" border="0" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">
            <tr>
                <td>
                    <table style="font-size: xx-small; font-weight: bold; letter-spacing: 0.2pt; border: 2 outset #C0C0C0;
                        margin-top: -5px; margin-bottom: 0" width="80%">
                        <tr>
                            <td>
                                <asp:GridView ID="GVDetailForecastBySeg" CssClass="mGrid" runat="server" AutoGenerateColumns="False"
                                    OnRowDataBound="GVDetailForecastBySeg_RowDataBound" Font-Names="Arial" Font-Size="7.5pt"
                                    Width="100%">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Segment" HeaderStyle-HorizontalAlign="center" ItemStyle-Wrap="false"
                                            ItemStyle-Width="12%">
                                            <ItemStyle />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="CORE_GROUP" runat="server" CausesValidation="False" Font-Underline="true"
                                                    Text='<%# Bind("[Division_name]") %>' OnClick="lnk_Click">
                                                    
                                                </asp:LinkButton>
                                                <asp:LinkButton ID="lnkSub" runat="server" Text='<%# Bind("[Sub_Group]") %>' Visible="false"></asp:LinkButton>
                                                <asp:Label ID="lbllob" runat="server" Text='<%# Bind("[Division_name]") %>' Visible="false"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField ReadOnly="True" DataField="Base_Total" InsertVisible="False" ItemStyle-Width="7%"
                                            HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px" ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="Forecast_Renewal" InsertVisible="False"
                                            ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px"
                                            ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="Forecast_New" InsertVisible="False" ItemStyle-Width="7%"
                                            HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px" ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="Forecast_Other" InsertVisible="False"
                                            ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px"
                                            ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="Total" InsertVisible="False" ItemStyle-Width="7%"
                                            HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px" ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="Plan_Total" HeaderText="Plan" InsertVisible="False"
                                            ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="center" HeaderStyle-Font-Size="11px"
                                            ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="ForecastVSPlan" HeaderText="Forecast vs Plan"
                                            InsertVisible="False" ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="center"
                                            HeaderStyle-Font-Size="11px" ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                        <asp:BoundField ReadOnly="True" DataField="ForecasteVSPlan%" HeaderText="Forecast vs Plan %"
                                            InsertVisible="False" ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="center"
                                            HeaderStyle-Font-Size="11px" ItemStyle-Wrap="false">
                                            <ItemStyle HorizontalAlign="Right" />
                                        </asp:BoundField>
                                    </Columns>
                                    <SelectedRowStyle BackColor="darkgray" />
                                    <AlternatingRowStyle CssClass="alt" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>


.CS

protected void lnk_Click(object sender, EventArgs e)
  {
      LinkButton lnk = (LinkButton)sender;
      LinkButton lbl_SubGroup = (LinkButton)lnk.Parent.FindControl("lnkSub");
      string div = lnk.Text;
      string sub = lbl_SubGroup.Text;
0
Maria Ilieva
Telerik team
answered on 09 Jul 2012, 08:54 AM
Hi,

Could you please try wrapping the GridView in a regular asp Panel and add only a setting in which that panel updates itself like this:

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="GridViewPanel">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="GridViewPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
  
<asp:Panel ID="GridViewPanel" runat="server">
  <asp:GridView..............>
</asp:GridView>
</asp:Panel>


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
Harin Yadav
Top achievements
Rank 2
answered on 11 Jul 2012, 11:38 AM
HI Maria,

I tried the below code im able to get link text now
but on button click page is going complete post back and loding pannel is not comming
when i Click the link in the Grid view then the loding panels comes

i gusess this is because of <telerik:AjaxSetting AjaxControlID="GridViewPanel">

please help!
0
Maria Ilieva
Telerik team
answered on 13 Jul 2012, 02:00 PM
Hello Harin,

Please ensure that the mentioned button which initiate the request is also nested in the "GridViewPanel"

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
Rohinikumar
Top achievements
Rank 1
answered on 24 Aug 2012, 11:25 AM
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings
                <telerik:AjaxSetting AjaxControlID="GridViewPanel"
                    <UpdatedControls
                        <telerik:AjaxUpdatedControl ControlID="GridViewPanel" /> 
                    </UpdatedControls
                </telerik:AjaxSetting
            </AjaxSettings
        </telerik:RadAjaxManager
    
<asp:Panel ID="GridViewPanel" runat="server"
<asp:Button OnClientClick="this.value = 'Search';" UseSubmitBehavior="false" ID="Button1"
                        runat="server" OnClick="btnSearch_Click" CssClass="btn_style" Font-Bold="true"
                        Text="Search" />
  <asp:GridView..............
</asp:GridView
</asp:Panel>
Hello Maria,
I have tried adding button initiate request inside the asp:panel. Still it does not works. Still the positioning problem persists.
0
Rohinikumar
Top achievements
Rank 1
answered on 27 Aug 2012, 12:10 PM
Anyone please help?
0
Rohinikumar
Top achievements
Rank 1
answered on 28 Aug 2012, 09:57 AM
Is there anyone to help me please?
0
Maria Ilieva
Telerik team
answered on 28 Aug 2012, 12:05 PM
Hi Rohinikumar,

As the previously provided suggestions did not help it will be best if you could open a regular support ticket and send us runnable version of your application which demonstrates the problem. Thus we will be able to inspect it locally and do our best to provide a proper solution.

Thank you for your cooperation.

Greetings,
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
Ajax
Asked by
Harin Yadav
Top achievements
Rank 2
Answers by
Harin Yadav
Top achievements
Rank 2
Maria Ilieva
Telerik team
Rohinikumar
Top achievements
Rank 1
Share this question
or