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
290
RowEditTemplate lost on Wingrid.hide or when disabled
posted

Hi, 

I have a ultraGridRowEditTemplate that is assigned to a wingrid band

e.g. ultraGridBand5.RowEditTemplate = this.ultraGridRowEditTemplate1;


However, once I hide or disable the wingrid and rebind it again via a ultracombo, I have lost the RowEditTemplate from the grid. Of course, exiting and then reloading the form will sort this (by firing the InitializeComponent() method), but I really don't want to have to do this.

Is there anyway to assign the ultraGridRowEditTemplate back to the wingrid when the wingrid is shown again?

Thanks

Chris 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    There's no reason why hiding or disabling the grid should have any effect on the RowEditTemplate. I am assuming that you mean that you are hiding then showing the grid again. Obviously, the grid will never show the RowEditTemplate while the grid is disabled or invisible.

    Setting the grid's DataSource will lose your entire layout, including the RowEditTemplate. The band will be destroyed and a new band created. So this is why it's a good idea to set the RowEditTemplate inside the InitializeLayout event so that it will get re-applied.

    I'm not really sure what you are asking, though. Your question appears to be: how do you assign the RowEditTemplate back to the grid. But you already know how to do that - you posted the code right here. You set the RowEditTemplate propererty on the band.

    grid.DisplayLayout.Bands[myBand].RowEditTemplate = this.ultraGridRowEditTemplate1;

Children