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.
Unfortunately, activation email could not send to your email. Please try again.

GridListControl - how to control columns that are displayed

Thread ID:

Created:

Updated:

Platform:

Replies:

15578 Jun 22,2004 08:05 PM Jan 4,2005 04:32 PM Windows Forms 4
loading
Tags: GridControl
Lori S. Pearsall
Asked On June 22, 2004 08:05 PM

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!

Lori S. Pearsall
Replied On June 22, 2004 08:19 PM

>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.

Administrator [Syncfusion]
Replied On June 23, 2004 04:16 AM

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.

Tys von Gaza
Replied On January 4, 2005 02:16 PM

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?

Administrator [Syncfusion]
Replied On January 4, 2005 04:32 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;