I have a simple WebGrid where I'm trying to hide some columns. I've set the column.Hidden attribute to true however when the grid is displayed the column headers and column values are not displayed but there appears to be an empty column displayed in the grid.
I've attached a screen shot with the areas of concern circled. Is this expected behavior? Is there any way to prevent this?
Thanks
It is hard to tell what is happening here, unfortunately. I have tried to reproduce the problem in a hierarhical grid I have locally (actually, the one from our online samples located here)
http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm
(Grid -> Hierarhical Grid)
However I do not see side effect of hiding the columns. By the way, this is how I am hiding a couple of columns - I am using the InitializeLayout event of the grid:
private void UG1_InitializeLayout(object sender, LayoutEventArgs e) { UG1.Bands[0].Columns.FromKey("CustomerID").Hidden = true; UG1.Bands[0].Columns.FromKey("ContactName").Hidden = true; }
If this does not help, I am afraid the best way to is to contact our dedicated Developer Support - you can ZIP a small subset of your project reproducing the problem and send it to our dedicated Developer Support departament via this link - you will receive a prompt response asap
http://es.infragistics.com/gethelp/
Hope this helps.
No, you didn't miss anything. I could not figure out how to add an attachment so I've now uploaded the image of the grid and can add this link.
This is a grid where the data is bound to a class at run time and where the 2nd band rows are added at run time as well if that makes any difference.
Hello,
Thanks for writing. Unfortunately it appears that the screenshot did not make it (at least I am not seeing one). Am I missing something?
In any case, I tried binding a simple WebGrid to a Northwind datatable and set one of the columns there Hidden = True and could not observe what you see. Please, see the screenshot attached for what I get for this setup (notice that I have three columns and I set the third one Hidden = True)
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="AccessDataSource1"> <bands> <igtbl:UltraGridBand> <Columns> <igtbl:UltraGridColumn BaseColumnName="CustomerID" IsBound="True" Key="CustomerID"> <Header Caption="CustomerID"> </Header> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="CompanyName" IsBound="True" Key="CompanyName"> <Header Caption="CompanyName"> <RowLayoutColumnInfo OriginX="1" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="ContactName" IsBound="True" Key="ContactName" Hidden="true"> <Header Caption="ContactName"> <RowLayoutColumnInfo OriginX="2" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="2" /> </Footer> </igtbl:UltraGridColumn> </Columns> <addnewrow view="NotSet" visible="NotSet"> </addnewrow> </igtbl:UltraGridBand> </bands>