I want to hide the first column in my WHDG, in code, when a certail condition occurs. I have a checkbox inside a template field as the first column. I have tried the following;
WebHierarchicalDataGrid.Columns(0).Hidden = True
This doesnt make any change at all when the page is loaded. The column is still visible.
I am using the grid to display a flat table with grouping allowed for certain columns (not the chkbox templated column of course).
Anyone have a clue as to how I can get this to work?
Hi hogleg,
Does hiding any other columns work? Or does it work if you hide it from the aspx? I know I've seen cases where column hiding does not work properly if the head does not have runat="server". Could you check that? Let me know.
regards,
David Young
David,
It works when I set hidden on the aspx. Doesn't otherwise, on any column, even a non template field.
head statement has runat server set appropriately.
<h
ead id="Head1" runat="server"><title>WebCTS Client Summary</title><script type="text/javascript" src="includes\windows.js"></script></head>
<CollapseButton AltText="Collapse Row"></CollapseButton>
<ExpandButton AltText="Expand Row"></ExpandButton> <Behaviors> <ig:Sorting> <ColumnSettings> <ig:SortingColumnSetting ColumnKey="BoundColumn_4" /> <ig:SortingColumnSetting ColumnKey="BoundColumn_6" /> <ig:SortingColumnSetting ColumnKey="BoundColumn_7" /> <ig:SortingColumnSetting ColumnKey="BoundColumn_8" /> </ColumnSettings> </ig:Sorting> </Behaviors> </ig:WebHierarchicalDataGrid>