T
tshad
I want to use the same grid for 2 different stored procedures. The problem
is that some columns are not in the second SP. I would hide these columns
if running in that mode. The problem is that I would get errors from the
columns in the grid that don't have any columns in the returned SP to bind
with.
For example, the TrackingCode would not be in the other stored procedure so
this template would give me an error. I could either create another
identical Grid without these field but then I would have to keep track of
which Grid I was dealing with.
<asp:TemplateField HeaderText="Tracking Code"
HeaderStyle-CssClass="GridViewHeader" SortExpression="TrackingCode" >
<ItemTemplate>
<asp:Label ID="lblTrackingCode" runat="server" Text='<%#
Eval("TrackingCode") %>'></asp:Label>
</ItemTemplate><EditItemTemplate>
<asp:TextBox ID="txtTrackingCode" runat="server" Width="80px"
Text='<%# Eval("TrackingCode") %>' />
</EditItemTemplate>
</asp:TemplateField>
Is there a way to tell the program at Binding time to ignore these columns
since they are going to be invisible anyway?
Thanks,
Tom
is that some columns are not in the second SP. I would hide these columns
if running in that mode. The problem is that I would get errors from the
columns in the grid that don't have any columns in the returned SP to bind
with.
For example, the TrackingCode would not be in the other stored procedure so
this template would give me an error. I could either create another
identical Grid without these field but then I would have to keep track of
which Grid I was dealing with.
<asp:TemplateField HeaderText="Tracking Code"
HeaderStyle-CssClass="GridViewHeader" SortExpression="TrackingCode" >
<ItemTemplate>
<asp:Label ID="lblTrackingCode" runat="server" Text='<%#
Eval("TrackingCode") %>'></asp:Label>
</ItemTemplate><EditItemTemplate>
<asp:TextBox ID="txtTrackingCode" runat="server" Width="80px"
Text='<%# Eval("TrackingCode") %>' />
</EditItemTemplate>
</asp:TemplateField>
Is there a way to tell the program at Binding time to ignore these columns
since they are going to be invisible anyway?
Thanks,
Tom