private bool IsMouseOverButton(int rowHandle, string column, Point point) { bool result = false; DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo vInfo = gvTenders.GetViewInfo() as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridViewInfo; if (vInfo != null) { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cellInfo = vInfo.GetGridCellInfo(rowHandle, gvTenders.Columns[column]); result = cellInfo.Bounds.Contains(point); } return(result); }
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e.Column.Name == "colCheckIndicator") { string text; bool isChecked; GridView grid = sender as GridView; if (grid.IsEditing && e.RowHandle == grid.FocusedRowHandle && grid.FocusedColumn.FieldName == "Column1") { text = grid.ActiveEditor.Text; } else { text = grid.GetRowCellDisplayText(e.RowHandle, grid.Columns["Column1"]); } isChecked = (text != null && text != string.Empty); DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cell = (DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo)e.Cell; DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo info = (DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo)cell.ViewInfo; info.EditValue = isChecked; } }
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (e.RowHandle != DevExpress.XtraGrid.GridControl.NewItemRowHandle) { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo gci = e.Cell as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo; DevExpress.XtraEditors.ViewInfo.TextEditViewInfo info = gci.ViewInfo as DevExpress.XtraEditors.ViewInfo.TextEditViewInfo; if (info == null) { return; } info.ContextImageAlignment = DevExpress.XtraEditors.ContextImageAlignment.Far; // if (e.Column.FieldName == MetadataItemFQN.TYPE_FIELDNAME || e.Column.FieldName == MetadataItemFQN.PARENT_TYPE_FIELDNAME) { if (e.CellValue == null) { e.Appearance.BackColor = System.Drawing.Color.LightYellow; //.NavajoWhite; return; } //if( e.CellValue.ToString( ) == "Field" ) //{ // info.ContextImage = fld_noaction_gray_img16x16; // info.CalcViewInfo( ); // return; //} //else if( e.CellValue.ToString( ) == "Table" ) //{ // info.ContextImage = tbl_noaction_red_img16x16; // info.CalcViewInfo( ); // return; //} //else if( e.CellValue.ToString( ) == "View" ) //{ // info.ContextImage = vw_noaction_red_img16x16; // info.CalcViewInfo( ); // return; //} //if( e.CellValue.ToString( ) == "ForeignKey" ) //{ // info.ContextImage = fk_noaction_gray_img16x16; // info.CalcViewInfo( ); // return; //} //if( e.CellValue.ToString( ) == "Procedure" ) //{ // info.ContextImage = proc_noaction_blue_img16x16; // info.CalcViewInfo( ); // return; //} //else if( e.CellValue.ToString( ) == "Synonym" ) //{ // info.ContextImage = syn_noaction_yellow_img16x16; // info.CalcViewInfo( ); // return; //} //else if( e.CellValue.ToString( ) == "Schema" ) //{ // info.ContextImage = sch_noaction_red_img16x16; // info.CalcViewInfo( ); // return; //} //else if( e.CellValue.ToString( ) == "Database" ) //{ // info.ContextImage = db_noaction_red_img16x16; // info.CalcViewInfo( ); // return; //} return; } } }