public static string GetRow(int position, string fieldName, string caption, int width, Types.Aligment aligment, Types.FormatDisplay format) { return(GetRow(position, fieldName, caption, width, aligment, format, null)); }
public static string GetRow(int position, string fieldName, string caption, int width, Types.Aligment aligment, Types.FormatDisplay format) { switch (format) { case Types.FormatDisplay.Money: { 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> </CellStyle><FormatString>c</FormatString></Column{0}>" , new object[] { position, fieldName, caption, width, aligment.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> </CellStyle><FormatString>p</FormatString></Column{0}>" , new object[] { position, fieldName, caption, width, aligment.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> </CellStyle><FormatString>0</FormatString></Column{0}>" , new object[] { position, fieldName, caption, width, aligment.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> </CellStyle></Column{0}>" , new object[] { position, fieldName, caption, width, aligment.ToString() })); break; } } }
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; }