Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Window Forms databinding: BindingManagerBase

Options
  • 18-11-2004 5:24pm
    #1
    Registered Users Posts: 7,468 ✭✭✭


    Ok, weird problem. We're binding datagrids (Janus if you want to know). The last line in the grid is always blank and when a user scrolls into that line we suspend databinding. Now if the user scrolls up out of this blank line into the last populated Lineitem, this corresponds to the last row in the datatable, we resume databinding. When we resume databinding the CurrencyManager resets its position to 0, but it only does this for the last Lineitem in the grid, if we scroll up again CurrencyManager realigns itself with the datatable. To code around this takes a two line fix so its not a huge problem I'm just wondering if anybody has seen this before and how they dealt with it.


Comments

  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    I think its a bug in the Janus grid, Phil. I ran into exactly the same problem myself the other day, from a slightly different direction.

    I had an IList databound to the grid, and in order to delete from that, I had to delete from the datasource "manually" and then rebind (or refresh). However...if I deleted the last item in the collection, and rebound the grid threw the exact same CurrencyManager error. I also discovered that its nto something you can try/catch your way around....which means its almost definitely something in the grid (or one of the grid's internal components) actually throwing up a MessageBox in response to an error.

    Interestingly, if I have an IList with only one item, and delete that, leaving the grid with 0 rows, the problem doesn't manifest itself.

    Anyway, I got around it by simply setting .Row = 0 before I rebound the data. My users specifically don't want either of the items above/below the deleted one "default selected" on error, so everyone was happy :)

    jc


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Yeah, thats kind of like the work around we're using. I've posted the same on Janus' forums. I'll see what they come back with.


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    I'm no longer convinced its just Janus :(

    Whilst debugging an app yesterday, I started hitting *massive* weirdnesses when dealing with the last item on a ListBox, bound to an IList of strings.....all of a similar nature.

    I knew that DataBinding was the work of the devil. Damn you for making me tempted enough to try it again, Evil Phil. Damn your evilness, and damn Microsoft too for making their development tools and languages progressively worse in the name of progress.

    ;)

    jc


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Mwah ha ha haa!


  • Registered Users Posts: 2,758 ✭✭✭Peace


    We bought the Janus Winforms controls th other day here in work. I'll be using them soon hopefully.

    Do you guys have an tips or things to avoid... They look nice on the surface.. then again so did .Net 1.0!


  • Advertisement
  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I like working with them but there's a lack of documentation. They have really cool looking developer forums at http://www.janusys.com/ and there's a quick turn around from the support guys. Usually same day.


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Wot Phil said.

    Its good, but the forums on their site are really the only useful "documentation" there is.

    jx


  • Registered Users Posts: 2,758 ✭✭✭Peace


    I noticed that... other than the stuff that gets installed to my start -> programs there doesn't seems to be much.

    It'll be a learning curve... as always.


Advertisement