Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1180
winGrid and ImageList
posted

I have a Wingrider and an imagelist. I would like to place an image in a cell depending on a criterion. See the code. But I can not, can someone help me;

Dim i as integer

Dim dt As New DataTable("dtTable")
dt.Columns.Add("Imagem")
dt.Columns.Add("Number")

For I=1 to 50

Dim row As DataRow = dt.NewRow()
if i Mod 2 = 0 then

row(0) = "Image from imageList"

else

row(0) = "Other Image from imageList"

end if
row(1) = i
dt.Rows.Add(row)

Next

appGrid.DataSource = dt

 

 

 

Parents
  • 12773
    posted

    Hello,

    I believe that if you are setting a image using a dataSource, what else you need to do is to set the style of the column in the grid to be Image.
      UltraGrid1.DisplayLayout.Bands(0).Columns(0).Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Image

    You can also set the type of the Colum in your datatable to be Image or bitmap;
       columnHeader.Columns.Add("Image", GetType(Bitmap))

    I am suggesting you to define strictly you’re the data type in your data source.

    I hope this helps.

    Sincerely,
    Dimi
    Developer Support Engineer
    Infragistics, Inc.

Reply Children
No Data