or
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
<
telerik:RadGridView
x:Name
=
"dgvOrdenes"
ShowGroupPanel
=
"False"
ShowColumnHeaders
=
"True"
ShowColumnFooters
=
"False"
ItemsSource
=
"{Binding V_Or2}"
HorizontalAlignment
=
"Left"
Margin
=
"10,44,-83,0"
ShowInsertRow
=
"False"
VerticalAlignment
=
"Top"
Height
=
"216"
Width
=
"810"
Grid.RowSpan
=
"4"
AutoGenerateColumns
=
"False"
Grid.ColumnSpan
=
"3"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding [Or]}"
Header
=
"{Resx RadGridViewOr_Or}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Alta}"
Header
=
"{Resx RadGridViewOr_Alta}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Cierre}"
Header
=
"{Resx RadGridViewOr_Cierre}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Matricula}"
Header
=
"{Resx RadGridViewOr_Matricula}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Modelo}"
Header
=
"{Resx RadGridViewOr_Modelo}"
/>
</
telerik:RadGridView.Columns
>
<
ContextMenuService.ContextMenu
>
<
ContextMenu
>
<
MenuItem
Click
=
"MenuItem6_Click"
Header
=
"copy row"
>
<
MenuItem.Icon
>
<
Image
Source
=
"/Imagenes/bullet-blue-icon.png"
Height
=
"10"
Width
=
"10"
/>
</
MenuItem.Icon
>
</
MenuItem
>
</
ContextMenu
>
</
ContextMenuService.ContextMenu
>
</
telerik:RadGridView
>
Private Sub MenuItem6_Click(sender As Object, e As RoutedEventArgs)
Clipboard.SetData(DataFormats.Text, TryCast(Me.dgvordenes.ItemContainerGenerator.ContainerFromItem(Me.dgvordenes.SelectedItem), R)
End Sub
FilterDescriptor mydescriptor = FilterDescriptor(FilterMember, FilterOperator, "0,1", FilterIsCaseSensitive);
Where can I set the culture to use for number conversion???
<
ResourceDictionary
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:XTelerik
=
"clr-namespace:XControlsWPF.XTelerik;assembly=XControlsWPF"
>
<
ResourceDictionary.MergedDictionaries
>
<
ResourceDictionary
Source
=
"pack://application:,,,/XControlsWPF;component/Styles.xaml"
/>
<
ResourceDictionary
Source
=
"pack://application:,,,/XDiagramWPF;component/Assets/XDiagramStyles.xaml"
/>
<!--
<telerik:Windows8ResourceDictionary/>
-->
</
ResourceDictionary.MergedDictionaries
>
<
telerik:Windows8Colors
x:Key
=
"Windows8Colors"
/>
<
SolidColorBrush
x:Key
=
"AccentBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.AccentColor}"
/>
<
SolidColorBrush
x:Key
=
"BasicBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.BasicColor}"
/>
<
SolidColorBrush
x:Key
=
"StrongBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.StrongColor}"
/>
<
SolidColorBrush
x:Key
=
"MainBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.MainColor}"
/>
<
SolidColorBrush
x:Key
=
"MarkerBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.MarkerColor}"
/>
<
SolidColorBrush
x:Key
=
"ValidationBrush"
Color
=
"{Binding Source={StaticResource Windows8Colors}, Path=Palette.ValidationColor}"
/>
<
Style
TargetType
=
"{x:Type XTelerik:XCheckButton}"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Windows8"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,3"
/>
</
Style
>
<
Style
TargetType
=
"{x:Type XTelerik:XButton}"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Windows8"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,3"
/>
</
Style
>
<
Style
TargetType
=
"{x:Type telerik:RadToggleButton}"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Windows8"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,3"
/>
</
Style
>
<
Style
TargetType
=
"{x:Type Button}"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Windows8"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,3"
/>
</
Style
>
<
Style
TargetType
=
"{x:Type telerik:RadButton}"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Windows8"
/>
<
Setter
Property
=
"Padding"
Value
=
"6,3"
/>
</
Style
>
<
Style
TargetType
=
"{x:Type telerik:RadBusyIndicator}"
BasedOn
=
"{StaticResource DarkBusyBackgroundStyle}"
/>
<
Style
TargetType
=
"TextBox"
>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Center"
/>
<
Setter
Property
=
"Validation.ErrorTemplate"
Value
=
"{StaticResource validationTemplate}"
/>
</
Style
>
<
Style
TargetType
=
"Grid"
>
<
Setter
Property
=
"Validation.ErrorTemplate"
Value
=
"{StaticResource validationTemplate}"
/>
</
Style
>
</
ResourceDictionary
>
<
Style
x:Key
=
"RadAutoCompleteBoxStyle"
TargetType
=
"{x:Type telerik:RadAutoCompleteBox}"
><
br
> <
Setter
Property
=
"IsTabStop"
Value
=
"True"
/><
br
> <
Setter
Property
=
"TextBoxStyle"
><
br
> <
Setter.Value
><
br
> ....<
br
> </
Setter.Value
><
br
> </
Setter
><
br
> <
Setter
Property
=
"BorderBrush"
Value
=
"#FF848484"
/><
br
> <
Setter
Property
=
"BorderThickness"
Value
=
"1"
/><
br
> <
Setter
Property
=
"Background"
Value
=
"White"
/><
br
> <
Setter
Property
=
"Padding"
Value
=
"0,0,3,3"
/><
br
> <
Setter
Property
=
"Cursor"
Value
=
"IBeam"
/><
br
> <
Setter
Property
=
"ScrollViewer.VerticalScrollBarVisibility"
Value
=
"Disabled"
/><
br
> <
Setter
Property
=
"ScrollViewer.HorizontalScrollBarVisibility"
Value
=
"Disabled"
/><
br
> <
Setter
Property
=
"SnapsToDevicePixels"
Value
=
"True"
/><
br
> <
b
><
Setter
Property
=
"Margin"
Value
=
"5,2"
/></
b
><
br
> </
Style
>
Hy,