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

Editable ComboBox in GridViewCell

5 Answers 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David Collins
Top achievements
Rank 1
David Collins asked on 29 Sep 2009, 02:47 AM
I am using styles to override the control template of a GridViewCell.  In certain cases, I display a radcombobox.  In one case, I set the ItemSource of the combobox to a List<String>, but want to allow the user to type in values.  I set combobox IsEditable to True, which changes the display style of the combo.  It sort of works by binding to the combobox.Text property, but the behavior is a little off.  If I type a character in the editable combobox, I have to click several times to get the focus back into the combo so I can type another character.  Is there any way to keep the focus in the combobox or is there a better way?

Thanks in advance,
David Collins

5 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 30 Sep 2009, 06:36 AM
Hello David Collins,

We have one column type called GridViewcomboBox column that is fully integrated with our editing mechanism. It is really easy to use and most probably it will resolve the issues that you are having.

I am sending you a sample application that demonstrates how our column types (including the GridViewComboBoxColumn) can be used. Hope this helps.


Greetings,
Milan
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.
0
sandy pochiraju
Top achievements
Rank 1
answered on 01 Oct 2009, 06:13 AM
hi,
i am trying to hv a combo box inside the gridview. i wud like to do this from code behind rather than from xaml. 

this is what i wrote:
            var cb = (GridViewComboBoxColumn)wipGridView.Columns["Packagetype"];
            cb.ItemsSource = this.GetPackageTypeList();

however, i am geting object reference not set to an instance of an object. Please can you let me know if I am missing anything here. 

thanks,
sandy

0
Vlad
Telerik team
answered on 01 Oct 2009, 06:20 AM
Hi sandy,

Can you verify using the debugger if cb variable is not null?

Kind regards,
Vlad
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.
0
sandy pochiraju
Top achievements
Rank 1
answered on 01 Oct 2009, 01:51 PM
hi Vlad,

exactly!! cb is null. but please let me know why its null and what am i missing here. :-(
thanks so much. 
sandy
0
David Collins
Top achievements
Rank 1
answered on 01 Oct 2009, 02:06 PM
Milan,

Thanks for your reply.  I not sure if the GridViewcomboBoxColumn is a valid option for my scenario.  I am trying to use the RadGridView similar to a PropertyGrid, to edit a bunch of name name/value pairs.  Some values are text (editing control = textbox) while others need to restricted to a list of values.  The lists vary depending on the datacontext of the row, so not every combobox has the same list of values.  In this one case with the editable combo, I wanted to allow the user to type in their own value but also be allowed to pick from some predefined choices.

Thanks,
David
Tags
GridView
Asked by
David Collins
Top achievements
Rank 1
Answers by
Milan
Telerik team
sandy pochiraju
Top achievements
Rank 1
Vlad
Telerik team
David Collins
Top achievements
Rank 1
Share this question
or