private void layoutView_CustomDrawCardFieldValue(object sender, RowCellCustomDrawEventArgs e) { bool hovering = HoverCard != null && e.RowHandle == HoverCard.RowHandle; bool isSideBand = e.Column == colLayoutSpacer; if (isSideBand) { e.Appearance.BackColor = hovering ? Color.FromArgb(140, 176, 89) : Color.FromArgb(146, 180, 93); } else { Color generalColor = Color.FromArgb(231, 231, 231); LayoutView cardView = sender as LayoutView; if (cardView != null) { object rowData = cardView.GetRow(e.RowHandle); PropertyInfo proInfo = rowData.GetType().GetProperty("BgColor"); if (proInfo != null) { object colorValue = proInfo.GetValue(rowData, null); if (colorValue is Color) { generalColor = (Color)colorValue; } } } e.Appearance.BackColor = hovering ? Color.FromArgb(236, 234, 235) : generalColor;// Color.FromArgb(231, 231, 231); } }
private void layoutView1_CustomCardStyle(object sender, DevExpress.XtraGrid.Views.Layout.Events.LayoutViewCardStyleEventArgs e) { LayoutView view = (LayoutView)sender; UrunHareket row = (UrunHareket)view.GetRow(e.RowHandle); if (view.FocusedRowHandle == e.RowHandle) { e.Appearance.BackColor = Color.DarkSeaGreen; return; } switch (row.UrunHareketTip) { case UrunHareketTip.Satis: e.Appearance.BackColor = Color.PaleTurquoise; break; case UrunHareketTip.Iptal: e.Appearance.BackColor = Color.Tomato; break; case UrunHareketTip.Ikram: e.Appearance.BackColor = Color.MediumSpringGreen; break; default: break; } }
void ConfigureOppCol(LookBoardColumn col, string tag, string filter) { col.LayoutView.ActiveFilterString = filter; col.LayoutView.MouseDown += new MouseEventHandler(layoutView_MouseDown); col.LayoutView.MouseMove += new MouseEventHandler(layoutView_MouseMove); //col.LayoutView.MouseUp += new MouseEventHandler(layoutView_MouseUp); col.LayoutView.DoubleClick += (sender, e) => { LayoutView layoutView = sender as LayoutView; if (layoutView == null) { return; } if (layoutView.FocusedRowHandle < 0) { return; } if (OnEditItem != null) { OnEditItem(sender, new EventArgs <object>(layoutView.GetRow(layoutView.FocusedRowHandle))); } }; col.GridControl.DragDrop += new DragEventHandler(gridControl_DragDrop); col.GridControl.DragOver += new DragEventHandler(gridControl_DragOver); col.GridControl.DragLeave += new EventHandler(gridControl_DragLeave); col.GridControl.GiveFeedback += new GiveFeedbackEventHandler(gridControl_GiveFeedback); col.GridControl.QueryContinueDrag += new QueryContinueDragEventHandler(gridControl_QueryContinueDrag); col.GridControl.Tag = tag; }
private void layoutView1_CustomCardLayout(object sender, DevExpress.XtraGrid.Views.Layout.Events.LayoutViewCustomCardLayoutEventArgs e) { LayoutView view = sender as LayoutView; Person p = view.GetRow(e.RowHandle) as Person; string colTitleName = view.Columns["Title"].LayoutViewField.Name; string colTotalTurnover = view.Columns["TotalTurnover"].LayoutViewField.Name; if (p.GetType() == typeof(Employee)) { e.CardDifferences.AddItemDifference(colTitleName, LayoutItemDifferenceType.ItemVisibility, true); e.CardDifferences.AddItemDifference(colTotalTurnover, LayoutItemDifferenceType.ItemVisibility, false); } if (p.GetType() == typeof(Customer)) { e.CardDifferences.AddItemDifference(colTitleName, LayoutItemDifferenceType.ItemVisibility, false); e.CardDifferences.AddItemDifference(colTotalTurnover, LayoutItemDifferenceType.ItemVisibility, true); } }
private void btnRandom_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { splitQC.Panel2Collapsed = true; dgvQCList.DataSource = null; if (lView.SelectedRowsCount > 0) { int[] selRows = lView.GetSelectedRows(); DataRowView selRow = (DataRowView)lView.GetRow(selRows[0]); string sSelectedAgentName = selRow["AgentName"].ToString(); string sValidStatus = string.Empty; if (GV.sAccessTo == "TR") { sValidStatus = GV.sTRContactstatusTobeValidated; } else { sValidStatus = GV.sWRContactstatusTobeValidated; } if (sSelectedAgentName.Length > 0) { string sQuery = string.Empty; if (sProcessTable == "Contact") { if (sProcessType == "Fresh") { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sContactTable + " A LEFT JOIN " + GV.sQCTable + " B ON A.CONTACT_ID_P = B.RecordID AND B.TableName='Contact' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + GV.sAccessTo + "_UPDATED_DATE AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENT_NAME='" + sSelectedAgentName + "' AND A." + GV.sAccessTo + "_CONTACT_STATUS IN "; sQuery += " (" + sValidStatus + ") AND B.QC_Sample_Status IS NULL Order By Rand();"; } else { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sContactTable + " A INNER JOIN " + GV.sQCTable + " B ON A.CONTACT_ID_P = B.RecordID AND B.TableName='Contact' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + GV.sAccessTo + "_UPDATED_DATE AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENT_NAME='" + sSelectedAgentName + "' AND B.QC_Status ='Reprocessed'"; sQuery += " Order By Rand();"; } } else { if (sProcessType == "Fresh") { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sCompanyTable + " A LEFT JOIN " + GV.sQCTable + " B ON A.MASTER_ID = B.RecordID AND B.TableName='Company' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + sDateColumn + " AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENTNAME='" + sSelectedAgentName + "' "; sQuery += " AND B.QC_Sample_Status IS NULL Order By Rand();"; } else { sQuery = "SELECT TOP 1 A.Master_ID FROM " + GV.sCompanyTable + " A INNER JOIN " + GV.sQCTable + " B ON A.MASTER_ID = B.RecordID AND B.TableName='Company' AND B.ResearchType='" + GV.sAccessTo + "'"; sQuery += " WHERE CAST(A." + sDateColumn + " AS DATE) = '" + sSelectedDate + "' AND A." + GV.sAccessTo + "_AGENTNAME='" + sSelectedAgentName + "' AND B.QC_Status ='Reprocessed'"; sQuery += " Order By Rand();"; } } System.Data.DataTable dtSampleRecords = GV.MSSQL1.BAL_ExecuteQuery(sQuery); if (dtSampleRecords.Rows.Count > 0) { GM.OpenContactUpdate(dtSampleRecords.Rows[0]["MASTER_ID"].ToString(), false, true, this, null); } } } }