I have a datalist inside a usercontrol that gets loaded into a page where users can customize a report based on some checkboxes.
One of the checkboxes, however, is "Hide Worklog" which should hide the worklog column from the result set because it can be quite long and interfere with the report.
If I do:
datatable1.Columns.Remove("WorkLog");
the code throws an exception because:
<asp:Label ID="WorkLog" runat="server" Text='<%# Bind("WorkLog") %>'></asp:Label></td>
doesn't exist.
Am I going about the usercontrol all wrong? This usercontrol should always be able to show the worklog, so I don't think it's bad to bind it in there, but at the same time I want to be able to hide it if the user wants.