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

Edit specific cell

3 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Minkyu Lee
Top achievements
Rank 1
Minkyu Lee asked on 08 Jun 2010, 07:18 AM
Hi
I have three columns and three rows below.

 

Column1

Column2

Column3

Row1

IsEditable = true

IsEditable = false

IsEditable = false

Row2

IsEditable = true

IsEditable = false

IsEditable = false

Row3

IsEditable = true

IsEditable = false

IsEditable = false


I just want that three cells are editable. How can I do that?

Thanks in advance.
Minkyu Lee.

3 Answers, 1 is accepted

Sort by
0
Diederik
Top achievements
Rank 1
answered on 09 Jun 2010, 09:51 AM
If you mean that columns 2 and 3 should not be editable, then you can achieve this by opening the property builder for the grid and then checking the readonly option for both columns.

Hope this helps
0
Johan Wibling
Top achievements
Rank 1
answered on 09 Jun 2010, 10:26 AM
And how to only make row 2 column 1 editable?

/Johan
0
Jack
Telerik team
answered on 14 Jun 2010, 01:38 PM
Hi Minkyu Lee,

You can set ReadOnly property of the specified column to true. This will make all cells for this column read only. You can read more about grid's columns in this documentation article. You can use the following code snippet as sample:
this.radGridView.Columns["YourColumn"].ReadOnly = true;

Johan, you can achieve this by handling the CellBeginEdit event. Consider the following snippet:
void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    if (e.ColumnIndex == 1 && e.RowIndex == 2)
    {
        e.Cancel = true;
    }
}

I hope this helps.

Regards,
Jack
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
Minkyu Lee
Top achievements
Rank 1
Answers by
Diederik
Top achievements
Rank 1
Johan Wibling
Top achievements
Rank 1
Jack
Telerik team
Share this question
or