【问题标题】:DevExpress and C#DevExpress 和 C#
【发布时间】:2020-12-15 17:07:21
【问题描述】:

如何从第 0 行开始进行 gridcontrol 搜索,例如在第 0 单元格中编写产品的代码,当按下 Tab 时,它会加载描述和其他数据,我想知道在哪个事件中我可以进行搜索,我是在 C# 和 SQL Server 中工作,我想按照我在图像中显示的那样进行搜索。

【问题讨论】:

    标签: devexpress-windows-ui


    【解决方案1】:

    处理 gridView1_CellValueChanged 事件。

    类似这样的:

    private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
    {
      switch (e.Column.Name)
       {
          case "NAME_OF_PRODUCT_COL":
           {
               var itemCode = e.Value.ToString();
               //Lookup the description in the lookup table
               string description = ""; //Replace with lookup value
               gridView1.SetRowCellValue(e.RowHandle, colDescription, description); //Replace colDescription with the correct name for the description column
              break;
           }
         }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多