Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
630
WebHierarchicalDataGrid hidden column in band
posted

I use 2014.1 and i have AutoGenerateColumns="false"

I want to show or hide column depend on condition and its not work.

On First level its works!

whdg.Columns(3).Hidden = False or True (Work well)

On second band its not works and i try some way

whdg.Bands(0).Columns(3).Hidden = False or True (Don't work)
whdg.GridView.Bands(0).Columns(3).Hidden =  False or True (Don't work)



Parents
  • 9190
    Suggested Answer
    Offline posted

    Hi,

    Thank you for posting on our forums.

    When manually defining columns in the for each band in the WebHierarchicalDataGrid, you can utilize Bands collection as done in your first attempt to hide columns. I believe this isn't working for you because the index of (0) you've passed into the bands collection will return the parent band for the WebHierarchicalDataGrid.

    The following code should work for you:
    wdhg.Bands(1).Columns(3).Hidden = True

    I have attached a sample which demonstrates the hiding of a "Department" column on the second band.

    Here is the relevant code in my sample:
    Me.WebHierarchicalDataGrid1.Bands("Employees").Columns("Department").Hidden = True

    Please review the sample and let me know if you have any questions.

    WDGHideColumns.zip
Reply Children