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

Prevent RowSelection from Changing

1 Answer 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Somnath
Top achievements
Rank 1
Somnath asked on 07 Apr 2011, 09:20 AM
HI

I have Q3 2010 version for telerik Wincontrols ...

Let me know any way, to prevent  changes in selected rows count....
if having certain condition....

for Example--
   suppose, Gridview selected rows count is 5 And a bool variable XXX is true
Then end user should not be able to select  any other row....

Thanks

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 12 Apr 2011, 04:22 PM
Hi Somnath,

You can use the CurrentRowChanging event to prevent changing the current row (respectively the selection in RadGridView):

private void radGridView1_CurrentRowChanging(object sender, CurrentRowChangingEventArgs e)
{
    e.Cancel = this.radGridView1.SelectedRows.Count == 5;
}

The code above is applicable when multi-selection in RadGridView is enabled.

Greetings,
Svett
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
Tags
GridView
Asked by
Somnath
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or