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.
By the way, If I remove the summary, dynamically control the column's visibility will work.
Hello Annie,
Thank you for contacting Infragistics Developer Support!
I was not able to reproduce the behaviour that you're seeing on your side. I have attached the sample project I used to test this. Please test this project on your side; whether or not it works correctly may help indicate the nature of this issue. If this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.Please let me know if I can provide any further assistance.
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.
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
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.
That works. Thanks a lot!
I'm glad that I've managed to help you.
Please let me know if I may be of further assistance.