Hi,
I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix
question is a question where you have several options that can all be rated
according to several possible ratings (from less to more for example).
I have a question object that has two properties that contain the
collections Options and Ratings.
now I want this kind of layout:
---
Rating1 Rating2 Rating3
Option 1 () () ()
Option 2 () () ()
Option 3 () () ()
---
The ()'s are radiobuttons.
I'm creaing the Matrix question as a Web User Control (.ascx page).
The web user control get's the question set in a property that I've added
called Question.
Now I've created a repeater that has it's datasource set to Options. And in
the header template I want to write the ratings (later I also want to create
the radiobuttons by creating a nested repeater over the ratings in the item
template).
---
<asp:Repeater ID="MatrixRepeater" runat="server">
<HeaderTemplate>
<table>
<tr>
<td>
</td>
<asp:Repeater runat="server" ID="HeaderRepeated"
DataSource="Question.Ratings">
<ItemTemplate>
<td><%# Eval(Container.DataItem, "Text") %>
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
---
My first question is: What do I write where I set the datasource for the
HeaderRepeater, where I've written "Question.Ratings"?
My Web User Control (.ascx) has a property named Question that has a
property called Ratings that I want to use as datasource.
My second question: Is this a good design, using Repeater controls, or is
there a better way to get the output I'm seeking?
Kind Regards,
Allan Ebdrup