this.gridGroupingControl1.TableModel.CellModels.Add("MyCell", new MyCellModel(this.gridGroupingControl1.TableModel));
GridTableDescriptor td = this.gridGroupingControl1.TableDescriptor;
GridRelationDescriptor rd = td.Relations["ParentToChild"];
rd.ChildTableDescriptor.Columns["Name"].Appearance.AnyRecordFieldCell.CellType = "MyCell";
>this.gridGroupingControl1.TableModel.CellModels.Add("MyCell", new MyCellModel(this.gridGroupingControl1.TableModel));
>
>GridTableDescriptor td = this.gridGroupingControl1.TableDescriptor;
>GridRelationDescriptor rd = td.Relations["ParentToChild"];
>rd.ChildTableDescriptor.Columns["Name"].Appearance.AnyRecordFieldCell.CellType = "MyCell";
>
Thanx Clay
I have implemented the cell model as you suggested, however I stil get the same phenomenon. (The GridControlBase is passed to the cell renderer a second time with null values.)
The code I use to describe the parent-child relattion is as follows:
parameterRel = new GridRelationDescriptor "ParameterRel");
parameterRel.MappingName = "ID";
parameterRel.ChildTableName = "MetaParameter";
parameterRel.RelationKind = RelationKind.RelatedMasterDetails;
parameterRel.RelationKeys.Add("ID","Operation ID");
I then add the columns of the related grid manually, as follows:
parameterRel.ChildTableDescriptor.Columns.Clear();
parameterRel.ChildTableDescriptor.Columns.Add("Parameter Name");
parameterRel.ChildTableDescriptor.Columns.Add("Source Type ID");
parameterRel.ChildTableDescriptor.Columns.Add("Paramter Chain ID");
parameterRel.ChildTableDescriptor.Columns.Add("Parameter Source ID");
parameterRel.ChildTableDescriptor.Columns.Add("Parameter ID");
parameterRel.ChildTableDescriptor.Columns.Add("Parameter Value");
parameterRel.ChildTableDescriptor.Columns.Add("Parameter Type");
Would this have any effect on the cell model? I set the CellType of the related grid after the columns have been added and the datasource has been set. Is there any other reason why this should not work?
Thank you for your help!!
Albie