Handle Button Click in WinForm DataRepeater C # Power Pack

I want to process a winform button clicked in DataRepeater, how can I do that? all buttons are placed in DataRepeater

Many thanks

+2


source to share


1 answer


In the visual studio designer, double click on the button, and then you will get an empty event handler method. Add code there.

You can get the current item via CurrentItem or CurrentItemIndex to get the button clicked ...



    private void button1_Click(object sender, EventArgs e)
    {
        Console.WriteLine("DEBUG: CurrentItem: " + dataRepeater1.CurrentItem);
        Console.WriteLine("DEBUG: CurrentItemIndex: " + dataRepeater1.CurrentItemIndex);
    }

      

+4


source







All Articles