I'm retrieving a date value from sql and its returning the time portion as well as the date.
I just want to display the date in the drop down.
Is there something like a DataFormatString for the dropdown???
chuck
Hello,
one option could be to use ItemTemplate and Databinder.Eval, then put whatever you want.
for example:
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" DataKeyFields="OrderID" ValueField="OrderID" DataSourceID="AccessDataSource1"> <DropDownItemBinding KeyField="Orders" /> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "OrderDate", "{0:d}")%> </ItemTemplate> </ig:WebDropDown> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [OrderID], [OrderDate] FROM [Orders]"></asp:AccessDataSource>
Also take a look at the online samples: WebDropDown Templates
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=WebDropDown_Templating.html
Hope this helps
That's 1/2 way there. The drop down items (only one at this time) have the date formatted properly.
Here's the code
<ig:WebDropDown ID="DateSelectionWebDropDown" runat="server" Width="200px" CssClass="Textboxes" DataSourceID="DateDropDownSqlDataSource" DataKeyFields="ImportDate" DropDownAnimationType="Bounce"> <AutoPostBackFlags SelectionChanged="On" /> <DropDownItemBinding TextField="ImportDate" ValueField="ImportDate" /> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "ImportDate", "{0:MM/dd/yyyy}")%> </ItemTemplate></ig:WebDropDown>
But when the program is run, the date displayed in the dropdown box has the full date/time components. When dropped down, the date is displayed correctly. strange??
any ideas.