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

Edit GridView Row

1 Answer 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Julien
Top achievements
Rank 1
Julien asked on 22 Dec 2009, 03:14 PM
Hi,
I have a little problem. When I add columns into the GridView, I can't seem to be able to edit the rows after. The ReadOnly is at false and the AllowEditRow is at true. I don't understand  why I can't edit the GridView rows.

 Thank's

GridViewDataColumn col1 = new GridViewDataColumn("ID","ID");
GridViewDataColumn col2 = new GridViewDataColumn("name","name");
col1.DataType = typeof(int);
col2.DataType = typeof(string);
radGridView1.Columns.Add(col1);
radGridView1.Columns.Add(col2);

object[] row = new object [] {1, "John"}  

radGridView1.Rows.Add(row);

radGridView1.ReadOnly = false;
radGridView1.MasterGridViewTemplate.AllowEditRow = true;

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 23 Dec 2009, 09:39 AM
Hi Julien,

You are using columns of type GridViewDataColumn. This is a base column type and it doesn't have an editor associated with it. You have to change the column type for col1 to GridViewDecimalColumn and col2 to GridViewTextBoxColumn. Should you have any further questions, don't hesitate to ask.

Regards,
Jack
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
Julien
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or