or
<
telerik:RadTreeListView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Tag}"
Header
=
"Tag"
Width
=
"Auto"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Description}"
Header
=
"Description"
Width
=
"Auto"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ImportedEquipmentType}"
Header
=
"Imported Equipment Type"
Width
=
"Auto"
/>
</
telerik:RadTreeListView.Columns
>
My code for my data class is as follows. My xaml ItemSource is bound to Children:
public class TagItem
{
public List<
TagItem
> _children = new List<
TagItem
>();
public List<
TagItem
> Children
{
get { return _children; }
}
public string EquipmentID { get; set; }
public string SystemID { get; set; }
public string Tag { get; set; }
public string TagNodeText { get; set; }
public string Tag2 { get; set; }
public string Description { get; set; }
public string Description2 { get; set; }
public string ImportedEquipmentType { get; set; }
public string ManuallyAdded { get; set; }
public string ParentID { get; set; }
public string NodeLeft { get; set; }
public string NodeRight { get; set; }
public string Depth { get; set; }
public string Mpath { get; set; }
}
readonly EquipmentListTreeViewModel _equipmentTree;
public EquipmentListNavigator()
{
InitializeComponent();
// Get raw family tree data from a database.
TagItem rootTagItem = Database.GetEquipmentTree();
// Create UI-friendly wrappers around the
// raw data objects (i.e. the view-model).
_equipmentTree = new EquipmentListTreeViewModel(rootTagItem);
// Let the UI bind to the view-model.
base.DataContext = _equipmentTree;
}
public static TagItem GetEquipmentTree()
{
nTI.Tag = "ASSET REGISTER";
FillTreeView("", nTI);
return nTI;
}
private static void FillTreeView(string currKeyRoot, TagItem nTI = null)
{
DataRows.MyRow row = drows.GetNextRow();
while (row != null)
{
if (NodeStartsWith(row.MPath, currKeyRoot))
{
TagItem tnChild = new TagItem();
tnChild.SystemID = row.SystemID;
tnChild.EquipmentID = row.EquipmentID;
tnChild.Description = row.Description;
tnChild.ParentID = row.ParentID;
tnChild.Mpath = row.MPath;
tnChild.Depth = row.Depth;
tnChild.Tag = row.Tag;
tnChild.Tag2 = row.Tag2;
tnChild.Description2 = row.Description2;
tnChild.ImportedEquipmentType = row.ImportedEquipmentType;
tnChild.ManuallyAdded = row.ManuallyAdded;
tnChild.NodeLeft = row.NodeLeft;
tnChild.NodeRight = row.NodeRight;
nTI.Children.Add(tnChild);
FillTreeView(row.MPath, tnChild);
}
else
{
drows.MovePrev();
return;
}
row = drows.GetNextRow();
}
if
(grid.ItemsSource ==
null
)
{
//Creates the reference for the duplex Service
InstanceContext instanceContext =
new
InstanceContext(
new
CallbackHandler());
ServiceReference1.ServiceDuplexClient client2 =
new
ServiceDuplexClient(instanceContext);
this
.Cursor = System.Windows.Input.Cursors.Wait;
//Call the service functon that returns the DataSet
DataSet ds = client2.EventSummary();
this
.Cursor = System.Windows.Input.Cursors.Arrow;
if
(ds !=
null
)
{
if
(ds.DataSetName.Equals(
"OK"
))
{
//If it's OK the DataSet is the ItemsSource of the grid
grid.ItemsSource = ds;
}
}
}
<
telerik:RadBusyIndicator
x:Name
=
"busyIndicator"
BusyContent
=
"Loading data...."
Grid.ColumnSpan
=
"3"
Grid.RowSpan
=
"3"
>
public
partial
class
Page1 : Page
{
//Declare my background worker
BackgroundWorker workerOperAct =
new
BackgroundWorker();
public
Page1()
{
InitializeComponent();
workerOperAct.DoWork +=
this
.WorkerOperActDoWork;
workerOperAct.RunWorkerCompleted += WorkerOperActRunWorkerCompleted;
}
private
void
WorkerOperActDoWork(
object
sender, DoWorkEventArgs e)
{
//Create the reference for the service
InstanceContext instanceContext =
new
InstanceContext(
new
CallbackHandler());
ServiceReference1.ServiceDuplexClient client2 =
new
ServiceDuplexClient(instanceContext);
//Call the service function that returns the DataSet
DataSet ds = client2.EventSummary();
if
(ds !=
null
)
{
if
(ds.DataSetName.Equals(
"OK"
))
{
grid.ItemsSource = ds;
}
}
}
void
WorkerOperActRunWorkerCompleted(
object
sender, RunWorkerCompletedEventArgs e)
{
grid.Visibility = Visibility.Visible;
this.busyIndicator.IsBusy = false;
}
//More code....
}
DataSet ds = client2.EventSummary();
when i use the chart,and use chart.Series[0].ItemsSource = tempDrw ( here the tempDW is a double type array; to draw the line like the attachment.
but i have a problem: when the data in the tempDrw change but the chat can not updata.