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
143
Get rid of dynamicly added columns via propertydescriptors
posted

Hi,

I have an Master-detail application where domainobjects are databinded with two ultrawingrids via a System.Windows.Forms.BindingSource.
The Detailgrid columns are decided at runtime and added dynamicly by overriding the GetItemProperties method in the bindingsource.

The problem is when MasterItems contains DetailItems with the same columnnames. It seems like the grid or bindingsource remember the previous dynamicly added columns and try to merge them with the new ones.

I tried to both use bindingsource.ResetBindings(True) and bind to a new bindingsource without any result so the problem seems to be with the grid.

I think i tried most reset methods I found in the grid with no result and it is not possible to remove my dynamicly added columns from the grid because it says they are databounded.

Any Ideas? 

TIA
/S

  • 48586
    posted

    Hi,

     

    I just wanted to know if you were able to solve your issue based on our suggestions or you still need help?

    Just let me know.

    Thank you.

     

  • 469350
    Offline posted

    Just to clarify, it sounds like you are removing a column from your data source and then re-adding a new column with the same name as the old one. Is that right?

    The grid is probably doing some caching there, so you may have to set the grid's DataSource to null temporarily to clear that out.

    If that doesn't help, then we would probably need to see a small sample project demonstrating this behavior so we can check it out.

  • 48586
    posted

    Hello,

     

    Our UltraGrid represents that data as you pass it to its DataSource property, so if you are merging dynamically your data into your Binding source the UltraGrid will just visualize it. Since I am not entirely sure what merging you are referring exactly I could not determine the reason of it. IF you mean that the cells with the same values are merged together you probably could take a look at the following properties and verify if they have been set in your project:

     

     

    UltraGrid.DisplayLayout.Bands[0].Override.MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;

     

    UltraGrid.DisplayLayout.Bands[0].Columns[0].MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle.Always;

     

     

    Please let me know if you have any further questions or I am missing something.