0

以下のスニペットを使用して、画像付きのテキストを表示しました。ただし、画像を表示できません。

イメージへのパスはコードからアクセスできませんか?

C1.Win.C1FlexGrid.C1FlexGrid gAuditL = new C1.Win.C1FlexGrid.C1FlexGrid();
.
.
.
gAuditL.DataSource = AuditLogVieweryDT;// this is datasource
for (int i = gAuditL.Row.Fixed; i < gAuditL.Rows.Count; i++)
//foreach  row in grid 
{
 string severity = gAuditL[i, gAuditL.Cols["Severity"].Index].ToString();
 if (severity == "Information")
 {
   this.gAuditL.SetCellImage(i, 0,Image.FromFile(@".\\Resources\information.bmp"));
   this.gAuditL.SetData(i, 0, "Information");
 }
 if (severity == "Warning")
 {
   this.gAuditL.SetCellImage(i, 0, Image.FromFile(@".\\Resources\warning.bmp"));
   this.gAuditL.SetData(i, 0, "Warning");
 }
 if (severity == "Critical")
 {
   this.gAuditL.SetCellImage(i, 0, Image.FromFile(@".\\Resources\critical.bmp"));
   this.gAuditL.SetData(i, 0, "Critical");
 }
 if (severity == "Unspecified")
 {
   this.gAuditL.SetCellImage(i, 0, Image.FromFile(@".\\Resources\unspecified.bmp"));
   this.gAuditL.SetData(i, 0, "Unspecified");
 }

 this.gAuditL.Styles.Normal.ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.LeftCenter;
 this.gAuditL.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.RightCenter;
} 
4

1 に答える 1