The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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.
KHKenton HensleySeptember 1, 2004 03:23 PM UTC
Tried this as you suggested but it had no effect.
ADAdministrator Syncfusion Team 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
KHKenton HensleySeptember 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
ADAdministrator Syncfusion Team 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.