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

How to disable grid client selection for subgrid

3 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Muhamed Shafi
Top achievements
Rank 1
Muhamed Shafi asked on 27 Sep 2011, 11:11 AM
Hi there,
    I have a radgrid with a subgrid in it. I have enabled the client selection and its working fine for me. But here it allows the user to select both the main grid and the sub grid rows. I want to disable the subgrid row selection and only enable main grid row selection. Any idea to do this ? Your help would be highly appreciated. Below is the grid styling code for your reference
<radG:RadGrid ID="radGdCopy" runat="server" AutoGenerateColumns="False" Skin="Office2007"
                                                                                                                            Width="100%" UseEmbeddedScripts="false" GridLines="None" AllowPaging="True" AllowSorting="True"
                                                                                                                            PageSize="10">
                                                                                                                            <MasterTableView CommandItemDisplay="None" Name="ParentGrid">
                                                                                                                                <CommandItemTemplate>
                                                                                                                                    <asp:Label ID="lblHeader" runat="server"></asp:Label>
                                                                                                                                </CommandItemTemplate>
                                                                                                                                <Columns>
                                                                                                                                    <radG:GridClientSelectColumn UniqueName="ClientSelectColumn" >
                                                                                                                                        <HeaderStyle HorizontalAlign="Center" Width="23px" />
                                                                                                                                    </radG:GridClientSelectColumn>
                                                                                                                                    <radG:GridBoundColumn DataField="ID" UniqueName="ID" Visible="False">
                                                                                                                                    </radG:GridBoundColumn>
                                                                                                                                    <radG:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name">
                                                                                                                                    </radG:GridBoundColumn>
                                                                                                                                    </Columns>
                                                                                                                                <DetailTables>
                                                                                                                                    <radG:GridTableView ShowHeadersWhenNoRecords="False" GridLines="None" runat="server"
                                                                                                                                        Name="ChildGrid"  AllowSorting="True">
                                                                                                                                        <Columns>
                                                                                                                                            <radG:GridBoundColumn DataField="subID" HeaderText="subID"
                                                                                                                                                UniqueName="subID">
                                                                                                                                            </radG:GridBoundColumn>
                                                                                                                                            <radG:GridBoundColumn DataField="subName" HeaderText="subName" UniqueName="subName">
                                                                                                                                            </radG:GridBoundColumn>
                                                                                                                                           </Columns>
                                                                                                                                                                                                                                                                         </radG:GridTableView>
                                                                                                                                </DetailTables>
                                                                                                                                <%--  <RowIndicatorColumn>
                                                                                                                                <HeaderStyle Width="20px" />
                                                                                                                            </RowIndicatorColumn>--%>
                                                                                                                                <ExpandCollapseColumn>
                                                                                                                                    <HeaderStyle Width="20px" />
                                                                                                                                </ExpandCollapseColumn>
                                                                                                                            </MasterTableView>
                                                                                                                            <PagerStyle Mode="NextPrevAndNumeric" />
                                                                                                                            <ClientSettings EnableClientKeyValues="true" ApplyStylesOnClient="true">
                                                                                                                                <Selecting AllowRowSelect="True" />
                                                                                                                                <ClientEvents  OnRowSelected="Copy_RowSelected" OnGridCreated="Copy_GridCreated" />
                                                                                                                            </ClientSettings>
                                                                                                                        </radG:RadGrid>

    
Thanks
Shafi

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Sep 2011, 12:22 PM
Hello Muhamed,

You can try the following help article approach t achieve your scenario.
Conditional Row Select in Hierarchy.

Thanks,
Shinu.
0
Muhamed Shafi
Top achievements
Rank 1
answered on 27 Sep 2011, 01:36 PM
Hi Shinu,
    Thanks for the reply. But eventArgs.get_tableView().get_name() gives me nothing in client side. Any additional coding is required to achieve this ?
Regards
Shafi
0
Princy
Top achievements
Rank 2
answered on 27 Sep 2011, 01:51 PM
Hello Muhamed Shafi,

You need to set the name for the tables like below.
aspx:
<DetailTables>
 <telerik:GridTableView DataKeyNames="OrderID"   runat="server" Name="Detail1">

Thanks,
Princy.
Tags
Grid
Asked by
Muhamed Shafi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Muhamed Shafi
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or