Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
XamTimeLine bibding in code
posted

Hello,
I want to binding XamTimeLine at code.
There is my code:
public class PelnasXamTimeLine
{
    public DateTime Time { get; set; }
    public string Title { get; set; }
    public string Details { get; set; }
    public int Duration { get; set; }
}

In XAML:
<ig:XamTimeline x:Name="Timeline" Margin="20,97,20,20" Background="{x:Null}">
  <ig:XamTimeline.Axis>
    <ig:DateTimeAxis ScrollPosition="0.55" ScrollScale=".45" />
  
</ig:XamTimeline.Axis>
<
/ig:XamTimeline>

In code:
DataTable table = new DataTable(e.Result);
List<PelnasXamTimeLine> list = new List<PelnasXamTimeLine>();
foreach (DataRow dr in table.Rows)
{
  list.Add(
new PelnasXamTimeLine { Details = "Aprasymas", Title = dr  ["Preke"].ToString(), Time = Convert.ToDateTime(dr["Data"].ToString()),   Duration = 50 });
}
Infragistics.Controls.Timelines.
NumericTimeSeries series = new Infragistics.Controls.Timelines.NumericTimeSeries();

series.Title =

 

"Pelnas per pasirinkta laikotarpi";
series.DataSource = list;
series.DataMapping =
"Time=Time;Duration=Duration;Title=Title;Details=Details";

 

 

//series.DataBind();

 

 

 

 

this.Timeline.Series.Add(series);

And the rersult is:

 

 

 

 

 

 

Can anyone help me?

Parents
No Data
Reply Children
No Data