Web Connection
Hide GridColumn dinamically
Gravatar is a globally recognized avatar based on your email address. Hide GridColumn dinamically
  Luca
  All
  Mar 22, 2020 @ 12:23am

Dear Rick,
I have a wwWebDataGrid control with 5 columns.
I should show 5 columns on tablet device, but only 4 columns on smartphone.
The video resolution break is 400px width.
I tryed to hide column5 with media queries (display:none) but it does not work, so I have to use

.Grid2.Columns.Remove("Column5")

Please is there any other way to show/hide gridcolumns dinamically based on client video resolution?
Thank you very much for support

Gravatar is a globally recognized avatar based on your email address. re: Hide GridColumn dinamically
  Rick Strahl
  Luca
  Mar 22, 2020 @ 07:30pm

Sure... you need to make sure you hide both the <th> and <td>...

Then in CSS

@media(max-width: 700px) {
     #tableName td:nth-child(3), #tableName th:nth-child(3) {
        display: none;
     }
}
© 1996-2024