void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if (e.Style.TableCellIdentity.Column != null && e.Style.TableCellIdentity.Column.Name == "FirstName" && e.TableCellIdentity.DisplayElement != null && e.TableCellIdentity.DisplayElement.Kind == Syncfusion.Grouping.DisplayElementKind.Record) { //Set the comment text, comment image and fore color. { e.Style.CommentTip.CommentText = e.Style.Text; e.Style.CommentTip.CommentImage = Image.FromFile(@"../../Images/" + e.Style.Text + ".png"); e.Style.CommentTip.ForeColor = Color.White; } } }
private void DriverMetadataGrid_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { int index = Adapter.RowIndexToRecordIndex(e.TableCellIdentity.RowIndex); var data = Adapter[index]; if (data != null && data.Type == Api.Enums.GdalDriverMetadata.HelpTopic) { var cmnIndex = Adapter.GetColumnIndex(item => item.Value); if (cmnIndex == e.TableCellIdentity.ColIndex) { e.Style.CellType = HyperLinkModelName; e.Style.Tag = e.Style.Text; } } }
private void GGCDetalle_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if (e.Style.TableCellIdentity.Column != null) { //Setting the comment tip text if (e.TableCellIdentity.DisplayElement != null && e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record) { DataRowView dr1 = e.TableCellIdentity.DisplayElement.ParentRecord.GetData() as DataRowView; if (dr1 != null && dr1[9].ToString() == "1") { if (dr1 != null && dr1[8].ToString() == "0") { e.Style.BackColor = Color.Red; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } if (dr1 != null && dr1[8].ToString() == "1") { e.Style.BackColor = Color.Black; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } if (dr1 != null && dr1[8].ToString() == "2") { e.Style.BackColor = Color.Green; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } if (dr1 != null && dr1[8].ToString() == "3") { e.Style.BackColor = Color.SteelBlue; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } if (dr1 != null && dr1[8].ToString() == "4") { e.Style.BackColor = Color.DarkCyan; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } if (dr1 != null && dr1[8].ToString() == "5") { e.Style.BackColor = Color.Maroon; e.Style.TextColor = Color.WhiteSmoke; e.Style.Font.Bold = true; } } } } if (e.Style.TableCellIdentity.Column != null && e.Style.TableCellIdentity.Column.Name == "Metrado") { e.Style.Format = "#,##.00"; } if (e.Style.TableCellIdentity.Column != null && e.Style.TableCellIdentity.Column.Name == "Precio") { e.Style.Format = "#,##.00"; } if (e.Style.TableCellIdentity.Column != null && e.Style.TableCellIdentity.Column.Name == "Parcial") { e.Style.Format = "#,##.00"; } if (e.Style.TableCellIdentity.Column != null && e.Style.TableCellIdentity.Column.Name == "It") { e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; } }