Hi All,
My first post to this forum. If I have posted the wrong type of question here please advice.
I have a page load event that updates the gridview sqlcommand depending on the postback of some RadioButtonLists.
In the gridview I have checkbox column and when the checkboxes are checked and a button is pressed i use a buttonclickevent handler to take actions against the data in the grid
The problem I have is that my sqlcommand is in the page load event and as such running before the buttonclickevent. This is clearing the selected checkboxes and as such leaving no array for my buttonclickevent to work through.
The solution I seek is
How can I ignore the (sqlcommand = ) in the pageload event if the button is clicked. eg something like
If (button1 is not clicked) Then
sqlcommand = "Select whatever From"
Else
do nothing
End
page load code.... for reference rdlDealerCode & rdlClaimType are RadioButtonLists with AutoPostBack
Dim strAnd1, strAnd2 As String
If rdlDealerCode.SelectedValue <> "" Then
strAnd1 = " And claimstore = '" + rdlDealerCode.SelectedValue + "'"
Else
strAnd1 = " "
End If
If rdlClaimType.SelectedValue <> "" Then
strAnd2 = " And claimdealer = '" + rdlClaimType.SelectedValue + "'"
Else
strAnd2 = " "
End If
SqlDataSource1.SelectCommand = "SELECT [Preclaimref], [claimdate], [claimemployee], [claimstore], [ClaimNotes] FROM [Act_ClaimPreProcess] WHERE claimstore <> ''" + strAnd1 + strAnd2
GridView1.DataKeyNames = New String() {"preclaimref"}
GridView1.DataBind()
Thankyou for any assistance here