954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Select the values of radio button in grid view

Hi All


I am working on a grid view where I have an acitve column which has radio button, user can select either yes or no for the active column. depending on the selection I am able to update the database.

I am using the code below to get the selected value of the row in the grid view

For i = 0 To Request.Form.Count - 1
            Name = Request.Form.AllKeys(i)
            If (Name.StartsWith("list")) Then
               Value = Request.Form.GetValues(i)(0)
              Array = itemName.Split("_")
              Name = itemArray(1)



Now I want to check the grid view if atleast one row has active field set to "yes", If user selects all the rows to No I want to display an error instead of updating the database.

how can we check the entire grid view if atleast one row has active = yes


Thanks in advance

cmis
Newbie Poster
1 post since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

Set a flag to zero, iterate over every row and check if it is set to yes, if it is, set the flag to one or boolean.true and exit

slaith
Newbie Poster
7 posts since Jun 2011
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: