This question is locked. New answers and comments are not allowed.
Hello Everyone,
let's start with my code:
The grid
The code behind:
The data class
As you may see, i try to bind the data from the '
I can't find my mistake ... anyone any ideas or hints?
Best Regards and a pleasant Doomsday ;)
Michael
let's start with my code:
The grid
<telerik:RadGridView HorizontalAlignment="Left" Margin="0,139,0,0" Name="radGridViewRights" VerticalAlignment="Top" Width="1069" Height="349" IsFilteringAllowed="False" AutoGenerateColumns="False" CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="False" ShowGroupPanel="False" ShowColumnHeaders="True"/>The code behind:
GridViewDataColumn col1 = new GridViewDataColumn();col1.UniqueName = "groups";col1.Header = "";col1.DataMemberBinding = new System.Windows.Data.Binding("moduleDesc");col1.Width = 180; this.radGridViewRights.Columns.Add(col1);foreach (KeyValuePair<int, string> kvp in GDC.groupDescIds){ GridViewCheckBoxColumn col = new GridViewCheckBoxColumn(); col.UniqueName = kvp.Value; col.Header = kvp.Value; col.DataMemberBinding = new System.Windows.Data.Binding("group_" + kvp.Key); col.Width = 80; this.radGridViewRights.Columns.Add(col);}ObservableCollection<ModuleGroupRightsDataSource> data = new ObservableCollection<ModuleGroupRightsDataSource>();ModuleGroupRightsDataSource obj = new ModuleGroupRightsDataSource();obj.moduleDesc = GDC.moduleDesc_Articles;obj.group_1 = true;obj.group_3 = true;obj.group_8 = true;data.Add(obj);obj = new ModuleGroupRightsDataSource();obj.moduleDesc = GDC.moduleDesc_Partsgroups;obj.group_3 = true;obj.group_8 = true;data.Add(obj);this.radGridViewRights.ItemsSource = data;The data class
public class ModuleGroupRightsDataSource{ public string moduleDesc = ""; public Boolean group_1 = false; public Boolean group_2 = false; public Boolean group_3 = false; public Boolean group_4 = false; public Boolean group_5 = false; public Boolean group_6 = false; public Boolean group_7 = false; public Boolean group_8 = false; public Boolean group_9 = false; public Boolean group_10 = false;}As you may see, i try to bind the data from the '
ModuleGroupRightsDataSource' objects to the columns of the grid. But it's not binding. The rows for the entrys in the itemssource are created (so the grid finds out that there are two rows to show), but the cells are empty and show no values.I can't find my mistake ... anyone any ideas or hints?
Best Regards and a pleasant Doomsday ;)
Michael
