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
1090
Seeing Columns At Design Time
posted

Hey,

 I'm new to WPF so I'm probably doing something completely wrong here:

I have a Person class.  I want to bind a list of these to the grid.  This list will be fetched sometime after the form is loaded, based on criteria from the user.  I want to be able to see the columns at design time.

This is what I tried: I put a PersonCollection property in my Window code behind, in my XAML I added DataContext="{Binding RelativeSource={RelativeSource Self}}" in the Window tag to set the window as its own data context, then I added DataSource="{Binding RatingAgencyModelList}"  in the grid tag to set the property as the data source of the grid.  At run time the data is loaded as expected.  However, at design time I don't see any columns.  Am I doing something wrong?

Thanks

  • 138253
    Offline posted

    Hello jlotridge,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

  • 138253
    Offline posted

    Hello jlotridge,

    Thank you for your post. I have researched your scenario and, as I see, you bind your XamDataGrid to a property of your Window, which has the same type as the object you want to bind to at run-time, but I assume you do not initialize this property and it is null at the time you bind the DataSource to it, so I suggest you initialize it in the constructor of your Window. This is so because the FieldLayout needs to mapped to data source in order to be used in XamDataGrid.

    Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.

    Feel free to write me if you need further assistance.