Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
programatically (code behind) Adding Child Field Layout for XamDataGrid
posted
Hi, my XamDataGrid Autogeneratecolumns =false, we use the xamdatagrid in a usercontrol with is customized to handle various flavours of of data, so all our fields are created not based on the data but based on columinfo sent from viewmodel, At present the parent fieldlayout is loaded with fields based on a list of columninfo received from viewmodel. Problem: now we have a heirarical display and i added a new fieldlayout in FieldLayoutInitialized event and loaded fields to it based on childcolumninfo from viewmodel. only the parent layout is getting displayed , the child layout is not getting displayed, Please Help. please refer the below code written in FieldLayoutInitialized eve FieldLayout childlayout = new FieldLayout(); childlayout.ParentFieldLayoutKey = "layout1"; foreach (var column in DataColumns.childcolumninfoCollection) { childlayout.Fields.Add(GetGeneratedField(column)); } datagrid.FieldLayouts.Add(childlayout);