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
close icon

GridListControl - how to control columns that are displayed

I noticed that the Grid property in the ListControlPart for a GridListControl is of type GridControl rather than GridDataBoundGrid (the one I''m used to). I need to specify the columns in the DataSource to display in the dropdown grid (I don''t want them all and I need them in a different order). I''m used to using LayoutColumns to accomplish this - how is this done? Also, I need the control to be bound to the ValueMember but auto-complete on the "DisplayMember" - I don''t see how to do this in the samples. Thanks!

4 Replies

LS Lori S. Pearsall June 23, 2004 12:19 AM UTC

>Also, I need the control to be bound to the ValueMember but auto-complete on the "DisplayMember" - I don''t see how to do this in the samples. > To be more specific on this part of the question. I need to bind on the ValueMember, auto-complete on the DisplayMember and NOT have the Value Member column display in the dropdown. Is this control just not the one I need? I basically need the functionality of the ComboBox cell, but with multiple columns displayed in the dropdown.


AD Administrator Syncfusion Team June 23, 2004 08:16 AM UTC

If you only want to show one column in the dropdown, then I think ComboBox celltype work for you. You can set the style.DataSource, style.DisplayMember, style.ValueMember, and style.DropDownStyle to get the behavior you mentioned (if I understood what you want). The only time you need a GridListControl celltype is if you want to see muliple columns in the dropdown. But, it does not matter that the Grid in GridListControl is a GridControl. The GridListControl has the properties DataSource, DisplayMember and ValueMember that you set. You do not work directly with the Grid property unless you need to try to set some propertty not exposed in the GridListControl itself. The grid\samples\celltypes\comboboxes has examples of most of the ways you can use GridListControl and ComboBox celltypes. There is no way to make GridListControl.Grid be a GridDataBoundGrid without you rewriting the control. If you need to drop multiple columns in a particular order, the simplest way to do it would be to have your sql query create the datatable holding exactly what you need, in the order you need it. If you do not want to do that, then the next simplest thing would be to create a new DataTable from code at runtime holding exactly what you want to see in the dropdown. If you do not want to do this, then you would have to subscribe to the gridlistcontrol.QueryCellInfo event, and there dynamically provide the data in a virtual maanner. Based on e.ColIndex and e.RowIndex, you would set e.Style.Text to display the data in the order you want to see it.


TV Tys von Gaza January 4, 2005 07:16 PM UTC

It is really unfortunate fine tuning which columns are displayed in the GridListControl isn''t easier to do. One would think it would be an essential feature as it would come in handy over and over again. I''m working on converting an Access system to .net/msql and I bought Syncfusion as I thought this was supported multicolumn combo boxes, but as I played around with it more I realized that it it is very limited in this regard. Are there any plans to integrate this into the gui?


AD Administrator Syncfusion Team January 4, 2005 09:32 PM UTC

Here is a sample with a helper class that lets you specify the column order and content columns by passing in a comma delimited string holding the column names. http://64.78.52.104/support/user/uploads/GLC_ColumnReorder.zip

Loader.
Live Chat Icon For mobile
Up arrow icon