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.

Columns Won't Unhide

Thread ID:

Created:

Updated:

Platform:

Replies:

121733 Jan 20,2016 06:22 AM Jan 25,2016 06:50 AM Windows Forms 3
loading
Tags: GridDataBoundGrid(Classic)
Ashley Bates
Asked On January 20, 2016 06:22 AM

Hello,

I have given our users the option of filtering what columns appear within a griddataboundgird - I store this flag in the prefix column name within a dataset - When I first setup the grid all the columns show correctly, if I remove columns they also display correctly. When I however add a column that was previously removed, even though I set the column hidden to false on the grid the column does not display visually. The grid itself gets an empty space at the end of the grid where the column should appear but I can't see anything visually. What am I doing wrong?

Sample code:

        GridDataBoundGrid1.GridBoundColumns.Clear()

        ds.Tables.Add(dt)
        GridDataBoundGrid1.AllowProportionalColumnSizing = True
        GridDataBoundGrid1.DataSource = ds.Tables(0)

        For Each col As DataColumn In ds.Tables(0).Columns
            If col.Prefix.ToLower = "hide" Then
                GridDataBoundGrid1.Model.Cols.Hidden(col.ColumnName) = True
            Else
                GridDataBoundGrid1.Model.Cols.Hidden(col.ColumnName) = False
            End If
        Next
        GridDataBoundGrid1.Refresh()


Thank You


Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 21, 2016 10:42 AM

Hi Ashley,

We tried to reproduce the issue with “Columns not unhide properly” from our end, but we are unable to reproduce it. We tested the reported scenario in the below sample and it is working as expected.

Sample:
http://www.syncfusion.com/downloads/support/forum/121733/ze/TestedSample914758056

Please reproduce the issue in the above sample, so that we can able provide exact solution.

Regards
Jagadeesan

Ashley Bates
Replied On January 22, 2016 04:25 AM

Hello,

I did some more digging into this and have found that if I add in -

        GridDataBoundGrid1.AllowProportionalColumnSizing = True

then when I unhide the column it doesn't work - If I add this line into the sample you have provided as follows -

Private Sub change()
            For Each column As DataColumn In dataSet.Tables(0).Columns
                If column.Prefix.ToLower() = "hide" Then
                    Me.gridDataBoundGrid1.Model.Cols.Hidden(column.ColumnName) = True
                Else
                    Me.gridDataBoundGrid1.Model.Cols.Hidden(column.ColumnName) = False
                End If
            Next column
            gridDataBoundGrid1.AllowProportionalColumnSizing = True

            Me.gridDataBoundGrid1.Refresh()
        End Sub

Then when you unhide the column it will not appear.

Thank You.

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 25, 2016 06:50 AM

Hi Ashley,

Thank you for contacting Syncfusion support.

We have created an incident  on behalf of you. Our support engineer will assist you through incident. We request you to follow with the incident for further details.
 
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents 

Regards,
Jagadeesan


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.

;