Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Align RadioButtonList Labels in Header of Datagrid

Posted on 2005-04-05
7
Medium Priority
?
671 Views
Last Modified: 2010-05-18
I am building a survey application.

One of the question types asks the user to rank the answers in order of importance. (See sample below.)

------------------------
Rate the following in order of importance from 1 (least) to 5 (most).

1 2 3 4 5          
o o o o o  Cleanliness
o o o o o  Friendliness of Staff
o o o o o  Appliances Functional
o o o o o  Apartment Ready on Time
o o o o o  Flexible Move-in Schedule
------------------------
I am dynamically creating a RadioButonList in the datagrid based on how many answers there are for the question.

The .DataTextField is set to an empty string so that the numbers are not repeated for each row in the datagrid.

How can I get the header to dynamically build the text field labels AND align them properly over the radio buttons?

It is the alignment that really has e stumped. I suspect that I could create separate columns with radio buttons on the appropriate label for each. That seems like it would greatly complicate the data validation I need to do (there must be one unique selection for each answer).

Thanks.

John
0
Comment
Question by:JohnDesautels
  • 3
  • 3
6 Comments
 
LVL 11

Expert Comment

by:sachiek
ID: 13715358
DataGrid1.Items[0].Parent.Controls[0].Controls[0]  ==> This should return "1"

DataGrid1.Items[1].Parent.Controls[0].Controls[0]  ==> This should return "2"

DataGrid1.Items[2].Parent.Controls[0].Controls[0]  ==> This should return "3"

DataGrid1.Items[3].Parent.Controls[0].Controls[0]  ==> This should return "4"

DataGrid1.Items[4].Parent.Controls[0].Controls[0]  ==> This should return "5"

Hope it helps.
Check out with your code and let me know.


Sachi





0
 
LVL 6

Author Comment

by:JohnDesautels
ID: 13726665
Sachi,

Thanks for the idea on how to generate the labels.

My concern is really how to get the datagrid header label for each radio button in the dynamically sized radio button list to line up over the top of each radio button.

Ideally it should look good in multiple browsers.

I may need to resort to having a separate column for each button and use some client side code to make them collectively act like a radio button list (i.e. only one can be selected from the list).

John
0
 
LVL 11

Accepted Solution

by:
sachiek earned 2000 total points
ID: 13733740
I suggest you to have single colum for each radio button.
Thatway it is easier to control.
And in each colum you can have a value.

Else there is otherway.

Look at this below sample.
http://www.codeproject.com/aspnet/RadioButtonList_Demo.asp
It display vertically.

Now you modify the above code toward horizontal display with the help of this below code
http://www.codeproject.com/cs/database/Vertical_rows_in_Datagrid.asp

You can acheive your required solution .
Hope you got it.

Sachi
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:sachiek
ID: 13733745
If you did'nt get it let me know please.

Sachi
0
 
LVL 6

Author Comment

by:JohnDesautels
ID: 13738175
Thanks, Sachi.

I'm out of time for this wek and am out of the office next week.

I will revisit when I return.

John
0
 
LVL 6

Author Comment

by:JohnDesautels
ID: 13908244
Sorry for the delay in closing this out.

I did end up with a separate column for each Radio Button.

Much better control of the formatting.

John
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question