不在CXGRID事件中怎么判断当前选中的是哪列,比如点击一按击告诉我当前选中的列名!

解决方案 »

  1.   


    cxGrid1DBTableView1ColumnPosChanged
    该事件中可以访问列的信息
      

  2.   

    我的意思是不在CXGRID事件中怎么获取呢,
      

  3.   


    cxGrid1DBTableView1.Controller.FocusedColumn
      

  4.   

    SelectedIndex property (TCustomDBGrid)
    Specifies the index of the currently selected column in the Columns array.,
    估计cxgrid也该有selectedIndex属性
      

  5.   

    三楼正解吖. cxGrid1DBTableView1.Controller.FocusedColumn.Caption 可返回列名.至于不在CXGRID事件中,你要当前选,就本来会触发事件吖.前提本来就点过CXGRID.