当前位置: 首页>>代码示例>>C#>>正文


C# GridView.SetRowCellValue方法代码示例

本文整理汇总了C#中GridView.SetRowCellValue方法的典型用法代码示例。如果您正苦于以下问题:C# GridView.SetRowCellValue方法的具体用法?C# GridView.SetRowCellValue怎么用?C# GridView.SetRowCellValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridView的用法示例。


在下文中一共展示了GridView.SetRowCellValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RepositoryItemDataTreeNewExt

        public RepositoryItemDataTreeNewExt(XtraForm danhMucForm , GridView gridView ,string columnField, string TableName , int[] RootID , string ValueField , string IDParentField , string[] VisibleFields , string[] Captions , string getField)
        {
            init();
            dataTree.GridView = gridView;
            dataTree._BuildTree(danhMucForm ,columnField, TableName , RootID ,ValueField , IDParentField , VisibleFields , Captions , getField);
            int idValue ;

            gridView.GotFocus += delegate(object sender , EventArgs e)
            {
                if (gridView.DataSource != null &&
                   !((DataView)gridView.DataSource).Table.Columns.Contains(columnField + getField))
                {
                    ((DataView)gridView.DataSource).Table.Columns.Add(new DataColumn(columnField + getField));
                }
            };
            gridView.CellValueChanged += delegate(object sender , DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(columnField+getField))
                {
                    idValue = _getId(e.Value);
                    if (e.RowHandle < 0)
                    {
                        gridView.EditingValue = idValue;
                        gridView.SetRowCellValue(e.RowHandle , columnField , idValue);
                    }
                    else
                    {
                        DataRow dr = gridView.GetDataRow(e.RowHandle);
                        dr[columnField] = idValue;
                    }
                }
            };
            gridView.InitNewRow +=delegate(object sender , InitNewRowEventArgs e)
            {
                gridView.SetRowCellValue(e.RowHandle , columnField + getField , dataTree.TreeListEditor.FocusedNode.GetValue(getField));
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:37,代码来源:RepositoryItemDataTreeNewExt.cs

示例2: RepositoryPLGridSelect

        public RepositoryPLGridSelect(XtraForm frmDanhMuc ,string columnField, string tableName , string ValueField , string[] visibleField , string[] caption , string getField , GridView gridView)
        {
            init();
            plDanhMuc.GridView = gridView;
            plDanhMuc._init(frmDanhMuc ,columnField, tableName ,ValueField , visibleField , caption , getField);

            gridView.GotFocus += delegate(object sender , EventArgs e)
            {
                if (gridView.DataSource != null &&
                    !((DataView)gridView.DataSource).Table.Columns.Contains(columnField + getField))
                {
                    ((DataView)gridView.DataSource).Table.Columns.Add(new DataColumn(columnField + getField));
                }
            };
            int idValue;
            gridView.CellValueChanged += delegate(object sender , DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
            {

                if (e.Column.FieldName.Equals(columnField+getField))
                {
                    idValue = _getId(e.Value);
                    if (e.RowHandle < 0)
                    {
                        gridView.EditingValue = idValue;
                        gridView.SetFocusedRowCellValue(gridView.Columns.ColumnByFieldName(columnField) , idValue);
                    }
                    else
                    {
                        DataRow row = gridView.GetDataRow(e.RowHandle);
                        row[columnField] = idValue;
                    }
                }

            };

            gridView.InitNewRow += delegate(object sender , InitNewRowEventArgs e)
            {
                  gridView.SetRowCellValue(e.RowHandle , columnField + getField , plDanhMuc.GridViewEditor.FocusedValue);
            };
            this.Popup += new EventHandler(RepositoryHuyDanhMuc_Popup);
            this.Leave += new EventHandler(RepositoryDanhMucAdv_Leave);
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:42,代码来源:RepositoryPLGridSelect.cs

示例3: RepositoryItemSelectDMGridTemplate

        public RepositoryItemSelectDMGridTemplate(GroupElementType type, GridView gridView, string TableName, string columnField, string IDField, string DislayField, string getField, string[] NameFields,
            string[] Subjects, string FilterField, DMBasicGrid.InitGridColumns InitGridCol, DMBasicGrid.GetRule Rule, DelegationLib.DefinePermission permission, params string[] readOnlyField)
        {
            CotAo = columnField + getField + "_PLV";
            this.ShowPopupShadow = true;
            dmGridTemplate1 = new DMGrid();
            popupControl = new PopupContainerControl();
            this.CloseOnOuterMouseClick = false;
            this.PopupControl = popupControl;
            popupControl.Controls.Add(dmGridTemplate1);
            popupControl.Size = dmGridTemplate1.Size;
            this.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.Standard;
            this.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(RepositoryItemSelectDMGridTemplate_EditValueChanging);
            //dmGridTemplate1._init(type, TableName, IDField, DislayField, NameFields, Subjects, InitGridCol, Rule, permission, readOnlyField);
            this.Popup += new EventHandler(RepositoryItemSelectDMGridTemplate_Popup);
            this.CloseUp += new DevExpress.XtraEditors.Controls.CloseUpEventHandler(popupContainerEdit1_CloseUp);
            this.Closed += new DevExpress.XtraEditors.Controls.ClosedEventHandler(popupContainerEdit1_Closed);
            this.KeyDown += new KeyEventHandler(popupContainerEdit1_KeyDown);
            this.DislayField = DislayField;
            this.FilterField = FilterField;

            gridView.GridControl.DataSourceChanged += delegate(object sender, EventArgs e)
            {
                if (gridView.GridControl.DataSource != null &&
                    !((DataTable)gridView.GridControl.DataSource).Columns.Contains(CotAo))
                {

                    DataTable dt = (DataTable)gridView.GridControl.DataSource;
                    dt.Columns.Add(new DataColumn(CotAo));
                    SetValueTable(ref dt, columnField, CotAo, TableName, "ID", getField);
                }
            };

            long idValue;

            gridView.CellValueChanging += delegate(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(CotAo))
                {
                    idValue = _getSelectedID();
                    if (e.RowHandle < 0)
                    {
                        gridView.EditingValue = idValue;
                        gridView.SetFocusedRowCellValue(gridView.Columns.ColumnByFieldName(columnField), idValue);
                    }
                    else
                    {
                        DataTable dt = ((DataTable)gridView.GridControl.DataSource);
                        DataRow row = dt.Rows[e.RowHandle];
                        row[columnField] = idValue;
                        row[CotAo] = e.Value;
                    }
                }
            };
            gridView.InitNewRow += delegate(object sender, InitNewRowEventArgs e)
            {
                gridView.SetRowCellValue(e.RowHandle, columnField,_getSelectedID());
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:59,代码来源:RepositoryItemSelectDMGridTemplate+-+Copy.cs

示例4: adminQry

        private void adminQry(object val,GridView grid, DevExpress.XtraGrid.Columns.GridColumn col,string app)
        {
            if (val.ToString().Length < 2)
            {
                //this.//EFMsgInfo = EP.EPES.EPESC0000109/*请输入两位查询字符*/;
                return;
            }

            //FormESSUBJADMIN frm = new FormESSUBJADMIN(val.ToString(), app, MousePosition);
            //frm.ShowDialog();

             string rst = "";// frm.Ename;
            if (rst != string.Empty)
            {
                grid.SetRowCellValue(grid.FocusedRowHandle, col, rst);
            }
        }
开发者ID:sunpander,项目名称:VSDT,代码行数:17,代码来源:FormEPESSUBJ.cs

示例5: RepositoryComboboxAuto

        public RepositoryComboboxAuto(GridView gridView , string idField , string tableName , string valueField , string displayField , bool startWith)
            : this()
        {
            ParamInfo.tableName = tableName;
            ParamInfo.valueField = valueField;
            ParamInfo.displayField = displayField;
            ParamInfo.startWith = startWith;
            long idValue = -1;
            gridView.CellValueChanging+= delegate(object sender , DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
            {
                if (gridView.DataSource != null &&
                      !((DataView)gridView.DataSource).Table.Columns.Contains(idField + displayField))
                {
                    ((DataView)gridView.DataSource).Table.Columns.Add(new DataColumn(idField + displayField));
                }

                if ((idField+displayField).Equals(e.Column.FieldName))
                {
                    if (e.Value is ItemData)
                        idValue = ((ItemData)e.Value).ID;
                    else
                        idValue = -1;

                    if (e.RowHandle < 0)
                        gridView.SetRowCellValue(e.RowHandle , idField , idValue);
                    else
                    {
                        DataRow dr = gridView.GetDataRow(e.RowHandle);
                        dr[idField] = idValue;
                    }

                }
            };
            gridView.InitNewRow += delegate(object sender , InitNewRowEventArgs e)
            {
                gridView.SetRowCellValue(e.RowHandle , idField , idValue);
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:38,代码来源:RepositoryComboboxAuto.cs

示例6: SetGridSelect

        /// <summary>
        /// 表格列只读设置
        /// </summary>
        /// <param name="view">表格控件</param>
        /// <param name="ReadOnly">是否只读</param>
        /// <param name="obj">指定设置列</param>
        public static void SetGridSelect(GridView view, string ColumName, bool isSelect)
        {
            if (string.IsNullOrEmpty(ColumName) || view == null || view.RowCount <=0) return;
            
            //view.MoveFirst();

            for (int i = 0; i < view.RowCount; i++)
            {

                view.Focus();
                view.SetRowCellValue(i, ColumName, isSelect);
   
                ////DataRow dr = view.GetFocusedDataRow();
                //dr[ColumName] = isSelect;  
                ////view.MoveNext();
            }
        }
开发者ID:xlgwr,项目名称:producting,代码行数:23,代码来源:GridViewUtil.cs

示例7: CotPLVerticalCheckUDB

 /// <summary>Tạo cột chọn một trong các phần tử trên lưới cập nhật ngay khi chọn
 /// </summary>
 public static RepositoryItemCheckEdit CotPLVerticalCheckUDB(GridView gridView, GridColumn column, string ColumnField, string KeyField)
 {
     RepositoryItemCheckEdit checkEdit = CotPLImageCheck(column, ColumnField);
     gridView.CellValueChanging += delegate(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
     {
         if (e.Column.FieldName == ColumnField)
             for (int i = 0; i < gridView.RowCount; i++)
                 if (i != e.RowHandle)
                     gridView.SetRowCellValue(i, gridView.Columns[ColumnField], "");
         DataView view = (DataView)gridView.DataSource;
         DataTable table = view.Table;
         string checkColumn = table.Rows[e.RowHandle][ColumnField].ToString();
         if (checkColumn == "Y")
             UpdateStateNo(table.TableName, ColumnField);
         else
         {
             string id = table.Rows[e.RowHandle][KeyField].ToString();
             if (UpdateStateNo(table.TableName, ColumnField))
                 UpdateStateYes(table.TableName, ColumnField, KeyField, id);
         }
     };
     return checkEdit;
 }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:25,代码来源:HelpGridColumn.cs

示例8: CotPLVerticalCheck

 /// <summary>Tạo cột chọn một trong các phần tử trên lưới
 /// Không cập nhật DB ngay mà cập nhật trên lưới sau đó update sau
 /// </summary>
 /// <param name="gridView"></param>
 /// <param name="column"></param>
 /// <param name="ColumnField"></param>
 /// <returns></returns>
 public static RepositoryItemCheckEdit CotPLVerticalCheck(GridView gridView, GridColumn column, string ColumnField)
 {
     RepositoryItemCheckEdit checkEdit = CotPLImageCheck(column, ColumnField);
     gridView.CellValueChanging += delegate(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
     {
         DataView view = (DataView)gridView.DataSource;
         DataTable table = view.Table;
         if (e.Column.FieldName == ColumnField)
             for (int i = 0; i < gridView.RowCount; i++)
                 if (i != e.RowHandle)
                 {
                     gridView.SetRowCellValue(i, gridView.Columns[ColumnField], "");
                     table.Rows[i][ColumnField] = "N";
                 }
     };
     return checkEdit;
 }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:24,代码来源:HelpGridColumn.cs


注:本文中的GridView.SetRowCellValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。