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

question about multi-row select + row click

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 19 Jan 2009, 04:59 PM
I have a RadGrid with AllowRowSelect="true", AllowMultiRowSelection="true", and a GridClientSelectColumn.

When I select items using the checkbox, multi-row selection works great. But when I select items by clicking on them, it undoes all of my previous selections!  This would be really inconvenient for the user because if they miss the checkbox by just 1px all of their selecting work will be gone.  And if the user has scrolled on the page to make the final selection, they won't even know that everything else has been un-selected.

Is there a setting I can change so that clicking a row adds to the selection instead of resetting to select just that item? Or alternatively, could I disable the "select on row click" functionality and force them to use the checkbox?

Thanks in advance. Here's my code:

            <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" AllowFilteringByColumn="false" 
                AutoGenerateColumns="False" AllowMultiRowSelection="True" DataSourceID="DrugDataSource">  
                <ClientSettings> 
                    <Selecting AllowRowSelect="true" /> 
                </ClientSettings> 
                <MasterTableView AllowNaturalSort="false" DataKeyNames="DrugID" GridLines="None">  
                    <Columns> 
                        <telerik:GridClientSelectColumn> 
                        </telerik:GridClientSelectColumn> 
                        <telerik:GridTemplateColumn DataField="BrandName" HeaderText="Brand Name" UniqueName="BrandName" 
                            AutoPostBackOnFilter="true" AllowFiltering="true" SortExpression="BrandName">  
                            <HeaderStyle Width="35%" /> 
                            <ItemTemplate> 
                                <%# Eval("BrandName") %></ItemTemplate>  
                            <EditItemTemplate> 
                                <span class="mandatory">*</span> 
                                <asp:TextBox ID="txtBrandName" runat="server" Text='<%# Bind("BrandName") %>'></asp:TextBox> 
                                <asp:RequiredFieldValidator ID="ReqBrandName" runat="server" ControlToValidate="txtBrandName" 
                                    ErrorMessage="<div>Please enter a brand name.</div>" CssClass="errorstatus" Display="Dynamic"></asp:RequiredFieldValidator> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn DataField="ScientificName" HeaderText="Generic Name" 
                            AutoPostBackOnFilter="true" AllowFiltering="true" UniqueName="ScientificName" 
                            SortExpression="ScientificName">  
                            <HeaderStyle Width="35%" /> 
                            <ItemTemplate> 
                                <%# Eval("ScientificName") %></ItemTemplate>  
                            <EditItemTemplate> 
                                <span class="mandatory">*</span> 
                                <asp:TextBox ID="txtScientificName" runat="server" Text='<%# Bind("ScientificName") %>'></asp:TextBox> 
                                <asp:RequiredFieldValidator ID="ReqScientificName" runat="server" ControlToValidate="txtScientificName" 
                                    ErrorMessage="<div>Please enter a scientific name.</div>" CssClass="errorstatus" 
                                    Display="Dynamic"></asp:RequiredFieldValidator> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns> 
                    <RowIndicatorColumn Visible="False">  
                        <HeaderStyle Width="20px" /> 
                    </RowIndicatorColumn> 
                </MasterTableView> 
            </telerik:RadGrid> 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Jan 2009, 04:28 AM
Hello Kelly,

You can go through the following code library submission which demonstrates on how to select grid rows only when a GridClientSelectColumn checkbox is clicked.
ClientSideSelectColumn - Disallow other selection

Thanks
Princy.



0
towpse
Top achievements
Rank 2
answered on 03 Feb 2009, 06:46 PM
Doesn't seem to work for me completely.
The row is still getting highlighted.
Each row that I click on is subsequently highlighted.
Tags
Grid
Asked by
Kelly
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
towpse
Top achievements
Rank 2
Share this question
or