PC Review


Reply
Thread Tools Rate Thread

How to control format of data-bound textbox

 
 
Jeremy Bradshaw
Guest
Posts: n/a
 
      8th Aug 2003
I'm binding a TextBox control to a DateTime element of a DataSet :

EmployeeStartDate.DataBindings.Add("Text", currEmpSet, "EE.EE_SDATE");

This works fine, but whenever I input a date/time into the TextBox it is
always reformatted to a full date/time string. How do I specify a format
mask to give me more control over what is displayed (for example, I may want
date only with no time) ?
Any guidance gratefully received !


 
Reply With Quote
 
 
 
 
Stephen Muecke
Guest
Posts: n/a
 
      8th Aug 2003
Jeremy ,

You need to use the Parse and Format methods of the Binding Class
Search the Help files for Binding.Parse Event for an example

Stephen

"Jeremy Bradshaw" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm binding a TextBox control to a DateTime element of a DataSet :
>
> EmployeeStartDate.DataBindings.Add("Text", currEmpSet, "EE.EE_SDATE");
>
> This works fine, but whenever I input a date/time into the TextBox it is
> always reformatted to a full date/time string. How do I specify a format
> mask to give me more control over what is displayed (for example, I may

want
> date only with no time) ?
> Any guidance gratefully received !
>
>



 
Reply With Quote
 
Jeremy Bradshaw
Guest
Posts: n/a
 
      8th Aug 2003
Got it - thanks.

"Stephen Muecke" <(E-Mail Removed)> wrote in message
news:%23Pe%(E-Mail Removed)...
> Jeremy ,
>
> You need to use the Parse and Format methods of the Binding Class
> Search the Help files for Binding.Parse Event for an example
>
> Stephen
>
> "Jeremy Bradshaw" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I'm binding a TextBox control to a DateTime element of a DataSet :
> >
> > EmployeeStartDate.DataBindings.Add("Text", currEmpSet, "EE.EE_SDATE");
> >
> > This works fine, but whenever I input a date/time into the TextBox it is
> > always reformatted to a full date/time string. How do I specify a format
> > mask to give me more control over what is displayed (for example, I may

> want
> > date only with no time) ?
> > Any guidance gratefully received !
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
numeric field bound to a textbox control, wrong format Fanor Microsoft ADO .NET 3 30th Jun 2006 06:38 PM
Format bound data in a textbox Michael Kellogg Microsoft ADO .NET 1 20th Sep 2005 10:39 PM
Re: PropertyManager.EndCurrentEdit() marks the bound dataview row as Modified even if the data in the bound control is unchanged Miha Markic [MVP C#] Microsoft ADO .NET 0 5th Jun 2004 11:19 PM
Format data in bound textbox as date Graeme Richardson Microsoft ADO .NET 2 10th Dec 2003 08:34 PM
Need to format data in bound textbox Microsoft VB .NET 2 4th Dec 2003 05:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:19 PM.