简体   繁体   中英

c# winform datagridview cell click to TabControl Page

i want to implement a function that can

click on the datagridview's cell/columns than will switch to Tab page

any idea on it ?

like these picture

pic one is the total result on Tab 1 and Tab2, when i click on cell/column

switch to Tab1 or Tab2 to see the details

    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        // check if you are clicking on needed column
        // and focus the tab
        if (e.ColumnIndex == 1) tabControl1.SelectedTab = tabPage2;
    }

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