Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Event Handling

Last post 03-28-2008 4:53 AM by MichaelW. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-28-2008 4:53 AM

    • MichaelW
    • Not Ranked
    • Joined on 01-31-2008
    • Australia
    • New Member
    • Points 15

    Event Handling

    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 

    • Post Points: 5
Page 1 of 1 (1 items)