Solved

Is there a way of selecting all the remaining questions automatically from a radiolist? (with the Incorrect answer)

Posted on 2004-10-12
3
198 Views
Last Modified: 2010-04-23
Suppose I want to remove page validation on an exam to let the page automatically update the datasource based on a timer. The problem here is that some users may not have answered all questions before the page updates. This will result in some of the Radiobutton.selecteditem.text/values being returned as blank. This is the problem. I am getting the error cannot be set to null object.

Is there a way of selecting all the remaining questions automatically from a radiolist? (with the Incorrect answer)

The datavaluefield is what contains the correct or Incorrect values.

Any suggestions?

Im using VB.NET
0
Comment
Question by:pgilfeather
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
bramsquad earned 500 total points
ID: 12288897
i posted this after you accepted the answer to the question i helped you with, have you tried this...

For nCount = 0 To RadioButtonList.Items.Count - 1
      If RadioButtonList.Items(nCount).Selected = False Then
             RadioButtonList.Items(nCount).Value = "NoSelectedValue"
      End if
Next

~b
0
 
LVL 10

Expert Comment

by:Hans Langer
ID: 12291417
Do you have more than 1 RadioButtonList in a page , or just 1 for each page ?


For the code of you can add

if  not RadioButtonList.SelectedItem Is Nothing then
For nCount = 0 as integer To RadioButtonList.Items.Count - 1
      If RadioButtonList.Items(nCount).Selected = False Then
             RadioButtonList.Items(nCount).Value = "NoSelectedValue"
      End if
Next
0
 
LVL 10

Expert Comment

by:Hans Langer
ID: 12291464
Sorry , Problem with the connection,

Do you have more than 1 RadioButtonList in a page , or just 1 for each page ?

Try This

      If Not RadioButtonList .SelectedItem Is Nothing Then  ' that mean RadioButtonList have not SelectedItem
         For MyIndex As Integer = 0 To RadioButtonList .Items.Count - 1
            If RadioButtonList .Items(MyIndex ).Value = "NoSelectedValue" Then
               RadioButtonList .Items(MyIndex ).Selected = True
               Exit For
            End If
         Next
      End If

GL
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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