/// <summary> /// 加入欄位 /// </summary> /// <param name="_TitleName">欄位的字</param> /// <param name="_SourceName">SQL的資料行</param> /// <param name="_Align">LEFT, CENTER, RIGHT</param> /// <param name="_Width">寬度 ex:20%, 100px, 不指定長度請給""</param> /// <param name="_FormulaDefine"> /// 格式:被取代的值1::取代成1^^被取代的值2::取代成2 ex: 0::XX^^1::YY, 當值為0時取代成XX, 當值為1時取代成YY /// <param name="_TypeButton"> /// 格式:"Button^^DoShowOtherPush /// </param> public void AddCol(string _TitleName, string _SourceName, string _Align, string _Width, string _FormulaDefine, string _TypeButton) { Collumn_Button my_Collumn = new Collumn_Button(); my_Collumn.TitleName = _TitleName.Trim(); my_Collumn.SourceName = _SourceName.Trim(); my_Collumn.Align = _Align.Trim(); my_Collumn.Width = _Width.Trim(); if (!string.IsNullOrEmpty(_FormulaDefine)) { string[] arrFormulaDefine = _FormulaDefine.Split(new string[] { "^^" }, StringSplitOptions.RemoveEmptyEntries); string[,] tmp = new string[arrFormulaDefine.Length, 2]; for (int i = 0; i < arrFormulaDefine.Length; i++) { tmp[i, 0] = arrFormulaDefine[i].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[0]; tmp[i, 1] = arrFormulaDefine[i].Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries)[1]; } my_Collumn.FormulaDefine = tmp; } if (!string.IsNullOrEmpty(_TypeButton)) { string[] arrTypeButton = _TypeButton.Split(new string[] { "^^" }, StringSplitOptions.RemoveEmptyEntries); my_Collumn.TypeButton = arrTypeButton; } ListViewCollumns.Add(my_Collumn); }
/// <summary> /// 加入欄位 /// </summary> /// <param name="_TitleName">欄位的字</param> /// <param name="_SourceName">SQL的資料行</param> /// <param name="_Align">LEFT, CENTER, RIGHT</param> /// <param name="_Width">寬度 ex:20%, 100px, 不指定長度請給""</param> public void AddCol(string _TitleName, string _SourceName, string _Align, string _Width) { Collumn_Button my_Collumn = new Collumn_Button(); my_Collumn.TitleName = _TitleName.Trim(); my_Collumn.SourceName = _SourceName.Trim(); my_Collumn.Align = _Align.Trim(); my_Collumn.Width = _Width.Trim(); ListViewCollumns.Add(my_Collumn); }