This is a migrated thread and some comments may be shown as answers.

Binding timebar to a RadDomainDataSource

1 Answer 32 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
AP
Top achievements
Rank 1
Veteran
AP asked on 27 Jul 2011, 03:15 PM
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:RadDomainDataSource.DomainContext>
               <server:DWContext/>
           </telerik:RadDomainDataSource.DomainContext>
       </telerik:RadDomainDataSource>

<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"
                                   IsSnapToIntervalEnabled="True"
                                   MinSelectionRange="28.00:00:00"
                                   MaxSelectionRange="62.00:00:00" Height="175" VerticalAlignment="Top">
           <telerik:RadTimeBar.Intervals>
               <telerik:QuarterInterval />
               <telerik:MonthInterval />
               <telerik:WeekInterval />
               <telerik:DayInterval />
           </telerik:RadTimeBar.Intervals>
           <telerik:RadLinearSparkline ItemsSource="{Binding DataView,ElementName=radDomainDataSource1}"
                                               LineStroke="#FF767676"  YValuePath="Adms"  Margin="0,3" />
       </telerik:RadTimeBar>

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.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 29 Jul 2011, 11:32 AM
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.

Regards,
Tsvetie
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!

Tags
TimeBar
Asked by
AP
Top achievements
Rank 1
Veteran
Answers by
Tsvetie
Telerik team
Share this question
or