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

Issue in SelectionChaning event

4 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Swathi
Top achievements
Rank 1
Swathi asked on 28 Dec 2010, 02:29 PM
hi Team,
     while Selection changing event in grid the expected result is the new row should not be selected if any condition is not met for the old row.
     But before the condition itself new row is being selected ,even e.cancel is set to true.

    Suggest me how to handle this.

Swathi.

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 28 Dec 2010, 02:38 PM
Hi Swathi,

Canceling the SelectionChanging event should not select the row. Let us see the relevant code so we can try to reproduce it locally.

Kind regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Swathi
Top achievements
Rank 1
answered on 29 Dec 2010, 05:01 AM

here is my event 
    void attributesDataGrid_SelectionChanging(object sender, SelectionChangingEventArgs e) {
            if (e.RemovedItems != null && e.RemovedItems.Count > 0) {
                DataRowView oldRowView = ((DataRowView)e.RemovedItems[0]);
                if (!ValidateAttributesGrid(oldRowView)) {
                    e.Cancel = true;
                }
            }
        }

 even e.cancel is set to true,row has been changed.

0
Veselin Vasilev
Telerik team
answered on 29 Dec 2010, 10:17 AM
Hello Swathi,

Please find attached a sample project. Select a row. Now select another row - it will not be selected because the event is canceled.


Regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Swathi
Top achievements
Rank 1
answered on 29 Dec 2010, 11:53 AM
Hi,
        I am unable to execute this sample projects as few references are missing.
        i have deleted and added the refrerences manually from Libs folder but still its not gettng added
all telerik dlls ,microsof.csharp.dll and system.xaml.dll are missing

actaully the event is restricting row selection but i am able to edit the other rows with out selecting that row,
suggest me how to restrict that

Thanks in advance.
Tags
GridView
Asked by
Swathi
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Swathi
Top achievements
Rank 1
Share this question
or