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

combo in RadGridView

6 Answers 10 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mohammad
Top achievements
Rank 1
Mohammad asked on 13 Oct 2014, 07:42 PM
I have an application and i used Telerik rad controls in this app , in RadGrid i want to add a column that have a combo and another column that have a button , user select an action in combo (such as edit/delete/update record status ) and push the button and then system do the action , but i cant add a combo with this situation in RadGrid
please help
thanks

6 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Oct 2014, 12:55 PM
Hi Mohammad,

Thank you for writing.

You can add GridViewComboBoxColumn and bind it to a list that contains the desired items:
GridViewComboBoxColumn myColumn = new GridViewComboBoxColumn();
myColumn.Name = "Action Column";        
myColumn.DataSource = new List<string>{ "Add","Delete","Edit"};
myColumn.Width = 200;
this.radGridView1.Columns.Add(myColumn);

Let me know if you have additional questions.
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mohammad
Top achievements
Rank 1
answered on 14 Oct 2014, 06:51 PM
thanks Dimitar for your attention
but i fill my gridView with DataTable and a sql command
i was write a code like you suggest but it's not work
the column it's not a combo it's empty

thanks again
Regards
0
Mohammad
Top achievements
Rank 1
answered on 16 Oct 2014, 01:09 PM
can anyone help me ?
0
Dimitar
Telerik team
answered on 17 Oct 2014, 12:27 PM
Hello Mohammad,

Thank you for writing back.

In this case you should put the cell in edit mode first, then you will see the editor and you will be able to pick a value. In addition I have created a small sample to show you how the desired grid can be achieved. Please note that you can have bound and unbound columns in the grid. 

I hope this helps.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mohammad
Top achievements
Rank 1
answered on 24 Oct 2014, 11:55 AM
thanks again for your answer and example
how can i put on cell in edit mode ??
i dont want to let the user edit records in gridview
0
Dimitar
Telerik team
answered on 27 Oct 2014, 04:50 PM
Hi Mohammad,

Thank you for writing back.

You can disable the editing for particular columns by setting the ReadOnly property of each column that you do not want the user to be able to make changes to. For example you can make the first 4 columns in the grid read only like this:
for (int i = 0; i < 4; i++)
{
    radGridView1.Columns[i].ReadOnly = true;
}

In addition you can put the cell in edit mode by just clicking it, this will create the proper editor and will allow you to chose one of the values (see attached image).

I hope this will be useful.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Mohammad
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Mohammad
Top achievements
Rank 1
Share this question
or