Beispiel #1
0
		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;
				}
			}
		}
Beispiel #2
0
        public static string GetRow(int position, string fieldName, string caption, int width, Types.Aligment aligment)
        {
            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() }));
        }