Exemple #1
0
            private static string GetValue(Type cellType, int rowIndex, int columnIndex)
            {
                string value;

                if (NumericTypes.IsNumeric(cellType))
                {
                    value = ((9 * rowIndex) + columnIndex).ToString();
                }
                else if (cellType.Name == "String")
                {
                    value = string.Format("This is a string at {0},{1}.", rowIndex, columnIndex);
                }
                else if (cellType.Name == "DateTime")
                {
                    DateTime temp = new DateTime(2000, 1, 1);
                    temp  = temp.AddDays(rowIndex);
                    temp  = temp.AddMonths(columnIndex);
                    value = temp.ToShortDateString();
                }
                else
                {
                    value = string.Format("Unknown type {0}", cellType.Name);
                }
                return(value);
            }