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
910
DataGrid creates a FieldLayout and then creates a second when changing the DataSource
posted

Im seeing some weird behavior in the Grid.  Not sure if its normal or not.

I have XamDataGrid that has a DataTable bound to the DataSource property.  When this happens the first time, it fires off the FieldLayoutInitialized event.  When I swap the DataTable out to a different DataTable ( Identical Schema, just new data ) .. Sometimes it fires the FieldLayoutInitialized event again for a second time.  It never fires it more than once.  However my problem is, If the user stretches a column out before the second time the event is fired, that stretched column is not carried over to the new Fieldlayout.

 So, is there something Im missing..  Why does the grid randomly generate 2 FieldLayouts forcing it to fire the FieldLayoutInitialized Event twice.

The user has 2 ways of updating the DataTable, one is clicking a next button to get the next record in a list to populate the DataTable with.  The other option the user has is to click the row in the list directly.  Ive narrowed it down to that if the user does these two actions each one will create a seperate Fieldlayout, however I dont understand why ?  

 Is there something I can do to prevent it from creating the second field layout ?

Thanks

Allen 

  • 8576
    Offline posted

    Hi Allen -

    I can't seem to duplicate this here.  If you provide a simple (but complete) Visual Studio project that demonstrates the problem we'll take a look.

    Joe