Hi,
I need to hide and show rows in webgrid at runtime. Is there any way to do that?
Please give sample code for the same.
Thanks,
Nandu
Where are you executing this code?
Also, you don't need to loop through every row to apply a style. Instead just do:
((Row)igModelGrid.Rows[0]) .CellStyle = app.dictionary["IGHideRowStyle"] as Style;
-SteveZ
Thank you Steve.I have one more issue.I have a grid in which I am applying color to some rows, using "foreach" loop
foreach
(Cell cell in igModelGrid.Rows[0].Cells){cell.Style = app.dictionary["IGHideRowStyle"] as Style;}It works fine when I load page 1st time (with ItemSource = A), Now I am changing source of grid dynamically (ItemSource = B). Now again I am changin ItemSource back to "A " and applying same loop to some rows but when grid shows data it does not show the style that I applied to Rows.:( It is working when I apply Source fist time. But not working when I change ItemSource. :( PLEASE HELP
Hi Nandu,
There is a property on the Column called Visibility. Just set it to Collapsed, and the column will be hidden.
Thanks Stephen,Please will you tell me How do I hide Column..?Please give me sample code.Thank you :)-Nandu
We do not have a Visibility property on a row. However, you could toggle the height of the row to 0.
grid.Rows[0].Height = new RowHeight(0);