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
650
How to display an Image in a Cell
posted

How do I display an image in a cell?

I have done this previously but its not working in 2009.1 Grid.

I have tried the Image and ImageBackground but neither appear. The image I am setting it to does exist and contain data.

Here is the code:

 

private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
        {

            try
            {

        
                e.Row.Cells["STOCK_IMAGE"].Appearance.ImageBackground = Image.FromFile("C:\\jon2.jpg");
                e.Row.Cells["STOCK_IMAGE"].Appearance.ImageBackgroundStyle = Infragistics.Win.ImageBackgroundStyle.Centered;
                e.Row.Cells["STOCK_IMAGE"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Image;
            }
            catch
            {


            }


        }