I have followed the sample provided then tried to hide a column that I do not need like this:
<ig:BoundDataField Width="50" Header-Text="Id" DataFieldName="Id" Key="Id" Hidden="true" />But this does not work. Is there anyhting else I need to do?
The reason you are not getting the desired behavior is because in WebForms the server control is responsible for emitting a dynamic CSS class which hides the column. Unfortunately WebDataGrid Column Hiding is not supported in an ASP.NET MVC project.
Making a BoundDataField "Hidden" doesn't work for me in WebForms either. When I try to add a BoundDataField and set its Hidden attribute to "true", I get the following error:
"The Controls collection cannot be modified because the control contains code blocks (i.e.: <% ... %>)."
No where in my entire Grid markup do I have code blocks. If I simply remove the Hidden="true" attribute, it renders the grid perfectly.
Ooohh, the plot thickens! I get the same damn error even if I put Hidden="false"! So BoundDataField cannot handle the Hidden attribute AT ALL.
I'm working with NetAdvantage ASP.NET release 2011.1. Why? Because I have to.
Edit: I realize now that I'm in the MVC forum, not WebForms. Either way, my issue still stands.