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
710
Importing Excel to UltrawinGrid with picture ...
posted

Hi Folks,

is it possible to get the embeddid pics out of excel into a grid somewhat other like this ...

int cc = -1;
                //  column name
                ArrayList cellList = new ArrayList();
                for (int iRow = 1; (iRow <= 65535); iRow++)
                 { 
                    cc = iRow -1;
                    foreach (WorksheetCell cell in w.Rows[iRow].Cells)
                    {
                        if ((!(cell.Value == null)
                                    && (cell.Value.ToString().Length > 0)))
                        {
                            cellList.Add(cell.Value.ToString());
                        }
                        else
                        {
                            if (cc > -1
                                && ((Infragistics.Excel.WorksheetImage)(cell.Worksheet.Shapes[cc])).Image != null)
                            {
                                cellList.Add(((Infragistics.Excel.WorksheetImage)(cell.Worksheet.Shapes[cc])).Image);
                            }
                         
                            cc = -1;
                        }
                    }
                    //  cell
                    if ((cellList.Count > 0))
                    {
                        table.Rows.Add(cellList.ToArray());
                        cellList.Clear();
                    }
                    else
                    {
                        iRow = 65535;
                    }

 

 

And show it in the Grid as picture - at the Moment it's a System.Drawing.Bitmap

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    If the grid cell contains a Bitmap and the DataType of the Column is Bitmap, then it should display automatically. If the DataType of the column is not Bitmap, then you need to set the Style of the Column to Image.

Children