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

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

Thread ID:





18502 Sep 1,2004 01:37 PM UTC Sep 8,2004 10:55 AM UTC WinForms 6
Tags: GridControl
Kenton Hensley
Asked On September 1, 2004 01:37 PM UTC

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 02:52 PM UTC

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 03:23 PM UTC

Tried this as you suggested but it had no effect.

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

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 04:44 PM UTC

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 04:51 PM UTC

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 10:55 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon