I'm trying to get a row selected in a datagrid, by clicking on a datapoint in a scattergraph.
My datapoint class:
public class TelerikDataPoint : DataPoint
{
public VMSalesLine line { get; private set; }
private SalesLineCollection salesLinesCollection;
public double Category { get; private set; }
public double Value { get; private set; }
public TelerikDataPoint(DateTime category, double value)
{
Category = category.ToOADate();
Value = value;
}
public TelerikDataPoint(SalesLineCollection salesLinesCollection, VMSalesLine line)
{
this.salesLinesCollection = salesLinesCollection;
this.line = line;
this.Category = line.Data.PlannedDeliveryDate.Date.ToOADate();
this.Value = line.Data.Amount.Value;
this.Tooltip = line.Data.HeaderID + "-" + line.Data.LineNumber.ToString();
}
}
In the datagrid I present sales lines, in the graph too.
The graph shows a few datapoint series, built like "DeliveredOnTimeSeries.Add(dataPoint);"
(of the type ObservableCollection<TelerikDataPoint>)
I have defined an itemclick method, and that's fired. I can also read out xvalue and yvalue of the clicked datapoint.
In the 'old' situation (before we started using Telerik controls) selecting the row in the datagrid was accomplished in the Datapoint Class as follows:
class MyDataPoint : DataPoint
{
private VMSalesLine line;
private SalesLineCollection salesLinesCollection;
public MyDataPoint(SalesLineCollection salesLinesCollection, VMSalesLine line)
{
this.salesLinesCollection = salesLinesCollection;
this.line = line;
this.XValue = line.Data.PlannedDeliveryDate.Date;
this.YValue = line.Data.Amount.Value;
this.ToolTipText = line.Data.HeaderID + "-" + line.Data.LineNumber.ToString();
this.MouseLeftButtonUp += new MouseButtonEventHandler(MyDataPoint_MouseLeftButtonUp);
}
void MyDataPoint_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
salesLinesCollection.SalesLines.MoveCurrentTo(line);
}
}
How do I do this with the Telerik control? In the datapoint class there's no MouseLeftButtonUp
and in the itemclick method I cannot reach/find the datapoint.line attribute.
If you need any more information, please let me know.
My datapoint class:
public class TelerikDataPoint : DataPoint
{
public VMSalesLine line { get; private set; }
private SalesLineCollection salesLinesCollection;
public double Category { get; private set; }
public double Value { get; private set; }
public TelerikDataPoint(DateTime category, double value)
{
Category = category.ToOADate();
Value = value;
}
public TelerikDataPoint(SalesLineCollection salesLinesCollection, VMSalesLine line)
{
this.salesLinesCollection = salesLinesCollection;
this.line = line;
this.Category = line.Data.PlannedDeliveryDate.Date.ToOADate();
this.Value = line.Data.Amount.Value;
this.Tooltip = line.Data.HeaderID + "-" + line.Data.LineNumber.ToString();
}
}
In the datagrid I present sales lines, in the graph too.
The graph shows a few datapoint series, built like "DeliveredOnTimeSeries.Add(dataPoint);"
(of the type ObservableCollection<TelerikDataPoint>)
I have defined an itemclick method, and that's fired. I can also read out xvalue and yvalue of the clicked datapoint.
In the 'old' situation (before we started using Telerik controls) selecting the row in the datagrid was accomplished in the Datapoint Class as follows:
class MyDataPoint : DataPoint
{
private VMSalesLine line;
private SalesLineCollection salesLinesCollection;
public MyDataPoint(SalesLineCollection salesLinesCollection, VMSalesLine line)
{
this.salesLinesCollection = salesLinesCollection;
this.line = line;
this.XValue = line.Data.PlannedDeliveryDate.Date;
this.YValue = line.Data.Amount.Value;
this.ToolTipText = line.Data.HeaderID + "-" + line.Data.LineNumber.ToString();
this.MouseLeftButtonUp += new MouseButtonEventHandler(MyDataPoint_MouseLeftButtonUp);
}
void MyDataPoint_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
salesLinesCollection.SalesLines.MoveCurrentTo(line);
}
}
How do I do this with the Telerik control? In the datapoint class there's no MouseLeftButtonUp
and in the itemclick method I cannot reach/find the datapoint.line attribute.
If you need any more information, please let me know.