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

Multiple row selection and RadGrid

3 Answers 1287 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 2
Peter asked on 17 Jan 2012, 07:09 PM
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>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jan 2012, 04:48 AM
Hello Peter,

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

-Shinu.
0
C
Top achievements
Rank 1
answered on 16 Dec 2014, 12:46 PM
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.
0
Konstantin Dikov
Telerik team
answered on 18 Dec 2014, 02:45 PM
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.

 
Tags
Grid
Asked by
Peter
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
C
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or