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.

GridGroupingControl scrollbar sizing bug?

Thread ID:

Created:

Updated:

Platform:

Replies:

18732 Sep 8,2004 06:56 AM Sep 14,2004 10:05 AM Windows Forms 8
loading
Tags: GridControl
Mike Woolley
Asked On September 8, 2004 06:56 AM

I have a GridGroupingControl into which I''m binding a custom datasource (actually just a DataTable). This DataTable has a column defined called "pk". When I display the grid, I remove this column using groupGrid.TableDescriptor.VisibleColumns.Remove("pk"); However, when I then drag a header cell to make it larger, the horizontal scrollbar does not update correctly. Columns to the right of the one I''ve sized disappear from the right-hand edge of the control, but the scrollbar doesn''t update to allow you to scroll them into view. If I comment out the above ''remove'' statement, the control behaves correctly. Is this a bug, or am I doing something wrong? Thanks!

Administrator [Syncfusion]
Replied On September 8, 2004 08:19 AM

I may be missing the exact sequence of steps you are doing, but I tried to see this behavior in the little sample below, and could not using version 2.1.0.9. Can you see the problem in this sample? GCCremoveviscol_3658.zip

Mike Woolley
Replied On September 13, 2004 04:44 AM

Thanks once again for your extremely quick response. The example you have provided does indeed work correctly. I haven''t had a chance to alter this example to try and reproduce the problem (our grid is embedded in a UserControl that is docked ''fill'' into a form that is then displayed using your TabbedMDI stuff, so I wonder if there is some way that the correct size information is not being communicated to the grid. I''ll get back to you if I can reproduce the problem. I have one further question - I''d like to use a GroupingGrid to be able to display a grid with two columns. The first cell in a row is a static label field from a database and the second is a cell whose type depends on information from the database. In other words, what I am trying to do is emulate the Windows Forms PropertyGrid control using your grid controls. I thought that the Grouping Grid was probably the way to go as it provides the ''sectioned'' functionality (expand/collapse, etc.) we''re after. However, I''m not sure how to change the type of the cell, or even if this is possible. Any ideas?

Administrator [Syncfusion]
Replied On September 13, 2004 06:13 AM

As far as your original problem, you might put a Panel where you now have the grid, and then drop the grid into the Panel with grid.Dock = DockStyle.Fill. This may avoid the problem you are seeing. You can dynamically set properties on cells using TableControlPrepareViewStyleInfo or QueryCellStyleInfo. Here is forum thread that discusses setting style.BackColor, but you can also try conditionally setting style.CellType there. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=17832

Mike Woolley
Replied On September 14, 2004 09:17 AM

Putting the control in a panel didn''t appear to make any difference. As an alternative, is it possible to bind a custom collection to a grid (e.g. an IList, etc.) and specify the columns that are displayed explicitly (i.e. add columns in rather than remove them). This may be a better approach (if possible) as I want to display columns containg buttons, icons, etc. based on data that is calculated (but not stored in) the collection. Once again, many thanks.

Administrator [Syncfusion]
Replied On September 14, 2004 09:32 AM

After setting the DataSource, try manually populating the Columns collection. this.gridGroupingControl1.DataSource = dt; this.gridGroupingControl1.TableDescriptor.Columns.Add("Col1"); this.gridGroupingControl1.TableDescriptor.Columns.Add("bool");

Mike Woolley
Replied On September 14, 2004 09:45 AM

Thanks, A bit confused though. If I set the DataSource, won''t the grid just create a set of columns for me anyhow?

Administrator [Syncfusion]
Replied On September 14, 2004 09:55 AM

Not if you then start modifying the Columns collection. The groupinggrid postpones its initialization until things are actually needed. So, when you set DataSource, nothing is added to the Columns collection until you try to use the collection in some manner. If at that point, they are empty, they get initialized to the default whole datasource. If before they are used, you explicitly set the Columns collection, then they will not be initialized to the whole datasource (since when you go to use them, they will not be empty.) It worked for me using a DataTable. I think it should work for you using an arbitrary IList.

Mike Woolley
Replied On September 14, 2004 10:05 AM

Ah! Great. That''s going to be a much better solution for me than removing columns that I don''t need. Thanks once again!

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.

;