We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DropDownGridListControl in a grid column

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

5 Replies

AD Administrator Syncfusion Team October 21, 2004 07:41 AM

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 08:07 AM

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 09:10 AM

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 09:44 AM

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 10:47 AM

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.

Loader.
Live Chat Icon For mobile
Up arrow icon