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
330
Image does not show up on the Grid
posted

Hello all,

I am trying to bind an UnBound column of type Checkbox which is displayed as an IMAGE. However, after binding, i cannot view the image. The column appears as white empty cell. However, the column works properly as a checkbox when i click on that empty cell. Here is the code that i wrote that adds the unbound column.

 

//--------------------------------------------------------
//ADD DELETE Column in the beginning.
//--------------------------------------------------------
if (!ugProcedures.DisplayLayout.Bands[0].Columns.Exists("Delete"))
{
                   ugProcedures.DisplayLayout.Bands[0].Columns.Insert(0, "Delete");

                  ugProcedures.DisplayLayout.Bands[0].Columns[0].Style =                      Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].DataType = System.Type.GetType("System.Byte[]"); // true.GetType();
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Header.Caption = "Delete";
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Header.VisiblePosition = 0;


                    Infragistics.Win.EmbeddableImageRenderer imgEditor = new Infragistics.Win.EmbeddableImageRenderer();
                    Bitmap bmpCellImage = Properties.Resources.deleteButton;
                    imgEditor.DefaultImage = bmpCellImage;
                    imgEditor.ScaleImage = Infragistics.Win.ScaleImage.Never;

                    //imgEditor.ScaleImage = Infragistics.Win.ScaleImage.Always;
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Editor = imgEditor;
                }
                else
                {
                    if (ugProcedures.DisplayLayout.Bands[0].Columns["Delete"].Header.VisiblePosition != 0)
                    {
                        ugProcedures.DisplayLayout.Bands[0].Columns["Delete"].Header.VisiblePosition = 0;
                    }
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;
                    //ugProcedures.DisplayLayout.Bands[0].Columns[0].DataType = true.GetType();
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Header.Caption = "Delete";
                    ugProcedures.DisplayLayout.Bands[0].Columns[0].Hidden = false;

                }

 

Thanks in Advance.

Scott.