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

[Solved] GridView 's IsReadOnly property can only be set one time

4 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
xp
Top achievements
Rank 1
xp asked on 24 Aug 2009, 09:42 PM
I have a GridView which is in Read Mode (_myGridView.IsReadOnly = true).  After clicks "Edit" button, I programmatically change it to Edit mode. IE
    _myGridView.IsReadOnly = false;

there are 2 problems here. Please help. Urgent!!!
Problem 1. User can edit any cell now,however, the cell value will change back to original value as soon as cell focus leaves to another cell.
Problem 2. If user clicks "Cancel" or "Save" button,  I programmatically change it to Read mode. IE
    _myGridView.IsReadOnly = true;
Starting from now on, the GridView is unable to be edited anymore no matter how I set _myGridView.IsReadOnly = false; or _myGridView.BeginEdit();

  
  

4 Answers, 1 is accepted

Sort by
0
xp
Top achievements
Rank 1
answered on 25 Aug 2009, 03:15 PM
There are 2 critical issues and need your URGENT answer!!!!!!!!!
0
Nedyalko Nikolov
Telerik team
answered on 27 Aug 2009, 08:10 PM
Hi sam,

It seems that you've hit a bug in our control. Fortunately there is a workaround. There are two properties which take part into editing - IsReadOnly and DataMemberBinding, both properties are set automatically if they are not set explicitly. The workaround is to set DataMemberBinding.Mode to BindingMode.TwoWay - this will make committing of the new value possible. Also you have to set IsReadOnly to every column every time when you change RadGridView.IsReadOnly.

This bug is already fixed and will be available with latest internal build (next Friday).

P.S. I've updated your Telerik points accordingly.

Sincerely yours,
Nedyalko Nikolov
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
xiaofeng
Top achievements
Rank 1
answered on 07 Sep 2009, 03:45 AM
Have you Fix this bug now?Can I get a column by UniqueName?Thank you!
0
Nedyalko Nikolov
Telerik team
answered on 09 Sep 2009, 12:02 PM
Hi xiaofeng,

Straight onto your questions:

1. Fix for this bug is already available with latest internal build binaries.
2. You can get columns by index or UniqueName:

GridViewColumn firstColumn = radGridView.Columns[0]; 
GridViewColumn customerIDColumn = radGridView.Columns["CustomerID"]; 


Sincerely yours,
Nedyalko Nikolov
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.
Tags
GridView
Asked by
xp
Top achievements
Rank 1
Answers by
xp
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
xiaofeng
Top achievements
Rank 1
Share this question
or