DataRepeater DataBinding issue

0
0

Hi!

I’m struggeling with a unwanted “feature” where PictureBoxes dissapear when using my application. There are 5 PictureBoxes with their visible property bound to a boolean value in the dataset.

The DataRepeaters are on a TabControl and this seems to happen when I change the active tab and stay on the other page a while. After disposing/closing the other tab and return to the first with the DataRepeater the pictureboxes are gone. If I scroll trough the DataSet tho, some rows will show the PictureBoxes (I think after the prefetch count, I dont know).

Using version 2.5.35

Attached two screenshots on with the pictureboxes and one without (the bug)

This is the code I use for the DataBinding

PictureBox_Gevaar.DataBindings.Add(New Wisej.Web.Binding(“Visible”, dataSet.Tables(0), “IsGevaarlijkeEnergie”, True))
PictureBox_Mobiele.DataBindings.Add(New Wisej.Web.Binding(“Visible”, dataSet.Tables(0), “IsMobieleApparatuur”, True))
PictureBox_Geheven.DataBindings.Add(New Wisej.Web.Binding(“Visible”, dataSet.Tables(0), “IsGehevenLasten”, True))
PictureBox_CSE.DataBindings.Add(New Wisej.Web.Binding(“Visible”, dataSet.Tables(0), “IsCSE”, True))
PictureBox_HW.DataBindings.Add(New Wisej.Web.Binding(“Visible”, dataSet.Tables(0), “IsHW”, True))

 

Thanks

Vincent

Attachment
  • You must to post comments
0
0

Hi Vincent,

So the issue is that you’re binding the visible property using bidirectional binding, so when the tab hides the bound controls the changing of the visibility property updates the DataSource, and actually that’s correct.

So what you’ll need to do is to use monodirectional binding like this :
PictureBox_HW.DataBindings.Add(New Wisej.Web.Binding("Visible", DS, "IsHW", True, DataSourceUpdateMode.Never))

But we found a bug related to that and it should be fixed in the next build.

Fortunately, there’s a couple of workarounds for it, what you can do is :

  • Derive the PictureBox and Label and add a VisibleBindable property that doesn’t have a VisibleBindableChanged event
  • Override OnVisibleChanged and don’t fire the event

I have modified your sample slightly just to showcase the temporary fix.

HTH,
Alaa

  • vincent_
    Thanks, makes sence it’s state updates the dataset when a tab is no longer visible. Thanks for the suggested fix, I will give this a go. Glad you found a bug to fix in the process hah.
  • You must to post comments
0
0

Hi, I’ve added a sample project.

Steps to reproduce the issue:

  1. Run the application
  2. Make the browser full screen/maximized
  3. Notice all the icons are showing
  4. navigate to tab page 2 or 3
  5. Click the maximize window button of the browser again to restore it to it’s previous size
  6. Open Tab 1 again. Notice how icons have dissapeared.

 

  • You must to post comments
0
0

Hi Vincent,

Can you please check if you have any errors in your browser’s console ?

Also, it would be better if you can put together a small sample for us to try and reproduce.

Best,

Alaa

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.