Skip to content

Help with multiple buttons in gridview ?

del ete

Asked May 8, 2008, 8:35 PM EDT1 answer
Share
LinkedInX
CSS
If im using multiple buttons in a GridView control lets say a "increse"
 button for column 1 and  "decrease" button in column 2, how can i
determine which button was clicked.
any C# sample code would be appreciated.
thanks

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Niradhip Chakraborty
    0

    You can do it by assigning a flag or boolian variable.

    bool blnDuplicate = false;

    Make it true when clicked on column1 or increase button. and make it false for col 2 or decreade button

    Now inside for loop u can do the required operation.

    if(blnduplicate == true)
    {
       you know col 1 or increase button is clicked.
    }
    else
    {
      col 2 or decrease button is clicked.
    }

    0