views:

79

answers:

0

I'm not having much luck so far, so I am going to generalize my problem to see if there is a better way to accomplish what I neeed.

Here is my scenario - I want a control that is defined in an aspx very similarly to a gridview. Something like this:

<user:ReportView runat="server" id="rvData" >
    <Columns>
        <asp:BoundField HeaderText="The ID" DataField="ID" />
        <asp:BoundField HeaderText="Product Name" DataField="Name" />
        <asp:BoundField HeaderText="Size" DataField="SizeID" />
        <asp:TemplateField HeaderText="Stuff">
            <ItemTemplate>
                Color *<%# Eval("ColorID") %>*
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</user:ReportView>

I will be using this control for several different reports, and I want to tuck in the formatting by doing one of two things: 1. implementing the <Columns> in a DataBoundControl or 2. wrapping a GridView (probably easier).

I want to construct my own control tree from the bound data (I don't want to render one table, I want to have the freedom to populate any set of controls I want.

The problem I am having is I can't seem to get a hold of the content inside of a cell using a TemplateField when I iterate through GridViewRows. Is there any way to get the evaluated content of a template field programmatically?

Any suggestions as to how to go about this?