简体   繁体   中英

Handle Button Click in WinForm DataRepeater C# Power Pack

i want to handle winform button click in the DataRepeater, how can i do it? all button are placed in a DataRepeater

Thank you very much

In visual studio designer, double click the button then you get the empty eventhandler method. Add code there.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM