c# 4.0 - How to add text and image in a column in Component One FlexGrid? -


I have used the snippet mentioned below to show the text with the image, though I am unable to display the image with it.

Is the image path not accessible from code?

  C1.Win.C1FlexGrid.C1FlexGrid gAuditL = New C1.Win .C1FlexGrid.C1FlexGrid (); . . . GAuditL.DataSource = AuditLogVieweryDT; // This is a data source for (int i = gAuditL.Row.Fixed; i & lt; gAuditL.Rows.Count; i ++) / in the grid in the foreground line {string severity = gAuditL [i, gAuditL.Cols ["Severity "] Index] .toString () .; If (Severity == "Information") {this.gAuditL.SetCellImage (i, 0, Image.FromFile (@ ". \\ resource \ info.bmp")); This g.AuditL.SetData (i, 0, "notification"); } If (seriousness == "warning") {this.gAuditL.SetCellImage (i, 0, Image.FromFile (@ ". \ Resources \ warning.bmp")); This.gAuditL.SetData (Eye, 0, "Warning"); } If (seriousness == "important") {this.gAuditL.SetCellImage (i, 0, Image.FromFile (@ ". \\ resource \ important .bmp")); This.g.AuditL.SetData (i, 0, "critical"); } If (Severity == "Unspecified") {this.gAuditL.SetCellImage (i, 0, Image.FromFile (@ ". \ Resource, unassisted.bmp")); This g.AuditL.SetData (i, 0, "unspecified"); } This.gAuditL.Styles.Normal.ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.LeftCenter; This.gAuditL.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.RightCenter; }  

please refer to it. ( Posted by North Ope ) Public Sector Class Sample Project: Form {Image Image 1, IMG2, IMG3, IMG4; // Declaring member variables // Load Event Private Zero Audit LoggerWireload (Object Sender, EventArgs e) {Object Notice = Resource. Resource Manager. GetObject ("Information"); // Return the object from the image chan1.png in the project img1 = (image) information; Object warning = resource. Resource resources GetObject ("Warning"); // Undo an object with image chan1.png in project IG2 = (image) warning; Object critical = resources. Resourcenanner GetObject ("Important"); // Return the object from the image chan1.png in the project IG3 = (Image) Important; Object unspecified = resource ResourceManager.GetObject ("unspecified"); // Return an object from the image chan1.png in the project IG4 = (image) unspecified; } // Click on the grid Event Private Zero grdAuditLogs_OwnerDrawCell (Object Sender, OwnDrawCellEventArgs e) {if (e.Col == 2) {// Grid Cell E. Color background and border color for the dorsel (C 1.Win.C1FlexGrid DrawCellFlags.Background | C1.Win.C1FlexGrid.DrawCellFlags.Border); // search width width = (int) e.Graphics.MeasureString (e.Text, e.Style.Font). With; // x-coordinate var img1_x = e.bounds.x + width + 10 for each image; Var img2_x = e.bounds.x + width + 10; Var img3_x = e.bounds.x + width + 10; Var img4_x = e.bounds.x + width + 10; // var img3_x = img2_x + img2.Width + 5; // location for each image var img1_loc = new point (img1_x, e.bounds.Y + img1.Height - 18); Var img2_loc = new point (img2_x, e.bounds.Y + img2.Height - 18); Var img3_loc = new point (img3_x, e.bounds.Y + img3.Height - 18); Var img4_loc = new point (img4_x, e.bounds.Y + img4.Height - 18); // Attract images at prefixed points if (grdAuditLogs [e.Row, grdAuditLogs.Cols ["Severity"]. Index] ostring () == "Information") e.Graphics.DrawImage (img1, img1_loc); If (grdAuditLogs [e.Row, grdAuditLogs.Cols ["Severity"]. Index] ostring () == "warning" e.Graphics.DrawImage (img2, img2_loc); If (grdAuditLogs [E.R., grdAuditLogs.Cols ["Severity"]. Index] ostring () == "Critical") e.Graphics.DrawImage (img3, img3_loc); If (grdAuditLogs [E.R.o., grdAuditLogs.Cols ["Severity"]. Index] ostring () == "unspecified") e.Graphics.DrawImage (img4, img4_loc); //e1.Graphics.DrawImage(img3, img3_loc); // Draw Text e.Graphics.DrawString (e.Text, e.Style.Font, Brushes.Black, e.bounds.Location); E.Handled = True; }}


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -