I have two comboboxes on a web form. The first combobox returns a date in the form of a string. The datasource of the second combobox is a stored procedure that requires a datetime input parameter. I would like to use the first combobox as the source of the input parameter for the second combobox but the datatype is wrong. Is there anyway that it is possible to convert the datatype of first combobox -- that is without having to rewrite the stored procedure. Something like:
I also have a second question. Is there a way to programmatically select the first item in the first combobox when the page initially opens?
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AllTab115Instances.ascx.vb" Inherits="AllInstances" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<telerik:RadComboBox ID="RadComboBox1" runat="server" |
DataSourceID="SqlDataSource1" DataTextField="Instance_name" |
DataValueField="Instance_name" Width="110px"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</telerik:RadComboBox> |
<asp:TextBox ID="txtNotBeforeDate" runat="server" Visible="False"></asp:TextBox> |
<asp:SqlDataSource ID="SqlDataSource1" runat="server" |
ConnectionString="<%$ ConnectionStrings:ActiveString %>" |
SelectCommand="stdprc_GetAllTab115Instances" |
SelectCommandType="StoredProcedure"> |
<SelectParameters> |
<asp:ControlParameter ControlID="txtNotBeforeDate" DefaultValue="1/1/1900" |
Name="NotBefore" |
--the next line is where I would think you might convert type? |
PropertyName=Ctype("Text",dateTime) |
Type="DateTime" /> |
</SelectParameters> |
</asp:SqlDataSource> |
I also have a second question. Is there a way to programmatically select the first item in the first combobox when the page initially opens?