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.

GDBG: After a layout change, column value and header won''t display

Thread ID:





18502 Sep 1,2004 09:37 AM Sep 8,2004 06:55 AM Windows Forms 6
Tags: GridControl
Kenton Hensley
Asked On September 1, 2004 09:37 AM

In a DataboundGrid, I''m using Binder.LayoutColumns to show and hide the Note field based on a user option. Something like: If mnuShowNote.checked = True Then ''Show Note dbg.Binder.LayoutColumnes ( New String() _ {"ColA", "ColB", "etc.", ".", _ "Note") Else ''Hide Note dbg.Binder.LayoutColumnes ( New String() _ {"ColA", "ColB", "etc.",) End If The first time the grid is populated and displayed it is shown with the note. However, after displaying it without the Note once then changing the layout back to display the note, the spaces in the layout are there but the value for the Note and the Note''s Header text are blank. What hasn''t worked: 1) Refresh(), 2) ResetCurrentCellInfo(), 3) Setting the DataSource to Nothing, changing the layout and then setting the datasource. What am I missing? Thank you to the Syncfusion Team Kenton

Administrator [Syncfusion]
Replied On September 1, 2004 10:52 AM

Try calling grid.Binder.InitializeColumns after changing the columns to see if that will set things up properly.

Kenton Hensley
Replied On September 1, 2004 11:23 AM

Tried this as you suggested but it had no effect.

Administrator [Syncfusion]
Replied On September 1, 2004 01:23 PM

To get this to work, you have to reset the GridBoundColumns. Here is a sample showing how you might do this. GDBGSample_7594.zip

Kenton Hensley
Replied On September 7, 2004 12:44 PM

Thank you! Worked as you have shown in your sample. Much appreciated. I have one question: I experimented with cloning the internal columns collection [Dim gbc as GridBoundColumnsCollection = grdGBDG.Binder.InternalColumns.Clone()] and assigning it to a local, procedure-level variable right before assigning the layout string, instead of using a file-level variable, and it exhibited the same undesireable behavior posed in this thread. Why does the InternalColumns collection need to be saved during form Load? Thank you again, Clay. Kenton

Administrator [Syncfusion]
Replied On September 7, 2004 12:51 PM

Calling LayoutColumns actually steps on the internal columns collections, so you need to get the clone before doing the LayoutColumns call.

Kenton Hensley
Replied On September 8, 2004 06:55 AM

Thank you.


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.