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

[Solved] check box behaviour on grid

12 Answers 315 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krishna
Top achievements
Rank 1
Krishna asked on 19 Mar 2009, 01:23 AM
Hi
i have checkbox column as below
            <grid:GridClientSelectColumn HeaderStyle-HorizontalAlign="Center"  HeaderStyle-Width="5%" UniqueName="cbxPortfolioTermMap"  HeaderText="" HeaderStyle-CssClass="columnheader"/>

if i click on any row the check box is checking out.. and if i click any other row other than the one seleted the checked one is unchecked and the selected is checking ..

if i particularly select /deselect check box alone it works fine.. but it is checking out when i click on the row of any column

how to remove the control on the row selection

please help
thanks
-krishna


12 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Mar 2009, 03:38 AM
Hello Krishna,

If you want to allow row selection only by clicking on the checkbox of the GridClientSelectColumn and not by clicking on the row then you can refer to the following code library submission which illustrates on how to select grid rows only when a GridClientSelectColumn checkbox is clicked.
ClientSideSelectColumn - Disallow other selection

Thanks
Princy.
0
Krishna
Top achievements
Rank 1
answered on 19 Mar 2009, 06:50 PM
hi Princy,
that property is already set to grid.. may be i should explain it properly.

when i select any row on any column the check box is checked.. and if i select other row then the selected one deselects by unchecking the checkbox and checks out the current selected row's check box..

if i click on only check box square area (not even on the checkbox column) i am able to select the multiple check boxes.
after selecting 10 check boxes (tha means 10 rows are selected now) and trying to check the 11th one ..and mistakenly my mouse just clicked ...out of the check box square area all other 10 checke/selected rows are deselecting and 11th one is checked and selected.

my goal is to select/deselect only the clicked row withought effecting all other previously selected ones

Thanks
-krishna


0
Andrew
Top achievements
Rank 1
answered on 14 May 2009, 12:39 PM
Hi,

I am having the same problem, I believe Telerik should correct this issue. You should be able to click a row without it affecting the rest of the other rows.

If the row clicked is already selected, the it should deselect that row (only), and vice versa, if it's deselected already then it should select that row only.

I CAN'T STAND IT when I have selected 20 rows and then when I accidently click outside a checkbox, I loose all my selections. I have the following radgrid, please show me if there is a way, how to achieve this. I already tried the ToggleSelection.js solution, but I get alot of errors because it was not designed for Heirarchy Grid.

 

<telerik:RadGrid ID="rgChildObjects" AllowMultiRowSelection="true" AutoGenerateColumns="false" Width="295px" runat="server">

 

 

<MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="client" Name="ChildObjects" DataKeyNames="ReportingChildObjectID">

 

 

<DetailTables>

 

 

<telerik:GridTableView Name="Columns" Width="100%" ShowHeader="true" DataKeyNames="ReportingColumnID">

 

 

<Columns>

 

 

<telerik:GridClientSelectColumn />

 

 

<telerik:GridBoundColumn HeaderStyle-Font-Bold="true" itemstyle-wrap="false" UniqueName="DefaultDescription" DataField="DefaultDescription" HeaderText="Child Report Column(s)" />

 

 

</Columns>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<Columns>

 

 

<telerik:GridBoundColumn ItemStyle-font-bold="true" HeaderStyle-Font-Bold="true" HeaderStyle-wrap="false" UniqueName="ChildObjectName" DataField="ChildObjectName" HeaderText="Child Reports" />

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowExpandCollapse="true">

 

 

 

<Selecting EnableDragToSelectRows="false" AllowRowSelect="true" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

0
Sebastian
Telerik team
answered on 18 May 2009, 11:55 AM
Hello guys,

Unfortunately the client select column and the overall client selection of the gird cannot be easily altered due to two major reasons:

  1. It would be difficult to implement cross-browser solution which to cover your requirements and being stable at the same time.
  2. Such significant change will break the previous client selection behavior and many of our clients which are used to it will not be happy with the result.

I hope that you understand our position on this subject and relying on Ctrl + mouse click as shown on this demo to ensure that the grid rows will be selected as expected is feasible workaround for you.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Andrew
Top achievements
Rank 1
answered on 25 May 2009, 12:31 PM
Hi there,

I'm afraid that I too agree with Andrew and Krishna.

You have inconsistent behaviours on the two types of client click on a row.

When you click the GridClientSelectColumn checkbox the property AllowMultiRowSelection is respected.  When you click on the actual row, the property AllowMultiRowSelection is not respected.

I'm afraid the CTRL + click is not an acceptable workaround.  When you set AllowMultiRowSelection to true, the row click should maintain the existing selected rows and select the new one too.

Are there any plans to make this the case, because it is simply confusing as it currently stands.

thanks,
0
Sebastian
Telerik team
answered on 26 May 2009, 10:41 AM
Hello Greg,

We do not have immediate plans for changing the current client selection behavior because of the important reasons explained in my previous message. I hope that using the Ctrl + mouse click combination or dragging a region for multi-row selection (and including user-friendly message to notify that this is required when not using the GridClientSelectColumn checkboxes) is doable solution for your case.

Note that the current behavior matches that of Windows Explorer and it is considered as the most intuitive by the majority of our clients/community members. I truly hope that you understand our point of view and appreciate sharing your thoughts with us.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Robert Helm
Top achievements
Rank 1
answered on 08 Jul 2009, 08:02 PM
Princy,

Thanks for the link. That seems to have fixed it.

Bob
0
Karim
Top achievements
Rank 1
answered on 25 Nov 2009, 11:59 PM
The solution provided in the link only solves part of the problem. It does prevent the row from being selected if someone clicks on the row itself. However, this still causes any existing selected rows to become deselected. Is there any way to preserve the existing selected rows?

As someone else mentioned earlier, the current behavior is really counter-intuitive. The claim is that this is how it's done in Windows Explorer. That's only partially true. In the general grid case, yes, this is expected. However, Windows Explorer does not have checkboxes. Checkboxes, by definition, imply that multi-select is enabled, and that, clicking anywhere on the grid won't cause the previous selections to be lost. Holding down the ctrl or shft keys when selecting is _not_ a reasonable workaround, as the average user doesn't work that way (and even if we asked them to, it's just too easy to accidentally click a row and lose the entire selection). If fixing this is not in your current plans, I strongly urge you to reconsider, because this is a very annoying and unacceptable shortcoming of the grid's multi-select functionality.

In the meantime, I'm blocked on my initial question. Is there any way that I can prevent a row click from deselecting the existing selected rows?

Thanks.
0
Sebastian
Telerik team
answered on 26 Nov 2009, 10:04 AM
Hello Karim,

I checked both projects from the code library thread linked by Princy and they worked as expected (no rows become selected/deselected when you click on area outside of the client select checkbox). Am I missing something obvious? I will appreciate if you specify exact steps which can help me replicate the abnormality locally.

Regarding your proposal:
I will forward it to our developers for further consideration. However, I cannot guarantee that your request can be fulfilled due to the complexity of the grid client multi-select feature and its various aspects/cross-browser support. Furthermore, changing the client selection behavior will introduce a breaking change which may not be accepted positively by some of our existing customers. I hope that the current solution from the code library entry is doable for you.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Karim
Top achievements
Rank 1
answered on 28 Nov 2009, 10:54 PM
Hello Sebastian,

I did not say that there was a bug in the code examples; those are working as expected. What I'm saying is that their as-designed behavior is counter-intuitive and unacceptable in many scenarios, as has been repeatedly mentioned by many of your users in this thread and others.

Additionally, I'm not asking the default behavior to be changed. I'm asking that a flag/property be added that lets me control how I want this multi-select functionality to behave. Maybe a property called PreserveSelectedOnRowClick. When this property is set, the code that de-selects the selected rows on a row click would just simply be ignored, thereby preserving the existing selections. The grid already has many such properties, so I don't believe it would be difficult to add something like this.

On another note, as I mentioned earlier, the provided solution is not doable for me, hence the reason for my question in the first place. The question I have is that the provided solution only stops the row from being selected, but it does not stop the existing selections from becoming unselected. Is there a way/workaround/hack to prevent this latter behavior from happening?

Thanks.
0
Rosen
Telerik team
answered on 30 Nov 2009, 02:21 PM
Hello Karim,

I'm happy to inform you that our developers has addressed you request. A new property, named UseClientSelectColumnOnly, of Grid's ClientSettings Selection object has been added.
 This feature will be officially available with SP1 of Q3 2009 release of RadControls for ASP.NET AJAX. Also you can also check next internal builds for a preview version.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Karim
Top achievements
Rank 1
answered on 30 Nov 2009, 10:59 PM
Thanks, Rosen. I'll look forward to the release.
Tags
Grid
Asked by
Krishna
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Krishna
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Sebastian
Telerik team
Andrew
Top achievements
Rank 1
Robert Helm
Top achievements
Rank 1
Karim
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or