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

how to make one cell in child template editable

1 Answer 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ljubo Žižić
Top achievements
Rank 1
Ljubo Žižić asked on 06 Jul 2009, 12:28 PM
Hi
I need following functionality:
When user press a button I iterate all childrows checking the values in cells and if those values are not ok i pop out a Message.box warning the user. Then I want to enable him to change the incorrect cell value, therefore I need to make that cell editable. I use following code:

Me.RadGridView.Rows(i).ViewTemplate.AllowEditRow = True
Me.RadGridView.Rows(i).ViewTemplate.Rows(0).Cells(0).BeginEdit()
Me.RadGridView.PerformLayout()
Me.RadGridView.BeginEdit()

The cell stays readonly.
Thank you in advance!

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 07 Jul 2009, 08:21 AM
Hello Ljubo Žižić,

Calling BeginEdit method of the desired cell should work if RadGridView is not in ReadOnly mode. Please check whether the ReadOnly property of RadGridView is set to false. Maybe a better option is to cancel the editing when handling CellBeginEdit event. Here is a sample:

void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
    if ((bool)this.radGridView1.CurrentRow.Cells["Checkbox"].Value == false
    { 
        e.Cancel = true
    } 

If you continue to experience the issue, please send us your application and we will try to locate the problem.

I am looking forward to your reply.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Ljubo Žižić
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or