public static string GetRow( int position, string fieldName, string caption, int width, Types.Aligment aligment,Types.FormatDisplay format ,Types.EditType et) { switch (format) { case Types.FormatDisplay.LongMoney : { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><EditType>{5}</EditType><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><CellStyle> <TextAlignment>{4}</TextAlignment> </CellStyle><FormatString>c</FormatString></Column{0}>",new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } case Types.FormatDisplay.Money : { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><EditType>{5}</EditType><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><CellStyle> <TextAlignment>{4}</TextAlignment> </CellStyle><FormatString>0.00</FormatString></Column{0}>",new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } case Types.FormatDisplay.Percent: { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><CellStyle> <TextAlignment>{4}</TextAlignment><EditType>{5}</EditType> </CellStyle><FormatString>p</FormatString></Column{0}>",new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } case Types.FormatDisplay.Integer: { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position> <CellStyle> <TextAlignment>{4}</TextAlignment><EditType>{5}</EditType></CellStyle><FormatString>0</FormatString></Column{0}>",new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } case Types.FormatDisplay.DateTime: { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><TextAlignment>{4}</TextAlignment><EditType>{5}</EditType><FormatString>d</FormatString></Column{0}>", new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } case Types.FormatDisplay.DateTimeShort: { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><TextAlignment>{4}</TextAlignment><EditType>{5}</EditType><FormatString>dd/MM/yyyy</FormatString></Column{0}>", new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } default : { return string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><CellStyle> <TextAlignment>{4}</TextAlignment><EditType>{5}</EditType> </CellStyle></Column{0}>",new object[] {position, fieldName, caption, width,aligment.ToString(),et.ToString()}); break; } } }
public static string GetRow(int position, string fieldName, string caption, int width, Types.ColumnTypes ct, Types.EditType et) { return(string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><ColumnType>{4}</ColumnType><EditType>{5}</EditType><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position></Column{0}>", new object[] { position, fieldName, caption, width, ct.ToString(), et.ToString() })); }
public static string GetRowWordWrap(int position, string fieldName, string caption, int width, int lines, Types.EditType et) { return(string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><DataMember>{1}</DataMember><Key>{1}</Key><Position>{0}</Position><Width>{3}</Width><EditType>{5}</EditType><MaxLines>{4}</MaxLines><WordWrap>True</WordWrap><Visible>True</Visible></Column{0}>", position, fieldName, caption, width, lines, et.ToString())); }
public static string GetRow( int position, string fieldName, string caption, int width, bool hidden, Types.ColumnTypes ct, Types.EditType et, Types.Aligment aligment,Types.FormatDisplay format) { string cadena = ""; cadena = string.Format(@"<Column{0} ID=""{1}""><Caption>{2}</Caption><EditType>{4}</EditType><ColumnType>{5}</ColumnType><DataMember>{1}</DataMember><Key>{1}</Key><Width>{3}</Width><Position>{0}</Position><Visible>{6}</Visible></Column{0}>",new object[] {position, fieldName, caption, width,ct.ToString(),et.ToString(),!hidden}); cadena = cadena + string.Format("<TextAlignment>{0}</TextAlignment>", aligment); return cadena; }