Last active
August 29, 2015 14:24
-
-
Save shou1sannomiya/c9f51f00b4a6e536b2ff to your computer and use it in GitHub Desktop.
ロードオンデマンドでの伝票一覧GridColumnLayoutModelのセット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...割愛... | |
//GridModelParam.Child には事前に子階層の生成に必要な情報をセットしている前提です。 | |
GridColumnLayoutModel gridColumnLayoutModel = GetChildModel(GridModelParam.Child, "Child1"); | |
//GridColumnLayoutModelを ColumnLayoutsに追加 | |
ColumnLayouts.Add(gridColumnLayoutModel); | |
...割愛... | |
//--------------------------------------------------------------------------- | |
//子階層のセット | |
public GridColumnLayoutModel GetChildModel(GridModelChildParam gm,string key) | |
{ | |
GridColumnLayoutModel cm = new GridColumnLayoutModel(); | |
cm.Key = key; //ここにセットした値はデータ取得時のlayoutにセットされます | |
cm.PrimaryKey = gm.PrimaryKey; //子階層のPrimaryKey | |
cm.ForeignKey = gm.ForeignKey; //親階層のPrimaryKeyとJoinする子階層のカラム名 | |
cm.DataSourceUrl = gm.DataSourceUrl;//子階層のデータ取得URL | |
cm.Height = gm.Height; | |
cm.Width = gm.Width; | |
cm.AutoGenerateColumns = false; | |
cm.AutoGenerateLayouts = false; | |
cm.LoadOnDemand = true; | |
// Columns List<GridColumn>の転送 | |
foreach (GridColumn para in gm.Columns) | |
{ | |
GridColumn clm = new GridColumn(); | |
clm.DataType = para.DataType; | |
clm.Format = para.Format; | |
clm.HeaderText = para.HeaderText; | |
clm.Hidden = para.Hidden; | |
clm.Key = para.Key; | |
clm.Template = para.Template; | |
clm.Width = para.Width; | |
cm.Columns.Add(clm); | |
} | |
//Features | |
foreach (var para in gm.Features) | |
{ | |
cm.Features.Add(para); | |
} | |
return cm; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment