Hi. I have an ASP.net GridView that has several template columns like that shown below. A datatable is bound to the GridView
but sometimes one or two of the columns that the template fields bind to are not included in the datatable.
So if the "EmployeeName" column is not in the datatable there will be an error. The only way that I can think of doing this
is to assign each datatable column to the corresponding gridview template column programatically but I am not sure how to do this
<asp:TemplateField HeaderText="Employee Name" Visible="true">
<asp:Label ID="lblEmployeeName" runat="server" Text='<%# Bind("EmployeeName")%>' Visible="true"></asp:Label>