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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.