Results 1 to 6 of 6

Thread: Validating event firing three times for MSFlexGrid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Validating event firing three times for MSFlexGrid

    Hi
    We have application developed in VB.NET that uses msflexgrid. We have text box validating event in which data is validated, if not valid CancelEventArgs is set to true . For control combo,button etc it is worked properly,but when msflexgrid is focused textbox validating event is firing three times if CancelEventArgs is set to true . What is the reason for this?How to avoid this?

    thank you

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Validating event firing three times for MSFlexGrid

    My first piece of advice would be to not use old VB6 controls in VB.NET. Is there a specific reason that you can't use a DataGridView? Maybe there is but then again I've seen lots of people do similar things without good reason.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Validating event firing three times for MSFlexGrid

    Quote Originally Posted by jmcilhinney View Post
    My first piece of advice would be to not use old VB6 controls in VB.NET. Is there a specific reason that you can't use a DataGridView? Maybe there is but then again I've seen lots of people do similar things without good reason.
    we are still using msflexgrid because its faster than DataGridView. We tested it by loading much data.

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Validating event firing three times for MSFlexGrid

    we are still using msflexgrid because its faster than DataGridView. We tested it by loading much data.
    I very much doubt that that's true. Using VB6 methods on a VB6 control is probably faster than using VB6 methods on a DGV certainly. But I'd be prepared to bet that used properly the DGV would knock spots off the older control.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Posts
    248

    Re: Validating event firing three times for MSFlexGrid

    Thanks for reply
    We will think about using DGV. But for now anyone know why validating event firing 3 times and how to avoid?

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Validating event firing three times for MSFlexGrid

    We've kinda covered that don't you think? It's an outdated control not correctly programmed for a modern environment so it's going to be unpredicatable in execution. If you want to continue using it you'll have to account for the multi-firing with some kind of flag system. It's extremely unlikely that there's a fix.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width