Hi,
I have the summary in webdatagrid like:
<ig:SummaryRow EmptyFooterText="" EnableSummariesFilter="true" ShowSummariesButtons="false">
<ColumnSummaries>
<ig:ColumnSummaryInfo ColumnKey="TOTAL_ALLOCATION">
<Summaries>
<ig:Summary SummaryType="Sum" />
</Summaries></ig:ColumnSummaryInfo>
</ColumnSummaries>
<ColumnSettings>
<ig:SummaryRowSetting ColumnKey="TOTAL_ALLOCATION">
<SummarySettings>
<ig:SummarySetting SummaryType="Sum" FormatString="{1}" />
</SummarySettings>
</ig:SummaryRowSetting>
</ColumnSettings>
</ig:SummaryRow>
But I dynamically control the column's visibility in loading page backend C# code will not work
webdatagrid1.Columns.FromKey("ENTERED_BY").Hidden = true;
The Hidden property only works on the .aspx page but I need to control it programically.
Could you please advise where should I put the code to in order to make it work? I tried with Onload, Oninit, both don't work.
Thanks.
Hello Annie,
I'm glad that I've managed to help you.
Please let me know if I may be of further assistance.
That works. Thanks a lot!
Thank you for the provided sample!
You can get the parent container grid in order to hide its columns. To do so you can use the GridView property of the WebHierarchicalDataGrid, so basically in order to hide the column you can change to code to this:
1
hdgEnterExit.GridView.Columns.FromKey("Year").Hidden = true;
Let me know if you need further assistance.
Sorry for putting the wrong control name. I attached the example which reproduced the issue. with version 14.1.20141.1015
1. If you comment the summary part, the column visibility control in page_load() will work. Otherwise it won't work.
2. I just found if I put the column visilibiliy control code in button_Click_BindGrid(), it will not work no matter summary is there or not. It means it can't control the visibillity of the column in that function.
Could you please advise for these two issues?
Thanks,
Annie
Please next time when posting in our forum ensure that you are setting the right category for the control (The category for the WebHIerarchicalGrid is this one). This will help us address your issue correctly and also will help other users to benefit from this thread.
Please provide working project sample replicating your issue so I can help you resolving it.