G
Guest
Hi all,
I need to format screen output for a textbox that's bound
to a datasource. I know how to format the data in a
plain old string, but in this case I'm not sure where
to "sneak" in there to do the formatting.
For example, textbox txtAcctBalance is bound to a
currency field in my dataset, and when the value shows up
on the screen I want it formatted as currency ("C").
I've tried doing this on the TextChanged event of the
textbox, which has potential, but one problem is that as
soon as I reformat the text it fires the TextChanged
event again. I guess I can turn off the handler
temporarily, but all this seems way harder than it should
be.
Any ideas?
Thanks,
BB
P.S. I can do this on a bound datagrid, because there's
a "format" specifier on the grid column. I just can't
find the same thing for the stand-alone textbox.
I need to format screen output for a textbox that's bound
to a datasource. I know how to format the data in a
plain old string, but in this case I'm not sure where
to "sneak" in there to do the formatting.
For example, textbox txtAcctBalance is bound to a
currency field in my dataset, and when the value shows up
on the screen I want it formatted as currency ("C").
I've tried doing this on the TextChanged event of the
textbox, which has potential, but one problem is that as
soon as I reformat the text it fires the TextChanged
event again. I guess I can turn off the handler
temporarily, but all this seems way harder than it should
be.
Any ideas?
Thanks,
BB
P.S. I can do this on a bound datagrid, because there's
a "format" specifier on the grid column. I just can't
find the same thing for the stand-alone textbox.