Looks like the formatting lost some of my code example. It is meant to read:
Thank you.
<Window.Resources>
<local:ViewModel x:Key="ordercollection"/>
</Window.Resources>
<syncfusion:GridComboBoxColumn HeaderText="Country"
ItemsSource="{Binding ComboItems,Source={StaticResource ordercollection}}"
MappingName="Country"/> |
Any luck with this, or is it not possible to do this with the DataGrid?
Thanks
Nevermind, I addressed this issue by using a GridTemplateColumn which actually binds to the properties on the model itself.
If anyone is in a similar situation and wanted to see my solution, feel free to drop me a message
<local:GridComboBoxColumnExt MappingName="OrderValue">
<local:GridComboBoxColumnExt.ItemsSourceSelectorSelector>
<local:ItemsSourceSelectorSelector/>
</local:GridComboBoxColumnExt.ItemsSourceSelectorSelector>
</local:GridComboBoxColumnExt>
public class ItemsSourceSelectorSelector : IItemsSourceSelector
{
public IEnumerable GetItemsSource(object record, object dataContext)
{
if (record == null)
return null;
var model = record as Model;
return model.OrderValues;
}
} |
Dear Sivakumar,
Thanks for the great support! I'll play with your solution as I'm sure it's more performant.
Hello.
It is extremely "un-intuitive" that You can't simply bind row element to underlying row data. Especcially it is working fine with MasterDetail part of SfDatagrid. Ok You're using RelationalColumn parameter, but that's logical. Why not in ComboboxColumn? I know it can be usefull, but shouldn't be a dead end.
Marcin