Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I have a gridview having a checkbox list against each item , now i need a logic such that if i select a single checkbox and click on submit button a message pop up and if i all the checkbox of the gridview again i get some message on click of the button and if i did not select any checkbox in the gridview i will get an error message in label stating that please select the checkbox to download or something else in my label.

SQL
Dim checkboxSelected As Boolean = Mygridview.SelectedIndexes.Count > 0

Dim mycheckboxvalue As Integer = If(checkboxSelected, Mygridview.SelectedDataRow("column_name"), 0)

Dim myString As String = ""

If ( checkboxSelected = true )  Then

For Each row In Mygridview.SelectedDataRows

mycheckboxvalue = row("column_name")

myString &= "  IIf(checkboxSelected, "0", "1")

Next
    Else

  mycheckboxvalue  =  0

ShowError("here error displayed ")

End If

Return myString
Posted
Updated 4-Jun-13 12:43pm
v2

1 solution

The code you have implemented for this seems to be accurate enough.
If you are facing some issues, just debug it and perhaps you will be able to solve the problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900