473,465 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dropdownlist formatting

hey all,
i'm binding a date field from sql to my dropdownlist and it's showing the
time. is there a way to format that in visual studio?]

thanks,
rodchar
Jun 27 '08 #1
2 2251
On Jun 9, 8:36*pm, rodchar <rodc...@discussions.microsoft.comwrote:
hey all,
i'm binding a date field from sql to my dropdownlist and it's showing the
time. is there a way to format that in visual studio?]

thanks,
rodchar
Hi rodchar,

use DataTextFormatString property:
http://msdn.microsoft.com/en-us/libr...matstring.aspx

For example,

dropdownlist1.DataTextFormatString ="{0:dd/MM/yyyy}"

Hope this helps
Jun 27 '08 #2
thank you for catching that, i glanced too fast,
rod.

"Alexey Smirnov" wrote:
On Jun 9, 8:36 pm, rodchar <rodc...@discussions.microsoft.comwrote:
hey all,
i'm binding a date field from sql to my dropdownlist and it's showing the
time. is there a way to format that in visual studio?]

thanks,
rodchar

Hi rodchar,

use DataTextFormatString property:
http://msdn.microsoft.com/en-us/libr...matstring.aspx

For example,

dropdownlist1.DataTextFormatString ="{0:dd/MM/yyyy}"

Hope this helps
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
2
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of...
0
by: George Durzi | last post by:
I have a stored procedure that is returning a column which is cast(company_name as char(30)) + ' | ' + cast(client_name as char(20) + ' | ' 2by4 Brand Architects | Test, TEst ...
1
by: BlueFrog | last post by:
Hey, I have dates in a databound dropdownlist that I want to format. I suspect I need to use the ondatabind event but I've no idea as to how to pull this off having searched high and low for...
1
by: oscar | last post by:
Hi expart, I have facing the problem of formatting the datetime in Dropdownlist. I am using Data Reader to retrive the date data from Sql2000 server and bind to DropDownList Control. The default...
4
by: Neil Steventon | last post by:
Is there a problem with asp.net 2 when setting the Csstyle. I have a CSS stylesheet and can format different elements, but having trouble formatting the asp.net controls , such as dropdownlist. ...
3
by: Nathan Sokalski | last post by:
I am using databinding to populate a dropdownlist with numeric values. Some of the values have more decimal places than others, and I only want the minimal number of decimal places necessary...
1
Daxthecon
by: Daxthecon | last post by:
I have 3 drop down lists MM DD yyyy and have it calling the DateTime.Now.(time reference) then the format. I have populated the dropdownlist by hand with the selections that are available if the...
0
by: asmx126453 | last post by:
Hey mensen I am having some big troubles here i tryd solving it myself with internet for 2 days but i kind fix it. Its about this i have a DotNet project that alrydi is online and working for...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.