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
20
How can we hide columns in ultrawingrid when we clicked that column
posted

Hi,

     I am working with ultrawingrid,i have a problem to hide columns in utrawingrid when we click that column.I worked with that but i did not get the right answer.Please help me How can i get the that result

please provide answer with events.

Thanking you,

VinayPinisetti

Parents
No Data
Reply
  • 69832
    Offline posted

    I want to preface this with a recommendation that you reconsider doing this because user will almost certainly think there is a serious bug at play when they click a column header or cell and that column vanishes. You can set UltraGrid.DisplayLayout.Override.RowSelectorHeaderStyle to ColumnChooserButton to get the grid to show a button in the top left corner which, when clicked, displays a dialog that enables the user to show/hide columns.

    The answer to your original question is, you can hit test for a column using UIElement methods like ElementFromPoint and GetContext; the former gives you a way to get a reference to the UIElement at the cursor position, and the latter lets you determine which column the element belongs to. Once you have a reference to the column you can set its Hidden property to true, although once you do there would be no way for the user to make that column visible again.

Children