Reputation: 8646
I have checkboxes at grid header row.
I wanted to find checkboxes which are clicked.
My check boxes are named as :
chk1 chk2 chk3 chk4
chk is common and 1,2,3,4 gets increament per column.
To get checked box,i did following code:
For i As Integer = 0 To gvSearch.Columns.Count - 1
IF CType(gvSearch.HeaderRow.FindControl("chk"& i+1 ,CheckBox).Checked) THEN
'some logic
END IF
Next
But, CType(gvSearch.HeaderRow.FindControl("chk"& i+1 ,CheckBox).Checked)
is giving me error as:
Syntax error in cast operator;two arguments separated by comma are required.
Please help me.
Upvotes: 0
Views: 102
Reputation: 2333
Your brackets are placed incorrect
CType(gvSearch.HeaderRow.FindControl("chk"& i+1),CheckBox).Checked
Upvotes: 1