M
Mark
Hi
Suppose I have a data grid set up using HTML containing
templated columns.
<asp:TemplateColumn HeaderText="SMILES (Template)">
<ItemTemplate>
<asp:textbox runat="server" Text='<%# DataBinder.Eval
(Container, "DataItem.ISOSMILES") %>'></asp:textbox>
</ItemTemplate>
</asp:TemplateColumn>
At run time, a sub gets passed this data grid and wants to
work out the item template in each column. Specifically,
I need to work out which SQL column (ISOSMILES in the
example above) the column is going to try and bind to, if
any.
The reason is I want to remove the column from the data
grid if the particular query I am going to run will not
return that column, so as to avoid an exception.
With a bound column, you get the Datafield property. With
a templated column, I cannot figure out how to access the
ItemTemplate, as all this returns is the ITemplate
interface, which has no useful properties.
Thanks for any suggestions.
Mark
Suppose I have a data grid set up using HTML containing
templated columns.
<asp:TemplateColumn HeaderText="SMILES (Template)">
<ItemTemplate>
<asp:textbox runat="server" Text='<%# DataBinder.Eval
(Container, "DataItem.ISOSMILES") %>'></asp:textbox>
</ItemTemplate>
</asp:TemplateColumn>
At run time, a sub gets passed this data grid and wants to
work out the item template in each column. Specifically,
I need to work out which SQL column (ISOSMILES in the
example above) the column is going to try and bind to, if
any.
The reason is I want to remove the column from the data
grid if the particular query I am going to run will not
return that column, so as to avoid an exception.
With a bound column, you get the Datafield property. With
a templated column, I cannot figure out how to access the
ItemTemplate, as all this returns is the ITemplate
interface, which has no useful properties.
Thanks for any suggestions.
Mark