Hello,
Does anyone know if there is a way to allow the cell being edited in the Grid to be able to display a combo for the user to select an option OR allow the user to type text into the editing cell that isn't in the combo's list? It seems as if the combo is read only or only allows selection of what's in the list.
Thanks
Hi,
XamGrid does not supports ComboBox columns out of the box at the moment, this feature will be included in our next volume release. However you could implement this as CustomColumn - to learn how to do so take a look at Devin Rader's blog post. This approach uses the ComboBox control from MS sdk which does not support editing.
Another approach is described in this forum thread where XamComboEditor is put inside an EditorTemplate of a Template column. Using this approach you should set CustomValueEnteredAction="Add" if you want the typed text to be added to the XamComboEditor's ItemSource.
HTH
Konstantin,
I implemented Devin Raders ComboBox column back in January, now the project I'm working on needs to have a grid that has an integer as the cell's value (the employee's ID) - and display the employee's name, and have the combo box allow the user to select an employee from the list.
Is this something that's possible? In the ResolveDisplayElement, could something do a lookup of items bound to the combo's Itemsource and retrieve the employee name if it knows the employee ID? (Kind of like a basic lookup in a combo box where if you have a SelectedValuePath = xxx and then the DisplayMemberPath = yyy)
Thanks.
Hi Konstantin ,
In the meantime I found a solution, but I also will try the new 11.1 release.
Regards ,
Hi mileca,
sorry for the late response,
It seams that the my sample code does not work well when the virtualization of the grid is used. If you haven't resolve the issue so far I could suggest you to try the new 11.1 voluem release. We are now shipping a ComboBox column out of the box for xamGrid. If this is not a solution for you I could spent some time to make a wokrind sample.
Regards,
Hi Konstantin,I have use your sample and work ok with small amount of data. When I bind grid to large data source from databases in combo is not corect value. Maybe I'm doing something wrong. Did You notice this? When I add 30 more item to DemoData in your code, in combo is not corect value.
Thanks so much Konstantin, this is exactly what I've been trying to do. I don't know why mine wasn't working, I must have done something wrong.
Many thanks for working on it over the weekend too - I really really apprecaite it.
Hi rhavlick,
I have attached sample solution that might be of help.
It basically add SelectedValuePath property to the ComboBoxColumn which is set to the ComboBox editor in ResolveEditorControl.
In ResolveDisplayElement I used the ComboBox as a proxy and if there is DIsplayMemberPath set to the column textBox's Text property is bound to comboBox.SelectedValue and the path of the binding is DispalyMemberPath.
Regards