Hello,
I have been trying to conditionally hide a column in a ultrawingrid when the row doesn't have data for that column. As you can see below, the columns with all the a's should be hidden when there is no data. Is it possible to hide the column per row or is it all or nothing? The column does hide if the entire grid doesn't have data for that column but as soon as one row has data, it puts the cell back in the rows that doesn't have data. I check for the values in the InitializeRow procedure. Any help would be appreciated.
What I have:
Col1 Col2 Col3Row1 zzzz zzzz zzzz aaaaaaaaRow2 zzzz zzzz zzzz
Row3 zzzz zzzz zzzz Row4 zzzz zzzz zzzz aaaaaaaa
Col1 Col2 Col3
Row1 zzzz zzzz zzzz aaaaaaaa Row2 zzzz zzzz zzzzRow3 zzzz zzzz zzzz Row4 zzzz zzzz zzzz aaaaaaaa
Hi
It sounds like you are hiding the column instead of the cell. Use the Hidden property on the cell.
I have them both set to hide if it is empty.
Private Sub UltraGrid1_InitializeRow(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles UltraGrid1.InitializeRow If String.IsNullOrEmpty(e.Row.Cells("LabelNotes").Value.ToString.Replace(" ", "")) = True Then e.Row.Cells("LabelNotes").Column.Hidden = True e.Row.Cells("LabelNotes").Hidden = True Else e.Row.Cells("LabelNotes").Column.Hidden = False e.Row.Cells("LabelNotes").Hidden = False End If End Sub
Like I said before, when there are no rows with "LabelNotes" then it works fine. But as soon as there is at least 1 row with "LabelNotes" then all rows show that cell. It makes my grid look like it has double spacing.