Binding timebar to a RadDomainDataSource

2 posts, 0 answers
  1. AP
    AP avatar
    187 posts
    Member since:
    Apr 2010

    Posted 27 Jul 2011 Link to this post

    I'm trying to bind a timebar with a sparkline, to data from RIA services, using a RadDomainDataSource.  I can only seem to bind the sparkline to the Yvalue, when I bind to the DateTime field, it crashes.
    <telerik:RadDomainDataSource Height="100" HorizontalAlignment="Left" Margin="66,28,0,0" Name="radDomainDataSource1" VerticalAlignment="Top" Width="100" AutoLoad="True" QueryName="GetAdmissionsSummariesQuery">

    <telerik:RadTimeBar Name="timeBar1"
                                       PeriodStart="01-Apr-2008" PeriodEnd="31-Mar-2012"
                                       VisiblePeriodStart="01-Apr-2008" VisiblePeriodEnd="31-Mar-2009"
                                       SelectionStart="1-Apr-2008" SelectionEnd="31-May-2008"
                                       MaxSelectionRange="62.00:00:00" Height="175" VerticalAlignment="Top">
                   <telerik:QuarterInterval />
                   <telerik:MonthInterval />
                   <telerik:WeekInterval />
                   <telerik:DayInterval />
               <telerik:RadLinearSparkline ItemsSource="{Binding DataView,ElementName=radDomainDataSource1}"
                                                   LineStroke="#FF767676"  YValuePath="Adms"  Margin="0,3" />

    While this runs, the sparkline data isn't in sync with the timebar dates, I'm assuming for this to work, I need to bind the XValuePath to the field AdmDate. However, when I do this, it crashes.
    Unfortunately the only binding examples I can find are viewModel based, and aren't appropriate to this RIA Services based project.
  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 29 Jul 2011 Link to this post

    Hello Ap,
    Straight to your questions:
    1. In order for the TimeBar and Sparkline dates to be synchronized, the PeriodStart and PeriodEnd properties of the TimeBar should be the same as the earliest and last date, for which there is a data entry for the Sparkline. Additionally, you should bind the XValuePath of the Sparkline, yes.
    2. Regarding the crash that you report, when binding the XValuePath - your code looks correct and I am not quite sure what could be causing this problem. Could you please post the exception message that you get, when you bind the XValuePath property? It would be best if you open a formal support ticket and send us a simple running test project that demonstrates exception as well.

    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top