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

Can User Edit Row

5 Answers 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi Avni
Top achievements
Rank 1
Avi Avni asked on 06 Jul 2011, 01:03 PM

Hello

Is there property can user edit row?

Best regards

Ehud

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 07 Jul 2011, 06:36 AM
Hello Ehud Pinchas,

Do you mean to edit a single row? If this is the case there is not such a general property of each row. 

May you please specify what exactly your scenario is?

All the best,
Didie
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Avi Avni
Top achievements
Rank 1
answered on 07 Jul 2011, 06:56 AM

Hello Didie

The scenario is when I select specific row

I want that the user can't select other rows

So I do can user select == false

 The problem is he can edit rows  

So I need to prevent the edit in the other rows

Best regards

Ehud

0
Dimitrina
Telerik team
answered on 08 Jul 2011, 02:54 PM
Hello Ehud Pinchas,

Have you tried using IsReadOnlyBinding for the row of the RadGridView? 

 I am not sure if I understand what your scenario is. If the IsReadOnlyBinding does not solve your problem, may you please specify more about what your idea is? Are you editing the selected row, or are you just selecting it? 

Kind regards,
Didie
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Avi Avni
Top achievements
Rank 1
answered on 10 Jul 2011, 07:08 AM

Hello Didie

Is read only binding is not good for this.

 The user selects one Row and he can edit this row in the grid

Or in different view (like master details).

So as long the user edit this row he can't select other rows or edit them.

Can't select work, but the user can edit other rows (this is the problem).

Hope that's clear the scenario.

Best regards

Ehud

0
Dimitrina
Telerik team
answered on 12 Jul 2011, 09:39 AM
Hello Ehud Pinchas,

It would be difficult to provide an simple and general solution for that situation. The important key note here is how are you commiting the current edited row?

1. If you are commiting on 'Enter' click, then you may make all the not edited rows ReadOnly using these event handlers:

this.clubsGrid.BeginningEdit += new EventHandler<GridViewBeginningEditRoutedEventArgs>(clubsGrid_BeginningEdit);
this.clubsGrid.RowEditEnded += new EventHandler<GridViewRowEditEndedEventArgs>(clubsGrid_RowEditEnded);
this.clubsGrid.RowLoaded += new EventHandler<RowLoadedEventArgs>(clubsGrid_RowLoaded);

When you click 'Enter' the row will be committed and the next item will start to be edited. I have prepared a sample project to show this approach.

2. If you are committing on a button click, then you may subscribe to the RowValidating event of the RadGridView. Inside it you may set the row to be not valid until one of the accept/cancel editing buttons has been clicked. You may use a global variable (commandCalled) to save the state of the buttons' "click". 

Is any of this approaches meeting your requirements?

Regards,
Didie
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Avi Avni
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Avi Avni
Top achievements
Rank 1
Share this question
or