Multiple row selection and RadGrid

4 posts, 0 answers
  1. Peter
    Peter avatar
    9 posts
    Member since:
    Dec 2010

    Posted 17 Jan 2012 Link to this post

    Hi there,


    Im currently using RadGrid to display a set of users and Im trying to enable multiple selection of the rows via the GridClientSelectColumn. However, when I turned AllowMultiRowSelection="True" I did not have the ability to select an entire page of rows through the header checkbox. Only once I had enableheadercontextmenus was this made possible. I have noticed that sorting via columns works now also. Why is this the case? Can I get the same effect without context menus? I have attached pictures to better explain what I mean.

    Here is the code for my radgrid:

    <telerik:RadGrid EnableHeaderContextMenu="true" Skin="Metro" ID="UserListGrid" runat="server" DataSourceID="UserListDatasource" CellSpacing="0" GridLines="None" CssClass="userRadGrid" AllowPaging="True" AllowSorting="True" onpageindexchanged="UserListGrid_PageIndexChanged" AllowMultiRowSelection="True">
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
            <MasterTableView DataSourceID="UserListDatasource" AutoGenerateColumns="False">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridClientSelectColumn >
                    </telerik:GridClientSelectColumn>
                    <telerik:GridBoundColumn DataField="UserId" DataType="System.Guid" FilterControlAltText="Filter UserId column" HeaderText="UserId" SortExpression="UserId" UniqueName="UserId" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="UserName" FilterControlAltText="Filter UserName column" HeaderText="User Name" ReadOnly="True" SortExpression="UserName" UniqueName="UserName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FirstName" FilterControlAltText="Filter FirstName column" HeaderText="First Name" SortExpression="FirstName" UniqueName="FirstName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastName" FilterControlAltText="Filter LastName column" HeaderText="Last Name" SortExpression="LastName" UniqueName="LastName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column" HeaderText="Status" SortExpression="Status" UniqueName="Status">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ButtonType="LinkButton" UniqueName="DeleteUser">
                    </telerik:GridButtonColumn>               
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False" EnableEmbeddedBaseStylesheet="False">
                <WebServiceSettings>
                    <ODataSettings InitialContainerName="">
                    </ODataSettings>
                </WebServiceSettings>
            </FilterMenu>
            <HeaderContextMenu EnableEmbeddedBaseStylesheet="False" CssClass="GridContextMenu GridContextMenu_Default">
                <WebServiceSettings>
                    <ODataSettings InitialContainerName="">
                    </ODataSettings>
                </WebServiceSettings>
            </HeaderContextMenu>
        </telerik:RadGrid>

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Jan 2012 Link to this post

    Hello Peter,

    Check the following demo which implements the same.
    Grid / Client-Side Row Selection

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. C
    C avatar
    43 posts
    Member since:
    Jul 2013

    Posted 16 Dec 2014 in reply to Shinu Link to this post

    I find this type of reply perplexing. I mean, yes - the demo you link does work. That's good and all, but I've had MultiRowSelect work in the past, and I'm sure OP has too.

    But in OP's particular setup, and in one of my current ones - setting AllowMultiRowSelction="True" on the RadGrid does not enable multi row selection (including not displaying a checkbox in the header of the selection column).

    What am I supposed to do? I have tried disabling double click and detail table, because that is what I notice differs it from a grid I have where this works. But, to no avail.
  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 18 Dec 2014 Link to this post

    Hi,

    I have tested the same RadGrid settings from the initial post with dummy data and the header's CheckBox for selecting all items is correctly displayed and the selecting is working normally.

    Can you please elaborate which version of our controls you are using and provide the markup and the code-behind of your grid, so we can further investigate this.

    I am looking forward to your reply.


    Regards,
    Konstantin Dikov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top