Esempio n. 1
0
        public String GetHeader()
        {
            StringBuilder header            = new StringBuilder();
            int           lastVisibleColumn = -1;

            foreach (Object col in columns)
            {
                C1FlexGridRowColumnWrapper colWrapper = new C1FlexGridRowColumnWrapper(col);
                if (colWrapper.GetVisible())
                {
                    lastVisibleColumn = colWrapper.GetIndex();
                }
            }
            foreach (Object column in columns)
            {
                C1FlexGridRowColumnWrapper colWrapper = new C1FlexGridRowColumnWrapper(column);
                if (colWrapper.GetVisible())
                {
                    header.Append(colWrapper.GetCaption().Replace("\r", "").Replace("\n", "").Replace("\t", ""));
                    if (colWrapper.GetIndex() < lastVisibleColumn)
                    {
                        header.Append(";");
                    }
                }
            }
            return(header.ToString());
        }
Esempio n. 2
0
        public String GetContent()
        {
            StringBuilder content = new StringBuilder();
            int           lastVisibleRow = -1, lastVisibleColumn = -1;

            foreach (Object row in rows)
            {
                C1FlexGridRowColumnWrapper rowWrapper = new C1FlexGridRowColumnWrapper(row);
                if (rowWrapper.GetVisible())
                {
                    lastVisibleRow = rowWrapper.GetIndex();
                }

                if ((flexGrid.Name.ToLower().Equals("splitgrid")) && (lastVisibleRow == 0))
                {
                    lastVisibleRow = 1;
                }
            }
            foreach (Object col in columns)
            {
                C1FlexGridRowColumnWrapper colWrapper = new C1FlexGridRowColumnWrapper(col);
                if (colWrapper.GetVisible())
                {
                    lastVisibleColumn = colWrapper.GetIndex();
                }
            }
            if (lastVisibleRow >= 1 && lastVisibleColumn >= 0)  // We can build the Content
            {
                int currRow = 1;
                if (flexGrid.Name.ToLower().Equals("splitgrid"))
                {
                    currRow = 0;
                }
                for (; currRow < rowCount; currRow++)
                {
                    C1FlexGridRowColumnWrapper rowWrapper = new C1FlexGridRowColumnWrapper(GetRow(currRow));
                    if (rowWrapper.GetVisible())
                    {
                        for (int currCol = 0; currCol < columnCount; currCol++)
                        {
                            C1FlexGridRowColumnWrapper colWrapper = new C1FlexGridRowColumnWrapper(GetColumn(currCol));
                            if (colWrapper.GetVisible())
                            {
                                content.Append(GetCellContent(currRow, currCol));
                                if (currCol < lastVisibleColumn)
                                {
                                    content.Append(";");
                                }
                            }
                        }
                        if (currRow < lastVisibleRow)
                        {
                            content.Append("\n");
                        }
                    }
                }
            }
            return(content.ToString());
        }
Esempio n. 3
0
 public String GetHierarchieColValue(int row)
 {
     foreach (Object o in columns)
     {
         if (ReflectionHelper.ReflectionHelper.GetProperty(o, "Name").ToString() == "colHierarchie")
         {
             C1FlexGridRowColumnWrapper columnWrapper = new C1FlexGridRowColumnWrapper(o);
             return(GetCellContent(row, columnWrapper.GetIndex()));
         }
     }
     return(null);
 }
Esempio n. 4
0
        public int GetRealColIndex(int visibleIndex)
        {
            int currVisibleIndex = 0;

            foreach (var col in columns)
            {
                C1FlexGridRowColumnWrapper columnWrapper = new C1FlexGridRowColumnWrapper(col);
                if (columnWrapper.GetVisible())
                {
                    if (currVisibleIndex++ == visibleIndex)
                    {
                        return(columnWrapper.GetIndex());
                    }
                }
            }
            return(-1);
        }
Esempio n. 5
0
        public int GetRealRowIndex(int visibleIndex)
        {
            int currVisibleIndex = 0;

            foreach (var row in rows)
            {
                C1FlexGridRowColumnWrapper rowWrapper = new C1FlexGridRowColumnWrapper(row);
                if (rowWrapper.GetIndex() >= 0 && rowWrapper.GetVisible())
                {
                    if (currVisibleIndex++ == visibleIndex)
                    {
                        return(rowWrapper.GetIndex());
                    }
                }
            }
            return(-1);
        }