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
315
AllowAddNew in hierarchical Grid
posted

I have a xamDataGrid that is bound to an IBindingList and is a hierarchy. I want to AllowAddNew on the child rows in the hierarchy but not on the parent rows.

My field layout settings look like this.

                   <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowAddNew="True" 
                                          AllowFieldMoving="WithinLogicalRow"
                                          SelectionTypeCell="Single" SelectionTypeField="None"
                                          SelectionTypeRecord="Single" AllowDelete="True">

My data grid looks like this

     <igDP:XamDataGrid.FieldLayouts>
                    <igDP:FieldLayout >
                        <igDP:Field Name="OpportunityServiceName" Label="Service">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings AllowEdit="False" />
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="AnnualGrossRevenueAmount" Label="Gross Revenue">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings EditAsType="{x:Type sys:Double}">
                                    <igDP:FieldSettings.EditorStyle>
                                        <Style TargetType="{x:Type igEditors:XamNumericEditor}" >
                                            <Setter Property="Mask" Value="{}{double:11.2}"/>
                                        </Style>
                                    </igDP:FieldSettings.EditorStyle>
                                </igDP:FieldSettings>
                            </igDP:Field.Settings>
                        </igDP:Field>
                        <igDP:Field Name="Lanes" Label="Lanes" />
                    </igDP:FieldLayout>
                    <igDP:FieldLayout  Key="Lanes">
                        <igDP:Field Name="Origin" Label="Origin" />
                        <igDP:Field Name="Destination" Label="Destination" />
                        <igDP:Field Name="LaneID" Visibility="Collapsed"  />
                    </igDP:FieldLayout>
   </igDP:XamDataGrid.FieldLayouts>

The result is my parent rows have an add new row, my child rows do not, which is the opposite of what I want.

Is there a way to apply the AllowAddNew to just child rows?