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
1284
Loading Layout XML in form load
posted

Hi

   I am working on a .NET 2.0 project using UltrawinGrid.

I am saving the Layout XML and Loading the XML when the form is  loaded again.

How to find  whether the grid is populated  for the First time or the data is reloaded ?

I am binding the Layout XML in form load and if the datasource is nothing, Layout is not applied even if i load the data in button click.

I want to bind the Layout XML only when i bind the data in the grid for the first time.

Thanks

Ashok

 

 

Parents
No Data
Reply
  • 45049
    posted

    Loading the layout when the data source is null will result in the grid discarding most of the layout, since no bands or columns exist in the data source.  Only properties on the DisplayLayout (including DisplayLayout.Override) will be kept - any column-specific or band-specific data will be lost.  Instead, set your data source first, then load the layout.

    Are you assigning your grid's data source in Form_Load?  If so, that provides an ideal way to ensure it happens when the form is loaded.

    Otherwise, add a boolean property to your form, and initialize it to false.  After you set the grid's data source, check the flag - if it's false, load the layout and set the flag to true.  The next time you hit where you're setting your data source, the flag will already be true, and so you'll know not to load the layout.

Children
No Data