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

Grid row click Select Does not work on initial load

1 Answer 458 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Operations
Top achievements
Rank 1
Operations asked on 29 Nov 2011, 07:00 PM
I have a grid that i want to be able to click the row and it becomes selected.  On initial load of the page it does not work.  Once I sort a column or click on another button on the page the functionality works I am able to click on a row and it becomes selected.
Any help or suggestions would be greatly appreciated.

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

    <AjaxSettings>

 

        <telerik:AjaxSetting AjaxControlID="RadGrid1">

 

            <UpdatedControls>

 

                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

            </UpdatedControls>

 

        </telerik:AjaxSetting>

 

    </AjaxSettings>

 

</telerik:RadAjaxManager>

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" MinDisplayTime="500" Transparency="25" BackColor="#ffffff" runat="server" CssClass="ajaxloader" />

 

<telerik:RadGrid ID="RadGrid1" runat="server"

 

AllowSorting="True" GridLines="None"

 

AutoGenerateColumns="false"

 

OnNeedDataSource="RadGrid1_NeedDataSource">

    <MasterTableView Width="100%" DataKeyNames="Id">

 

        <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelect" HeaderStyle-Width="5%" />

            <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" UniqueName="DisplayName" DataType="System.String" HeaderStyle-Width="20%" />

 

            <telerik:GridBoundColumn DataField="FileDateTime" HeaderText="Created Date/Time" UniqueName="Created" DataType="System.DateTime" HeaderStyle-Width="20%" DataFormatString="{0:MM/dd/yy hh:mm tt}" />

 

            <telerik:GridBoundColumn DataField="LastSentDateTime" HeaderText="Last Used" UniqueName="Sent" DataType="System.DateTime" HeaderStyle-Width="20%" DataFormatString="{0:MM/dd/yy hh:mm tt}" />
            <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="30%" HeaderText="Message Type" AllowFiltering="false" UniqueName="MessageFormat" SortExpression="MessageFormat">
                <ItemTemplate>
                    <asp:ImageButton ID="ibtnPhone" runat="server" ImageUrl="~/Images/pc_icon_phone.gif" CommandName="ListenPhone" ToolTip="Listen to message" />

 

                    <asp:ImageButton ID="ibtnSMS" runat="server" ImageUrl="~/Images/pc_icon_txt.gif" CommandName="ViewSMS" ToolTip="View SMS Message" />
                <
/ItemTemplate>

 

                <HeaderStyle HorizontalAlign="Left" />

 

                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
        </Columns>

 

    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="True" />

 

    </ClientSettings>

 

</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Nov 2011, 06:02 AM
Hello Andrew,

I cannot reproduce the issue at my end. Check the following demo which implements the same.
Grid / Client-Side Row Selection

-Shinu.
Aruna
Top achievements
Rank 1
commented on 22 Apr 2022, 11:46 PM

I am having the same issue. Once I refresh grid, row select event is happening
Vessy
Telerik team
commented on 25 Apr 2022, 06:14 AM

Hello Aruna, can you send me the setup leading to the problem so I can try to reproduce it at my end? Also, can you ensure that there are not any nested AJAX panels on the page? You can find more details on this matter here:

https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/how-to/frequently-asked-questions

Aruna
Top achievements
Rank 1
commented on 25 Apr 2022, 12:29 PM

you are so right. Actually there are two grids on my page. I re-wrote again with one grid only and radbuttons on the page are working correctly now. When I add another grid which has client side events/link buttons , it is interfering with the first grid and radbutton events. I will play more with it today and see if I can get both grid working correctly. one grid needs, which was causing the issue.

Thanks for the link, I will look into it.

I need below for the second grid. It has 3 link buttons in it.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat ="server" ClientEvents-OnRequestStart="onRequestStart" 
        DefaultLoadingPanelID="RadAjaxLoadingPanel1"   >


 

Vessy
Telerik team
commented on 25 Apr 2022, 02:16 PM

Hi Aruna,

I am glad my reply narrowed you in the right direction. Basically, having and AjaxManager with set OnRequestStart is a perfectly fine setup, unless there are nested AJAX panels in the AjaxManager settings themselves. If you need further assistance on this matter after the testing, do send me the AJAX setting on the page (the AjaxManager setup and all other ajax/update panels on the page if any) and I will be glad to review them.

Aruna
Top achievements
Rank 1
commented on 25 Apr 2022, 03:49 PM | edited

Actually I recreated the grid on a test page over the weekend. Ok, now I am trying to work on my second grid and it has link buttons and itemcommand is not firing.

code removed

Aruna
Top achievements
Rank 1
commented on 25 Apr 2022, 03:59 PM

I also tried 

 (sender as RadGrid).DataSource = getInvoices(); in

 protected void grdInvoices_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            grdInvoices.DataSource = getInvoices();
            (sender as RadGrid).DataSource = getInvoices();
        }

but seems like sender is not recognized.

Aruna
Top achievements
Rank 1
commented on 25 Apr 2022, 04:08 PM | edited

I have resolved the issue. Thanks

Vessy
Telerik team
commented on 26 Apr 2022, 12:12 PM

Hi Aruna,

I tested the provided setup but the "grdInvoices_ItemCommand" event handler is triggered properly at my end. You can find my test project attached to this reply - can you modify it up to a point where the issue occurs and send it back for a further investigation?

Aruna
Top achievements
Rank 1
commented on 26 Apr 2022, 01:29 PM

I resolved this issue yesterday itself by making causevalidation property of the link buttons to false.  The grid & itemcommand worked correctly when it is by itself but I had two grids, so needed causevalidation property on the buttons. Thank you though!
Vessy
Telerik team
commented on 26 Apr 2022, 01:55 PM

Thank you for the update, Aruna! It's great that you have found a way to resolve the issue!
Tags
Grid
Asked by
Operations
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or