Home Search Member List Faq Register Login  
UltimateCalendar
Re: data bind

Thread Starter: Diesel   Started: 07-10-2012 12:00 PM   Replies: 4
 Karamasoft Support Forums » General Discussions » UltimateCalendar » Re: data bind
 Printable Version    « Previous Thread   Next Thread »
  10 Jul 2012, 12:00 PM
Diesel is not online. Last active: 4/1/2013 12:02:43 PM Diesel

Top 10 Posts
Joined on 12-26-2011
Posts 44
data bind
How do you data bind the date picker textbox with data from a sql data source? I looked in the samples provided but didnt see an example for this....

Thanks..

  
  10 Jul 2012, 12:45 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: data bind
There is no built-in mechanism to do data binding. You need to programmatically set the Text property of the DatePickerTextBox of your UltimateDatePicker control to the value you get from your database.
  
  11 Jul 2012, 4:22 AM
Diesel is not online. Last active: 4/1/2013 12:02:43 PM Diesel

Top 10 Posts
Joined on 12-26-2011
Posts 44
Re: data bind
could you provide a sample or an example?
  
  11 Jul 2012, 10:58 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: data bind

We don't know how exactly you get/set teh date from your database but once you retrieve it from the database, you can use the following approach to set the text of the date picker textbox:

UltimateDatePicker1.DatePickerTextBox.Text =
"the_date_here";


  
  12 Jul 2012, 11:43 AM
Diesel is not online. Last active: 4/1/2013 12:02:43 PM Diesel

Top 10 Posts
Joined on 12-26-2011
Posts 44
Re: data bind

Thank you..  Here is what I'm using and it works perfect.  Maybe this will help someone else....

ASPX Page:

<EditItemTemplate>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("StartDate") %>'></asp:TextBox>

<br />

<cc1:UltimateDatePicker id="UltimateDatePicker1" runat="server" DateFormat="MM/dd/yyyy">

<DatePickerTextBox Width="80px" Height="19px" Text='<%# DataBinder.Eval(Container.DataItem, "StartDate") %>'>

</DatePickerTextBox>

</cc1:UltimateDatePicker>

<cc1:UltimateCalendar id="UltimateCalendar1" runat="server" Font-Size="8pt" Font-Names="Verdana" DayNameFormat="FirstTwoLetters"

NextMonthText="&lt;img border='0' src='RightWhite.gif'>"

PrevMonthText="<img border='0' src='LeftWhite.gif'>"

InitiallyHidden="True" AutoPostBackOnSelectionChanged="False" QuickPick="True">

<DayStyle BackColor="AliceBlue"></DayStyle>

<OtherMonthDayStyle ForeColor="Gray"></OtherMonthDayStyle>

<DayHeaderStyle BackColor="LightSkyBlue"></DayHeaderStyle>

<TitleStyle Wrap="False" ForeColor="White" BackColor="RoyalBlue"></TitleStyle>

<DayOverStyle BackColor="Orange"></DayOverStyle>

<SelectorStyle ForeColor="Red"></SelectorStyle>

<MultiMonthTitleStyle Wrap="False"></MultiMonthTitleStyle>

<TodayDayStyle ForeColor="White" BackColor="RoyalBlue"></TodayDayStyle>

</cc1:UltimateCalendar>

</EditItemTemplate>

Code Behind VB:

Protected Sub DetailsView2_ItemUpdating(sender As Object, e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Handles DetailsView2.ItemUpdating

e.NewValues("StartDate") = CType(DetailsView2.FindControl("UltimateDatePicker1"), Karamasoft.WebControls.UltimateCalendar.UltimateDatePicker).DatePickerTextBox.Text

End Sub

Thanks again,

Diesel


  
 Page 1 of 1 (5 items)
Karamasoft Support Forums » General Discussions » UltimateCalendar » Re: data bind

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.