11 Answers, 1 is accepted
0
Hi Ilya,
Multirow selection is only available in our latest release Q2 2007. To allow multiple row selection set the MultiSelect property to true and SelectionMode to GridViewSelectionMode.FullRowSelect.
You can monitor when selected rows are changed by attaching to SelectionChanged event. All selected rows are available through SelectedRows collection.
Hope this helps. Please contact us again, if we can be of any further assistance.
All the best,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Multirow selection is only available in our latest release Q2 2007. To allow multiple row selection set the MultiSelect property to true and SelectionMode to GridViewSelectionMode.FullRowSelect.
this.radGridView1.MultiSelect = true; |
this.radGridView1.SelectionMode = GridViewSelectionMode.FullRowSelect; |
You can monitor when selected rows are changed by attaching to SelectionChanged event. All selected rows are available through SelectedRows collection.
this.radGridView1.SelectionChanged += new EventHandler(radGridView1_SelectionChanged); |
void radGridView1_SelectionChanged(object sender, EventArgs e) |
{ |
int i = 0; |
foreach (GridViewRowInfo row in this.radGridView1.SelectedRows) |
i += (int)row.Cells[0].Value; |
} |
Hope this helps. Please contact us again, if we can be of any further assistance.
All the best,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Louis
Top achievements
Rank 1
answered on 15 Oct 2007, 06:42 PM
One question here regarding this event.
When i click in the grid but not on a row, this event is raised with SelectedRows.Count == 0, which is ok but the grid shows a selected row??
If i look in the CurrentRow, there is something? shouldn't the SelectedRows.count == 1 when the CurrentRow is set ?
I'm deleting rows when a user is pressing a button. First select the rows you want to delete and then delete them. but the problem is that CurrentRow and SelectedRows are different things. Why? both shows as selected in my grid.
When i click in the grid but not on a row, this event is raised with SelectedRows.Count == 0, which is ok but the grid shows a selected row??
If i look in the CurrentRow, there is something? shouldn't the SelectedRows.count == 1 when the CurrentRow is set ?
I'm deleting rows when a user is pressing a button. First select the rows you want to delete and then delete them. but the problem is that CurrentRow and SelectedRows are different things. Why? both shows as selected in my grid.
0
Hello Louis ,
CurrentRow is synchronized with the RadGridView currency manager and its Position property. Only one row in the RadGridView can be set as current. On the other hand, SelectedRows represents a collection of rows selected by the user using keyboard or the mouse. Maybe the issue is that the CurrentRow and the SelectedRows have the same visual representation in standard RadGridView themes. We will reconsider this for our next major release Q3.
You are correct - SelectedRows must be set when the CurrentRow is set by mouse click. We will correct this behavior in our next service pack. We have added 500 points to your account for the suggestion.
Thank you for writing, and please, don't hesitate to contact us if you have other questions.
Kind regards,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
CurrentRow is synchronized with the RadGridView currency manager and its Position property. Only one row in the RadGridView can be set as current. On the other hand, SelectedRows represents a collection of rows selected by the user using keyboard or the mouse. Maybe the issue is that the CurrentRow and the SelectedRows have the same visual representation in standard RadGridView themes. We will reconsider this for our next major release Q3.
You are correct - SelectedRows must be set when the CurrentRow is set by mouse click. We will correct this behavior in our next service pack. We have added 500 points to your account for the suggestion.
Thank you for writing, and please, don't hesitate to contact us if you have other questions.
Kind regards,
Jack
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0

Benny
Top achievements
Rank 1
answered on 21 Apr 2010, 10:57 AM
What's the best way to avoid deselection of the selected rows when clicking an already selected row?
I'm developing a drag&drop application and the user needs to be able to drag multiple rows at once.
Scenario
1. User selects three rows
2. User clicks one of the selected rows to start dragging but the previous rows gets deselected and only one row is dragged.
I'm developing a drag&drop application and the user needs to be able to drag multiple rows at once.
Scenario
1. User selects three rows
2. User clicks one of the selected rows to start dragging but the previous rows gets deselected and only one row is dragged.
0
Hi Benny,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
This could be achieved by replacing the default grid behavior. Please consider the sample code snippet below:
this
.radGridView1.GridBehavior =
new
CustomGridBehavior();
public
class
CustomGridBehavior : BaseGridBehavior
{
public
override
bool
OnMouseDown(MouseEventArgs e)
{
GridCellElement cell = GridControl.ElementTree.GetElementAtPoint(e.Location)
as
GridCellElement;
if
(e.Button == MouseButtons.Left && cell !=
null
&& cell.RowInfo.IsSelected)
{
return
true
;
}
return
base
.OnMouseDown(e);
}
}
I hope this helps.
Regards,Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Benny
Top achievements
Rank 1
answered on 07 May 2010, 12:55 PM
Hi Jack,
Your solution is blocking my drag and drop because I start the drag on the MouseDown-event in my main form.
If a row is (or multiple rows are) selected, my drag event isn't fired anymore because the event is interrupted in the CustomGridBehavior.
Therefore I needed to fire this event manually:
Just to let you know :o)
Thanks for the provided solution!
Your solution is blocking my drag and drop because I start the drag on the MouseDown-event in my main form.
If a row is (or multiple rows are) selected, my drag event isn't fired anymore because the event is interrupted in the CustomGridBehavior.
Therefore I needed to fire this event manually:
this.radGridView1.GridBehavior = new CustomGridBehavior(); |
public class CustomGridBehavior : BaseGridBehavior |
{ |
public override bool OnMouseDown(MouseEventArgs e) |
{ |
GridCellElement cell = GridControl.ElementTree.GetElementAtPoint(e.Location) as GridCellElement; |
if (e.Button == MouseButtons.Left && cell != null && cell.RowInfo.IsSelected) |
{ |
Grid.StartDrag( base.GridControl, e.Location ); // start dragging |
return true; |
} |
return base.OnMouseDown(e); |
} |
} |
Just to let you know :o)
Thanks for the provided solution!
0
Hello Benny,
I am glad to hear that you have found a solution for this issue and thank you for sharing it. If you have other questions, we will be glad to help further.
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I am glad to hear that you have found a solution for this issue and thank you for sharing it. If you have other questions, we will be glad to help further.
All the best,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Dipak
Top achievements
Rank 1
answered on 01 Sep 2010, 06:49 PM
Hi
I have same issue when user select all the rows and right click to open context menu and looses selection.
I tried with CustomGridBehaviour but it is not opening Context Menu.
Could you please help me to resolve this issue?
Thanks
Dipak
I have same issue when user select all the rows and right click to open context menu and looses selection.
I tried with CustomGridBehaviour but it is not opening Context Menu.
Could you please help me to resolve this issue?
Thanks
Dipak
0
Hello Dipak,
I confirm that this issue appeared in old versions of RadGridView. However, it should have been addressed in our latest release - Q2 2010 SP1. Could you confirm that you are using the latest release? If yes, please open a new support ticket and send me your application and I will try to locate the issue.
I am looking forward to your reply.
Regards,
Jack
the Telerik team
I confirm that this issue appeared in old versions of RadGridView. However, it should have been addressed in our latest release - Q2 2010 SP1. Could you confirm that you are using the latest release? If yes, please open a new support ticket and send me your application and I will try to locate the issue.
I am looking forward to your reply.
Regards,
Jack
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

Dipak
Top achievements
Rank 1
answered on 03 Sep 2010, 05:23 PM
Hi Jack
I am using Q2 2010 Sp1 it persists in this version. I have also tried with interim build XXX.825 and experiencing same issue in that.
Thanks
Dipak
I am using Q2 2010 Sp1 it persists in this version. I have also tried with interim build XXX.825 and experiencing same issue in that.
Thanks
Dipak
0
Hi Dipak,
Please, send me your application. This will help us to locate and address the issue. Thank you in advance.
Greetings,
Jack
the Telerik team
Please, send me your application. This will help us to locate and address the issue. Thank you in advance.
Greetings,
Jack
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items