Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > RadioButtonList In DataGrid

Thread Tools

RadioButtonList In DataGrid

Greg Wold
Posts: n/a
Hi all!

I have a page that gets a list of users from a database
and puts them into a DataGrid. The DataGrid is editable.

In Edit Mode of the DataGrid, I'll click update w/out
making a selection on a RadioButtonList and get this error:

"Object reference not set to an instance of an object."

Here's the code giving the error:

..Add(New SqlParameter("@ExceptionType", CInt(CType

I think I understand why I'm getting the error: there is
no value for the control.

The real problem is that I have a RequiredFieldValidator
in the EditItemTemplate that doesn't seem to catch
the unselected state of the RadioButtonList.

Here's the code for the validator:

<asp:requiredfieldvalidator id="radException_ReqFldValid"
initialvalue="" controltovalidate="radException"
display="Dynamic" errormessage="Please select an Exception
Type." />

Is this happening because it's in a template and is being
renamed for each user? If so, how do I workaround it?

Thanks in advance!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to bind DataGrid RadioButtonList's value? =?Utf-8?B?U2VyZw==?= ASP .Net 2 10-15-2004 06:15 PM
OnSelectedIndexChanged for a RadioButtonList in a DataGrid DotNetGruven ASP .Net 6 02-03-2004 03:58 PM
RadioButtonList in a DataGrid DotNetGruven ASP .Net 5 01-28-2004 12:21 AM
edit datagrid with radiobuttonlist Mike P ASP .Net 6 08-27-2003 02:45 PM
RadioButtonList in Nested DataGrid Problem Bob Hoke ASP .Net 0 07-11-2003 06:28 PM