3 Answers, 1 is accepted
0
Hi Robbie,
Currently, we have ReadOnly property for the RadGridView control, but not for separate rows or cells. However, you can achieve the desired behavior by canceling the CellBeginEdit event on a specific condition:
If you have additional questions, feel free to contact me.
Sincerely yours,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Currently, we have ReadOnly property for the RadGridView control, but not for separate rows or cells. However, you can achieve the desired behavior by canceling the CellBeginEdit event on a specific condition:
private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) |
{ |
// read-only just for the cell |
if(this.radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() == "Sales Manager") |
{ |
e.Cancel = true; |
} |
// read-only for the whole row which has a specific value in a specific cell |
if (this.radGridView1.Rows[e.RowIndex].Cells[3].Value.ToString() == "Sales Representative") |
{ |
e.Cancel = true; |
} |
// read-only depending on the column and row indexes |
if ((e.ColumnIndex == 3) && (e.RowIndex == 2)) |
{ |
e.Cancel = true; |
} |
if (e.RowIndex == 0) |
{ |
e.Cancel = true; |
} |
} |
If you have additional questions, feel free to contact me.
Sincerely yours,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robbie
Top achievements
Rank 1
answered on 25 Jul 2008, 08:31 PM
Tanx Nikolay !
I think this will work nicely and if you can tell me how to prevent the pencil from appearing when clicking on a cell that has a canceled beginedit event you will really make my day!!
Looking forward to your reply,
Robbie
I think this will work nicely and if you can tell me how to prevent the pencil from appearing when clicking on a cell that has a canceled beginedit event you will really make my day!!
Looking forward to your reply,
Robbie
0
Hi Robbie,
Thank you for raising this question.
I apologize for any inconvenience this problem has caused you. I have reproduced your problem and it has been logged as a bug. The issue will be addressed in one of our next versions. I cannot provide you with a workaround for the time being.
Your Telerik points account was updated for pointing out the issue.
If you have any other questions, please don't hesitate to contact us.
Kind regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for raising this question.
I apologize for any inconvenience this problem has caused you. I have reproduced your problem and it has been logged as a bug. The issue will be addressed in one of our next versions. I cannot provide you with a workaround for the time being.
Your Telerik points account was updated for pointing out the issue.
If you have any other questions, please don't hesitate to contact us.
Kind regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.