Hello NG,
VS 2003 / VB.NET / SQL-Server-Windows-App:
On a Windows-Form are some Textboxes and Combos and so on, and 2
Richttextboxes.
All these are bound to the Dataset:
Databinding.Add(new Binding("Text", ...)) or, if it is a Richtextbox:
...(new Binding("Rtf", ...)
Now, after the User has edited anything and leaves the Record, I want to ask
him "Do you want to save your changes?"
So, I check if myDataSet.HasChanges.
If it has no Changes, the record can be left immediately. If it has, the "Do
you want to..."-Message is popping up.
If the Richtextboxes-Binding is with the "Text"-Property, everything works
fine.
But if I use the "Rtf"-Property for the Binding, the Dataset tells me
always, HasChanges is True, even if it's not!
Since I need the formatting-possibilities and need to save it in the
database, how could I solve this issue?
Any ideas? I would be glad.
Thank you!
Liz
Andrew Smith \(Infragistics\) - 25 Jul 2004 16:18 GMT
That's because there is no RtfChanged event; the only way that the binding
class can know when the property has changed is if it finds an event that
matches the property name plus changed. If it doesn't find one, it will
always assume it to be dirty.
> Hello NG,
>
[quoted text clipped - 23 lines]
> Thank you!
> Liz
Liz Helmecke - 26 Jul 2004 09:16 GMT
Thank you, Andrew,
for this explanation!
Now I understand WHY it is this way.
Alright, so we have to use the Modified-Property of each control instead,
not the HasChanges-Property of the Dataset.
By the way, nice to get the explanation from an Infragistics-Man!
We are working with infragistics-Controls right now, and are pretty glad
with them most of the time, but often it is hard to understand how they
work.
Does Infragistics have an RTF-Control? We didn't find one.
Is there a Newsgroup like this one to place questions and answers about
Infragistics Controls / Netadvantage Suite?
Thank you
Liz
Andrew Smith \(Infragistics\) - 30 Jul 2004 16:43 GMT
Glad I could help explain the problem. No, Infragistics doesn't have an rtf
control.
With regards to infragistics newsgroups, yes, there are several depending
upon which control you are using. There's a list on the website:
http://devcenter.infragistics.com/DevCom/NewsGroups.Aspx
> Thank you, Andrew,
>
[quoted text clipped - 14 lines]
> Thank you
> Liz
Gilles E. - 30 Jul 2004 14:05 GMT
Hello,
Many thanks for this question and this good answer. I was searching for it
since a long time.
Would it be possible to create a class inherited from RichTextBox with a
RtfChanged event ? How would it be ?
Gilles
"Andrew Smith (Infragistics)" <productmanager@infragistics.com> schrieb im
Newsbeitrag news:uEockqlcEHA.2268@TK2MSFTNGP12.phx.gbl...
> That's because there is no RtfChanged event; the only way that the binding
> class can know when the property has changed is if it finds an event that
[quoted text clipped - 31 lines]
> > Thank you!
> > Liz
Andrew Smith \(Infragistics\) - 30 Jul 2004 16:46 GMT
The issue with this is knowing when to invoke the event. You may be able to
get away with deriving from the RichTextBox, adding an RtfChanged event,
then override OnTextChanged method and after/before calling the base
implementation, raise the RtfChanged event. That presupposes that a text
changed event will fire even if the rtf markup is changed (e.g. changing the
selection's font); if it doesn't you may need to override the WndProc (which
will mean this will require unmanaged code rights) and try using the various
richtext specific messages - e.g. EM_SETPARAFORMAT.
> Hello,
>
[quoted text clipped - 42 lines]
> > > Thank you!
> > > Liz