I'm having trouble populating my ComboBox Column. In short, it is remaining empty.
I've also tried using a Datacolumn with a datatemplate with a combo box in it, but it is not working either
I'm trying to do everything in XAML, so I've created a domain data source
Which works fine and does load the requested data.
In a separate section of my app (in the details section, of my master-details sort of view) I'm using just a regular combo box in a canvas/stackpanel and it works fine. (The combobox is a child of the tab item, so it is inheriting the datacontext from the tabitem)
However, when I try to do it in a gridviews column, it does not work. (Granted the selected value's binding is different, as the above binds to the selected item in the gridview, but the items list in the combo boxes is null)
I basically tried a data templated datacolumn, when that didn't work I commented it out and tried the... combobox column which also does not work. The grid view is working correctly (except for the combo boxes) and if I have just a normal data column pulling the staffid, it does retrieve the required number.
Am I doing something incorrectly?
I've also tried using a Datacolumn with a datatemplate with a combo box in it, but it is not working either
I'm trying to do everything in XAML, so I've created a domain data source
<riaControls:DomainDataSource x:Name="Staff_Data" QueryName="GetStaffs" AutoLoad="True"> |
<riaControls:DomainDataSource.DomainContext> |
<ds:CashSale_DomainContext/> |
</riaControls:DomainDataSource.DomainContext> |
</riaControls:DomainDataSource> |
Which works fine and does load the requested data.
In a separate section of my app (in the details section, of my master-details sort of view) I'm using just a regular combo box in a canvas/stackpanel and it works fine. (The combobox is a child of the tab item, so it is inheriting the datacontext from the tabitem)
<telerikNavigation:RadTabItem DataContext="{Binding ElementName=gv_cashsale, Path=SelectedItem, Mode=TwoWay}"> |
... |
<telerikInput:RadComboBox x:Name="cb_saleby" HorizontalAlignment="Left" Margin="10" Canvas.Left="96" Height="22" |
Width="207" IsEditable="True" Canvas.Top="20" IsFilteringEnabled="True" IsReadOnly="True" |
OpenDropDownOnFocus="True" ItemsSource="{Binding ElementName=Staff_Data, Path=Data}" |
SelectedValue="{Binding staffid, Mode=TwoWay}" SelectedValuePath="staffid" DisplayMemberPath="name"> |
However, when I try to do it in a gridviews column, it does not work. (Granted the selected value's binding is different, as the above binds to the selected item in the gridview, but the items list in the combo boxes is null)
<telerikGridView:RadGridView Name="gv_cashsale" Height="336" ShowGroupPanel="False" ShowGroupFooters="True" |
AutoGenerateColumns="False" ShowInsertRow="True" IsReadOnly="True" |
ItemsSource="{Binding PagedSource, ElementName=dp_cashsale}"> |
... |
<!--<telerikGridView:GridViewDataColumn Header="Sale By" Width="100" DataMemberBinding="{Binding staffid}"> |
<telerikGridView:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<StackPanel> |
<telerikInput:RadComboBox IsEditable="True" Canvas.Top="20" IsFilteringEnabled="True" |
IsReadOnly="True" OpenDropDownOnFocus="True" |
ItemsSource="{Binding ElementName=Staff_Data, Path=Data}" |
DisplayMemberPath="name" |
SelectedValue="{Binding staffid, Mode=TwoWay}" |
SelectedValuePath="staffid" /> |
</StackPanel> |
</DataTemplate> |
</telerikGridView:GridViewDataColumn.CellTemplate> |
</telerikGridView:GridViewDataColumn>--> |
<telerikGridView:GridViewComboBoxColumn |
ItemsSource="{Binding ElementName=Staff_Data, Path=Data}" |
DataMemberBinding="{Binding staffid}" |
DisplayMemberPath="name" |
SelectedValueMemberPath="staffid" /> |
I basically tried a data templated datacolumn, when that didn't work I commented it out and tried the... combobox column which also does not work. The grid view is working correctly (except for the combo boxes) and if I have just a normal data column pulling the staffid, it does retrieve the required number.
Am I doing something incorrectly?