or
public partial class SystemStatusChart : UserControl { public SystemStatusChart() { InitializeComponent(); vm = new SystemStatusChartViewModel(); DataContext = vm; MainWindow.CloseDataContext += MainWindow_CloseDataContext; } void MainWindow_CloseDataContext() { vm = (SystemStatusChartViewModel)DataContext; if (vm != null) { vm.RefreshTimer.Stop(); vm = null; DataContext = null; } } private SystemStatusChartViewModel vm; }
class SystemStatusChartViewModel : ViewModelBase { public Timer RefreshTimer; public SystemStatusChartViewModel() { RefreshTimer = new Timer(); RefreshTimer.Elapsed += DataService; RefreshTimer.Interval = 1000; RefreshTimer.Enabled = true; } public async void DataService(object o, EventArgs e) {RefreshTimer.Stop();//Capture Data, error checking, logging StatusData = temp1; //update data ForecastData = temp2; //update dataRefreshTimer.Start(); } /// <summary> /// The <see cref="StatusData" /> property's name. /// </summary> public const string StatusDataPropertyName = "StatusData"; private RadObservableCollection<StatusChartItem> _statusData = new RadObservableCollection<StatusChartItem>(); /// <summary> /// Sets and gets the StatusData property. /// Changes to that property's value raise the PropertyChanged event. /// </summary> public RadObservableCollection<StatusChartItem> StatusData { get { return _statusData; } set { if (_statusData == value) { return; } RaisePropertyChanging(StatusDataPropertyName); _statusData = value; LastUpdate = new ObservableCollection<DateTime>() { DateTime.Now }; FirstUpdate = new ObservableCollection<DateTime>() { DateTime.Now.AddDays(-2) }; RaisePropertyChanged(StatusDataPropertyName); } } /// <summary> /// The <see cref="ForecastData" /> property's name. /// </summary> public const string ForecastDataPropertyName = "ForecastData"; private RadObservableCollection<StatusChartItem> _forecastDataList = new RadObservableCollection<StatusChartItem>(); /// <summary> /// Sets and gets the "ForecastData property. /// Changes to that property's value raise the PropertyChanged event. /// </summary> public RadObservableCollection<StatusChartItem> ForecastData { get { return _forecastDataList; } set { if (_forecastDataList == value) { return; } RaisePropertyChanging(ForecastDataPropertyName); _forecastDataList = value; RaisePropertyChanged(ForecastDataPropertyName); } }
Private Sub ListBox_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Dim s As String = "" BodyWorkAndPaintingTool.????????????? = TryCast(sender,ListBox).Items(0).ToString End Sub <telerik:RadImageEditorUI x:Name="BodyWorkAndPaintingTool" ContextMenuOpening="BodyWorkAndPaintingTool_ContextMenuOpening" Grid.ColumnSpan="4" Margin="10,49,33,10" Grid.Row="1" Grid.RowSpan="4"> <telerik:RadImageEditorUI.ImageToolsSections> <telerik:ImageToolsSection Header="{Resx DisenadorBlur}" > <telerik:ImageToolItem ImageKey="Resize" Text="Resize" Command="commands:ImageEditorRoutedCommands.ExecuteTool"> <telerik:ImageToolItem.CommandParameter>...............<StackPanel Grid.Row="1"> <TextBlock Margin="10,0,0,0" Text="{Binding AggregateResults[\AppCount\].FormattedValue, ElementName=FIBRE_App_Stats}" /> <TextBlock Margin="10,0,0,0" Text="{Binding AggregateResults[\GrandTotal\].FormattedValue, ElementName=FIBRE_App_Stats}" /> </StackPanel>Hello,
I‘d like to show xml data (with xsd) in a RadGridView and edit its value. The values in the grid should allow only this data, which are allowed in xsd. For instance, for enum type I would like to have a ComboBox column.
In Xaml I have a following code:
<telerik:RadGridView x:Name="dataGrid" AutoGenerateColumns="True" CanUserResizeRows="True">
</telerik:RadGridView>
The xml data is loaded in a DataSet and connected to the grid:
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{
var data = new DataSet();
data.ReadXmlSchema(@"D:\Development\Data\IBISConfig.xsd");
data.ReadXml(@"D:\Development\Data\IBISConfig.xml");
dataGrid.DataMember = data.Tables[data.Tables.Count - 1].TableName;
dataGrid.ItemsSource = data;
}
The Xml file is shown as a hierachical data, but the data types in the columns are always strings.
How can I change the column type, without to parse the xsd?
Best Regards
Marian