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

GridViewComboBoxColumn in RadGridView

4 Answers 146 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gilberth
Top achievements
Rank 1
Gilberth asked on 15 May 2009, 06:27 PM
Hello, I am experimenting with radgridview, I put the grid as a source of a DataTable and I want to change a column type to combobox, I have reviewed the help information in which said that there are 2 ways to assign the columns, one that make grid columns herself and others is that a code developed by the columns in the proof that I'm doing the grid creates columns and I want one of these columns to change the type of editor to a combobox, you can do what desire, ie not create column but change the type of editor's column of a textbox to a combobox, I hope I can help, thanks in advance.

note: I hope made me understand my English is not very good.

4 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 16 May 2009, 12:57 PM
Hi Gilberth,

If I understand your question, you want to replace some automatically generated column with GridViewComboBoxColumn. If this is correct, please follow these steps:

1. Remove the desired column form the Columns collection.
2. Add your custom column and set its UniqueName and FieldName properties.

Please consider the code snippet below:

this.radGridView1.Columns.RemoveAt(4); 
this.radGridView1.Columns.Insert(4, new GridViewComboBoxColumn("_Name_""Name")); 
 

I hope this helps. Should you have any further questions, do not hesitate to ask.

Regards,
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.
0
Gilberth
Top achievements
Rank 1
answered on 17 May 2009, 01:56 AM
Hello and thank you, was very helpful, I have a concern, I am adding a new row to the DataView through code, this row is added at the end of the DataView, there is some way to send the focus to the end of the DataView? this so that this new row is in sight and no one should move the scroll at the end, but only through code, as before, giving hope to understand and thank you for all the help they have given me, thanks

Note: Not if I create a new item to this question, if so thanks Excuse
0
Jack
Telerik team
answered on 18 May 2009, 08:29 AM
Hi Gilberth,

You can scroll to the new row by using EnsureVisible method. Use the IsCurrent property to focus the row. Calling the BeginEdit method will make the current column editable. Please take a look at the following code sample:

table.Rows.Add(101, "Custom row", 12, "33", DateTime.Now, true, 2); 
this.radGridView1.Rows[this.radGridView1.Rows.Count - 1].IsCurrent = true
this.radGridView1.Rows[this.radGridView1.Rows.Count - 1].EnsureVisible();                 
this.radGridView1.BeginEdit(); 
 

If you have any further questions, I will be glad to answer.

Regards,
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.
0
Gilberth
Top achievements
Rank 1
answered on 18 May 2009, 04:51 PM
thanks again, you are very good in the forum
Tags
GridView
Asked by
Gilberth
Top achievements
Rank 1
Answers by
Jack
Telerik team
Gilberth
Top achievements
Rank 1
Share this question
or