//Get the data for the master
EducationModuleService serviceModule = new EducationModuleService();
TList<EducationModule> modules = serviceModule.GetAll();
grdvModules.DataSource = modules;
//Get the data for the Detail
EducationModuleSessionService serviceModuleSession = new EducationModuleSessionService();
TList<EducationModuleSession> moduleSession = serviceModuleSession.GetAll();
// bindingSourceModuleSession.DataSource = moduleSession;
//Create the Detail template
Telerik.WinControls.UI.
GridViewTemplate templateModuleSessions = new Telerik.WinControls.UI.GridViewTemplate();
templateModuleSessions.AllowAddNewRow =
false;
templateModuleSessions.DataSource = moduleSession;
templateModuleSessions.SummaryDisplayStyle = Telerik.WinControls.UI.
SummaryDisplayStyle.None;
//Add the detail template to the master template
this.grdvModules.MasterGridViewTemplate.ChildGridViewTemplates.AddRange(new Telerik.WinControls.UI.GridViewTemplate[] {
templateModuleSessions});
//Create the relation and add it the the RadGridView
GridViewRelation relation = new GridViewRelation(this.grdvModules.MasterGridViewTemplate);
relation.ParentColumnNames.Add(
"EducationModuleId");
relation.ChildColumnNames.Add(
"EducationModuleId");
relation.ChildTemplate = templateModuleSessions;
relation.RelationName =
"ModulesSessions";
this.grdvModules.Relations.Add(relation);
private void gridAttributes_RowFormatting(object sender, RowFormattingEventArgs e) |
{ |
AttributeBase obj = e.RowElement.RowInfo.DataBoundItem as AttributeBase; |
GridCellElement cell = null; |
if (obj.DataType == "varchar") |
cell = e.RowElement.RowInfo.Cells[2].CellElement; |
else if (obj.DataType == "bit") |
cell = e.RowElement.RowInfo.Cells[1].CellElement; |
cell.Enabled = false; |
cell.DrawFill = true; |
cell.GradientStyle = Telerik.WinControls.GradientStyles.Solid; |
cell.BackColor = SystemColors.ControlLightLight; |
} |
I'm trying to use the "IsChecked" property for DataBinding, but it doesn't change the underlaying DataSource - not like a standard CheckBox's "CheckedState" property. I know, "ToggleState" holds the real state, but I need a boolean property for DataBinding...
Thx for any help in advance...