hi,
I want set in a GridDataBoundGrid (with a multi-row layout) a column
as DropDownGrisListControl in code. I have tried this code but I have not
button that appear on it.
GridBoundColumnsCollection b = this.grdBen.Binder.GridBoundColumns ;
GridBoundColumn cmb = b["GrpID"];
cmb.StyleInfo.CellType = "DropDownGridListControl";
GrpBySocList grpList = GrpBySocList.GetCollection(coll.Soc.SocID);
cmb.StyleInfo.DropDownStyle = GridDropDownStyle.Exclusive;
cmb.StyleInfo.DataSource = grpList;
cmb.StyleInfo.DisplayMember = "Libelle";
cmb.StyleInfo.ValueMember = "GrpId";
Thanks,
Eddy POULLET
Brussels
AD
Administrator
Syncfusion Team
October 21, 2004 11:41 AM UTC
These may be typos but:
>>GridBoundColumnsCollection b = this.grdBen.Binder.GridBoundColumns ;
>>cmb.StyleInfo.CellType = "DropDownGridListControl";
try
GridBoundColumnsCollection b = this.grdBen.GridBoundColumns ; //unless you have not added GBC, in which case use grid.Binder.InternalColumns
cmb.StyleInfo.CellType = "GridListControl";
EP
Eddy Poullet
October 21, 2004 12:07 PM UTC
Thanks a lot. It works.
How can I access the gridlistcontrol ?
Can I add my self the column to the gridlistcontrol to have more controls to the order, header ,width, etc...
Eddy
AD
Administrator
Syncfusion Team
October 21, 2004 01:10 PM UTC
It is not easy to customize this embedded GridListControl.
You can access it with code like this.
GridDropDownGridListControlCellRenderer cr =
(GridDropDownGridListControlCellRenderer) this.gridControl1.CellRenderers["GridListControl"];
// cr.ListControlPart is the GridListControl
Once you have the GridListControl, you can access the embedded GridControl, the Grid property of the GridListControl. But this Grid is virtually bound to the DataSource, so this means just setting style properties on individual cells will not work.
EP
Eddy Poullet
October 21, 2004 01:44 PM UTC
Thanks Clay,
But it''s a little pity that it''s not possible to have control on this "grid". I believe that this celltype is not very useful.
Maybe exists it an another "easy :)" mean to have the same result?
Eddy
AD
Administrator
Syncfusion Team
October 21, 2004 02:47 PM UTC
You can drop down a grid as in Grid\Samples\In Depth and make it look like a ListBox by hiding row headers and setting ListBoxSelectionMode.