zoukankan      html  css  js  c++  java
  • ColumnView.ShownEditor Event

    from:
    http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsBaseColumnView_ShownEditortopic

    using DevExpress.XtraEditors;
    using DevExpress.XtraGrid.Views.Grid;

    private DataView clone = null;

    private void gridView1_ShownEditor(object sender, System.EventArgs e) {
        GridView view = sender as GridView;
        if (view.FocusedColumn.FieldName == "CityCode" && view.ActiveEditor is LookUpEdit) {
            Text = view.ActiveEditor.Parent.Name;
            DevExpress.XtraEditors.LookUpEdit edit;
            edit = (LookUpEdit)view.ActiveEditor;

            DataTable table = edit.Properties.LookUpData.DataSource as DataTable;
            clone = new DataView(table);
            DataRow row = view.GetDataRow(view.FocusedRowHandle);
            clone.RowFilter = "[CountryCode] = " + row["CountryCode"].ToString();
            edit.Properties.LookUpData.DataSource = clone;
        }
    }

    private void gridView1_HiddenEditor(object sender, System.EventArgs e) {
        if (clone != null) {
            clone.Dispose();
            clone = null;
        }
    }
  • 相关阅读:
    053467
    053466
    053465
    NC201613 Jelly
    NC14608 after与迷宫
    NC14572 走出迷宫
    340. 通信线路
    1135. 新年好
    903. 昂贵的聘礼
    P5767 [NOI1997]最优乘车
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2317950.html
Copyright © 2011-2022 走看看