c#winform datagridview单元格单击TabControl页面

时间:2015-11-08 13:32:08

标签: c# winforms datagridview tabs datagridviewcolumn

我想实现一个可以

的功能
  

点击datagridview的单元格/列,而不是切换到标签页

关于它的任何想法?

喜欢这些图片

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

1 个答案:

答案 0 :(得分:0)

    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;
    }