473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Matrix question and nested repeaters

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="MatrixRepea ter" runat="server">
<HeaderTemplate >
<table>
<tr>
<td>
</td>
<asp:Repeater runat="server" ID="HeaderRepea ted"
DataSource="Que stion.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.Ratin gs"?
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
Dec 20 '06 #1
2 4282
I found a solution:
---
<asp:Repeater ID="MatrixRepea ter" runat="server">
<HeaderTemplate >
<table>
<tr>
<td>
&nbsp;
</td>
<asp:Repeater runat="server" DataSource="<%#
((Controls_Surv ey_Questions_Ma trixQuestion)Co ntainer.Parent. Parent).Questio n.Ratings
%>">
<ItemTemplate >
<td valign="bottom" >
<%# Eval("Text")%>
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</HeaderTemplate>
<ItemTemplate >
<tr>
<td>
<%# Eval("Text") %>
</td>
<asp:Repeater ID="RatingsRepe ater" runat="server"
DataSource="<%# ((Controls_Surv ey_Questions_Ma trixQuestion)Co ntainer.Parent. Parent).Questio n.Ratings
%>">
<ItemTemplate >
<td valign="top" align="center">
<cc1:GlobalRadi oButton
ID="GlobalRadio Button1" runat="server"
GlobalGroup="tr ue"
GroupName="<%#
((CopenhagenSof tware.UserFeedb ack.QuestionOpt ion)((RepeaterI tem)Container.P arent.Parent).D ataItem).Id
%>"
/>
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</ItemTemplate>
<FooterTemplate >
</table>
</FooterTemplate>
</asp:Repeater>
---

I don't think that all the dotting to Parent.Parent and casting is very
pretty but it works, now all I have to figure out is how to retrieve what
radiobuttons were clicked.

I'm using the GlobalRadioButt on control I found here:
http://metabuilders.com/Tools/GlobalRadioButton.aspx
Because of the probles ASP.Net has with having radiobuttons belonging to the
same group inside repeater controls.

Kind Regards,
Allan Ebdrup
Dec 20 '06 #2
Hi Allan,

It seems you've found the solution yourself. I'm not sure if you have more
questions or not. Please feel free to reply here to let me know if there's
anything I can help.

Have a nice day and Merry Christmas!
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14725
by: DonRex | last post by:
Hello all! I couldn't find a web application-newsgroup for ASP.NET, so I'm sorry if this is the wrong forum! Synopsis: In my webform I have 3 nested repeaters: rpWeeks ----- rpTime
0
1342
by: Machi | last post by:
> let say i created nested repeaters in HTML page of a particular Web Form Parent repeater dubbed >> "parentRepeater", child Repeater dubbed "childRepeater" . Withi "parentRepeater" and "childRepeater", >> defined a checkbox respectively. In Code-Behind, i will dynamicall generate parent-child records, as such .. >> > >> >
0
1535
by: Machi | last post by:
let say in parent-child scenerio (Product: Product Category - one product category may has many products), i am using nested repeaters where parent repeater will be used to display info and child repeater will be used to display info, i define the parent and child repeaters once in HTML tag, and create the repeaters for different categories and products repeaters (instances of Repeater) dynamically in Code-Behind using C#, however, when i view...
0
1269
by: kettch | last post by:
Is it possible to have nested repeaters three layers deep I have gotten it to work with only two, and when I tried to get the third layer to work COD <asp:repeater id="rep" runat="server"><ItemTemplate><span style="BACKGROUND-COLOR: silver"><%# DataBinder.Eval(Container.DataItem, "CustomerID") %>&nbsp <%# DataBinder.Eval(Container.DataItem, "CompanyName") %></span><br /><asp:repeater id="childRepeater" runat="server" datasource='<%#...
1
10819
by: jeremystein | last post by:
With nested repeaters, how can I access the outer repeater's DataItem from the inner repeater? Here's a snippet from my aspx: <asp:repeater id="OuterRepeater" runat="server" onItemDataBound="PrepareInner"> <ItemTemplate> <h1> <%# DataBinder.Eval(Container.DataItem, "number") %>
1
1369
by: mavrick_101 | last post by:
Hi, I have nested repeaters. But the page breaks if I refresh 2 or 3 times. It breaks with the following error message.. "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. " I am using the following lines for loading data in the child repeaters on Item_DataBound of Parent Repeater.
2
4950
by: Josh | last post by:
I have a nested repeater situation with a Link Button on the nested repeater. However when the link button is clicked I get a postback but the event never takes place. I'm trying to wire up the nested repeaters ItemCommand event in the ItemDataBound of the outer repeater. I have even tried sharing the Outer repeaters ItemCommand event but it still does not fire. I'm missing a trick here, can you tell me what it is?
1
4332
PrinsonG
by: PrinsonG | last post by:
My Query is How do I export to excel/csv using Nested Repeaters. My project is web-based and i am using C#.Net. In this i use three repeaters. one displays ID, Name of the user. second displays break details. third displays total time spent.
3
9466
by: Leon Mayne | last post by:
If I have a datatable which looks like this: Record Id, Group Id, Name 1, 1, Test 1 2, 1, Test 2 3, 2, Test 3 4, 3, Test 4 Is it possible to use nested repeaters to group the information by GroupId? e.g. displaying something like
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.