Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding to textbox
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00665400
Message ID:
00666105
Vues:
26
Thanks for the input. In the end I found an example at www.gotnet.com. used it and it worked fine.

I created a method in my dataclass

public void textBox_FormatDate(object sender, ConvertEventArgs e)
{
if (e.DesiredType != typeof(string)) return ;
if (e.Value.GetType() != typeof(DateTime)) return;
DateTime dt = (DateTime)e.Value;
e.Value = dt.ToShortDateString();
}

then I call it after I get my data and simply run this conversion. Everything works great.

//set bindings and format for date field
Binding rqdtBinding = new Binding("text",ds2,"soheader.need_date");
rqdtBinding.Format += new ConvertEventHandler(testAdo.textBox_FormatDate);
txtdatereq.DataBindings.Add(rqdtBinding);

thanks again

Alan Wyne
IS Manager
Rollpak Corp
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform