Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding to textbox
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00665400
Message ID:
00666105
Views:
27
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
Previous
Reply
Map
View

Click here to load this message in the networking platform