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
655
Enable or disable the field layouts for the child layouts in Parent - to - child relationship
posted

HI All,

I have question

For  Example

if i have 4 tables A,B,C,D

A is the parent to B.

C and D are the childs of B

how can i enable or disable the the fields layouts for the C and D depending on the count of the data or using the some field values of the data in the XamDatagrid (Parent to child relationship)?

Thanks

Prakash

Parents
No Data
Reply
  • 69686
    posted

    Hello Prakash,

    First thing that comes up in my mind is to handle the RecordExpanding event and check the fieldlayout and other conditions that you might have and cancel it if needed.

    The other thing is control the ExpansionIndicatorDisplayMode of the fieldlayout in the FieldLayoutInitializing event:

    For example:

    void xamDataGrid1_FieldLayoutInitializing(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializingEventArgs e)

            {

                if (xamDataGrid1.FieldLayouts.Count > 1)

                    e.FieldLayout.Settings.ExpansionIndicatorDisplayMode = ExpansionIndicatorDisplayMode.Never;

            }

    Hope this helps.

Children
  • 655
    posted in reply to John Doe

    Hi Alex,

    what you said was right but for my scenario

    i dont understand how it works.

    i have attached an image of my grid.

    My Scenario is Table B has 5 Child Tables and

    in the xaml i have made those 5 tables as fields in my table B Fieldlayout.

    Even though if for a B record there no  related record with all child tables it shows the expander for all the 5 child tables.

    I wanted to disable the field loyouts or the expander for the child table layout which does not contain data each time.

    I think if you see the image you could understand the scenario.

    Thanks

    Prakash