I am not able get a GridViewComboBox column to work. I have two RadDomainDataSources on my page; one for the grid and another for the combo box source. I cannot get the combo box to populate. It is also not showing the field in the grid that I am trying to populate with the combo box.
The field in the grid that I am trying to populate is "PLCategoryID".
The Display field for the combo box is "CategoryDescription".
I set up the RadDomainDataSource for the combo box as a static resource, as described in one of your articles. (I also added a "test" grid that uses the same RadDomainDataSource as the combo box to be sure that the data was being retrieved properly, and this is working correctly.)
Here is the code for the page:
Any help wwould be greatly appreciated.
Thanks,
Mark
The field in the grid that I am trying to populate is "PLCategoryID".
The Display field for the combo box is "CategoryDescription".
I set up the RadDomainDataSource for the combo box as a static resource, as described in one of your articles. (I also added a "test" grid that uses the same RadDomainDataSource as the combo box to be sure that the data was being retrieved properly, and this is working correctly.)
Here is the code for the page:
<
navigation:Page
x:Class
=
"PE2.Views.SetupPages.AccountMapping.PLMapAccountsToCategories"
xmlns:server
=
"clr-namespace:PE2.Web.Services"
xmlns:telerikDragDrop
=
"clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"
mc:Ignorable
=
"d"
xmlns:navigation
=
"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth
=
"779"
d:DesignHeight
=
"480"
Title
=
"PLMapAccountsToCategories Page"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:sdk
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
>
<
UserControl.Resources
>
<
telerik:RadDomainDataSource
x:Key
=
"radDomainDataSourcePLCategory"
Width
=
"0"
QueryName
=
"GetPLCategories"
AutoLoad
=
"True"
>
<
telerik:RadDomainDataSource.DomainContext
>
<
server:PEDataDomainContext
/>
</
telerik:RadDomainDataSource.DomainContext
>
</
telerik:RadDomainDataSource
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"LightGreen"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"404*"
/>
<
RowDefinition
Height
=
"76*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
Height
=
"255"
HorizontalAlignment
=
"Left"
Margin
=
"12,12,0,0"
Name
=
"stackPanel1"
VerticalAlignment
=
"Top"
Width
=
"755"
>
<
telerik:RadDomainDataSource
Height
=
"0"
Name
=
"radDomainDataSourceChartOfAccounts"
Width
=
"0"
QueryName
=
"GetChartOfAccounts"
AutoLoad
=
"True"
>
<
telerik:RadDomainDataSource.DomainContext
>
<
server:PEDataDomainContext
/>
</
telerik:RadDomainDataSource.DomainContext
>
</
telerik:RadDomainDataSource
>
</
StackPanel
>
<
Button
Content
=
"Load Accounts"
Height
=
"23"
HorizontalAlignment
=
"Left"
Margin
=
"34,23,0,0"
Name
=
"buttonLoadAccounts"
VerticalAlignment
=
"Top"
Width
=
"101"
Grid.Row
=
"1"
/>
<
telerik:RadGridView
Name
=
"radGridViewChartOfAccounts"
Margin
=
"12,23,12,0"
CanUserSelect
=
"False"
ItemsSource
=
"{Binding ElementName=radDomainDataSourceChartOfAccounts, Path=DataView}"
AutoGenerateColumns
=
"False"
Height
=
"180"
VerticalAlignment
=
"Top"
DataLoaded
=
"radGridViewChartOfAccounts_DataLoaded"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Account No."
DataMemberBinding
=
"{Binding AccountNo}"
/>
<
telerik:GridViewDataColumn
Header
=
"Account Name"
DataMemberBinding
=
"{Binding AccountName}"
/>
<
telerik:GridViewDataColumn
Header
=
"Account Description"
DataMemberBinding
=
"{Binding AccountDesc}"
/>
<
telerik:GridViewDataColumn
Header
=
"Account Type"
DataMemberBinding
=
"{Binding AccountType}"
/>
<
telerik:GridViewComboBoxColumn
Header
=
"PL Category"
DataMemberBinding
=
"{Binding PLCategoryID, Mode=TwoWay}"
DisplayMemberPath
=
"CategoryDescription"
SelectedValueMemberPath
=
"PLCategoryID"
IsAutoGenerated
=
"False"
ItemsSourceBinding
=
"{Binding Source={StaticResource radDomainDataSourcePLCategory}}"
/>
<
telerik:GridViewDataColumn
Header
=
"P&L"
DataMemberBinding
=
"{Binding PLCategoryID, Mode=TwoWay}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
telerik:RadGridView
Name
=
"test"
ItemsSource
=
"{Binding Path=DataView}"
Margin
=
"12,209,12,30"
Grid.RowSpan
=
"2"
DataContext
=
"{Binding Source={StaticResource radDomainDataSourcePLCategory}}"
>
</
telerik:RadGridView
>
</
Grid
>
</
navigation:Page
>
Any help wwould be greatly appreciated.
Thanks,
Mark