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
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.
Re: Validating event firing three times for MSFlexGrid
Quote:
Originally Posted by
jmcilhinney
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.
Re: Validating event firing three times for MSFlexGrid
Quote:
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.
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?
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.