Hi All,
I am opening RadWindow with ShowDialog() from viewmodel. I am not able to detect close 'X' button event. I want to prompt user before closing.
My code looks like:
AssetViewModel.cs
var AssetWindow = new RadWindow
{
Header = "Asset Information",
Owner = Application.Current.MainWindow,
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner,
Content = new UserControl()
};
AssetWindow.ShowDialog();
What is the best approach to detect close event, prompt user and proceed with user selected option i.e Yes/No
Any help would be appreciated,
Regards,
Prashant Kirpan
Hi All,
I am using RadTabControl and validation is working only if tab is selected. i.e. updating UI only for selected tab and not others.
I have a RadTabControl control with three RadTabItem. Every tabitem contains usercontrol with own view model.
For all user controls, i have used IDataErrorInfo for validation. From main control, manually i am triggering validation using notifyproperty change i.e. RaisePropertyChanged(string.Empty).
This is working fine only if tab is selected. validation is executing properly on other tabs but UI is not updating.
Control Structure:
MainVM.cs
- TabControl1VM = new TabControl1ViewModel();
- TabControl2.VM = new TabControl2ViewModel();
MainControl.xaml
<telerik:RadTabControl >
<telerik:RadTabItem Header="Location" DataContext="{Binding TabControl1VM}" >
<telerik:RadTabItem.Content >
<local:TabControl1></local:TabControl1>
</telerik:RadTabItem.Content>
</telerik:RadTabItem>
<telerik:RadTabItem Header="Asset Type" DataContext="{Binding TabControl2VM}">
<telerik:RadTabItem.Content>
<local:TabControl2></local:TabControl2>
</telerik:RadTabItem.Content>
</telerik:RadTabItem>
Any help would be appreciated,
Regards,
Prashant
public
void
PopulatePropertyGrid()
{
List<MyKeyValueClass> propertyList =
new
List<MyKeyValueClass>();
propertyList.Add(
new
MyKeyValueClass(){ Key=
"property1"
, Value=
"value1"
});
propertyList.Add(
new
MyKeyValueClass(){ Key=
"property2"
, Value=
"value2"
});
propertyList.Add(
new
MyKeyValueClass(){ Key=
"property3"
, Value=
"value3"
});
//How do I bind this List to a RadPropertyGrid, so I get 3 properties with filled in values?
}
public
class
MyKeyValueClass
{
public
string
Key {
get
;
set
;}
public
string
Value {
get
;
set
;}
}
<
telerik:RadPropertyGrid
x:Name
=
"radPropertyGrid"
AutoGeneratePropertyDefinitions
=
"false"
/>
radPropertyGrid.PropertyDefinitions.Clear();
foreach
(MyKeyValueClass mkvc
in
propertyList)
{
radPropertyGrid.PropertyDefinitions.Add(
new
PropertyDefinition()
{
DisplayName = mkvc.Key,
Binding =
new
Binding(
"Value"
)
});
}
radPropertyGrid.Item = propertyList;
Hi,
I'm trying to fill my RadTileView on an event Window_Loaded.
The form updates ok in terms of code, but visualualy it remains empty and i have no idea why:
private
void
Window_Loaded(
object
sender, RoutedEventArgs e)
{
MyRadtileView.Items.Clear();
MyRadtileView.Items.Add(
new
RadTileViewItem()
{
Header =
"test"
});
MyRadtileView.UpdateLayout();
}
Result:
Can anyone help me?
Hi,
I would like to customise the animation for the opening and navigate event/state of the radial menu. How can I do it? Thank you!
I have an existing WPF application which uses Microsoft.Windows.controls.Datagrid. I want to add the RadDataPager to do the pagination, how can I do it?
Here's my sample code. It displays the data but it doesn't do the pagination. All data is displayed in a single page.
<dg:DataGrid Name="dgRegistryDetails" FontSize="14" DockPanel.Dock="Bottom" Foreground="#FF07315B"
ItemsSource="{Binding}" CanUserSortColumns="true"
IsReadOnly="True" AutoGenerateColumns="False" >
<telerik:RadDataPager VerticalAlignment="Bottom" DisplayMode="FirstLastPreviousNextNumeric" Source="{Binding Items, ElementName=dgRegistryDetails}" IsTotalItemCountFixed="True" x:Name="RadPager" PageSize="10" />
I have a C# WPF application using MVVM with a simple RadCartesianChart that shows a single ScatterLineSeries representing a surface profile. It works well.
Now I want to enable my user to mark out certain horizontal regions of the plot for use in my application. The general idea is this
(I have attached an image showing roughly what this should look like. It is from a much older version of this application that doesn't use C#, WPF or Telerik.)
My problem is not in writing interaction/manipulation code. It is in determining exactly what Telerik entity I should interact with. That is I don't know how best to achieve this with the tools Telerik gives me.
I can think of several approaches.
My Chart in XAML is like this:
<
tk:RadCartesianChart
x:Name
=
"Chart"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Background
=
"{StaticResource GsBackgroundDark}"
Foreground
=
"{StaticResource GsForegroundLight}"
Height
=
"300"
HoverMode
=
"FadeOtherSeries"
SelectionPalette
=
"FlowerSelected"
ga:ChartUtilities.IsDragToSelectEnabled
=
"True"
ga:ChartUtilities.SelectionRectangleStyle
=
"{StaticResource SelectionRectangleStyle}"
>
<
tk:RadCartesianChart.Resources
>
<
Style
x:Key
=
"LabelStyle"
TargetType
=
"TextBlock"
>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource GsForegroundLight}"
/>
</
Style
>
</
tk:RadCartesianChart.Resources
>
<
tk:RadCartesianChart.HorizontalAxis
>
<
tk:LinearAxis
Title
=
"{Binding Path=XAxisTitle}"
Foreground
=
"{StaticResource GsForegroundLight}"
LabelStyle
=
"{StaticResource LabelStyle}"
LabelFormat
=
"0.00"
/>
</
tk:RadCartesianChart.HorizontalAxis
>
<
tk:RadCartesianChart.VerticalAxis
>
<
tk:LinearAxis
x:Name
=
"YAxis"
Title
=
"{Binding Path=YAxisTitle}"
Foreground
=
"{StaticResource GsForegroundLight}"
LabelStyle
=
"{StaticResource LabelStyle}"
LabelFormat
=
"0.00"
/>
</
tk:RadCartesianChart.VerticalAxis
>
<
tk:RadCartesianChart.AnnotationsProvider
>
<
tk:ChartAnnotationsProvider
Source
=
"{Binding Regions}"
>
<
tk:ChartAnnotationDescriptor
d:DataContext
=
"{d:DesignInstance gavm:ProfileRegionVm}"
>
<
tk:ChartAnnotationDescriptor.Style
>
<
Style
TargetType
=
"tk:CartesianMarkedZoneAnnotation"
>
<
Setter
Property
=
"VerticalFrom"
Value
=
"-1000"
/>
<
Setter
Property
=
"VerticalTo"
Value
=
"1000"
/>
<
Setter
Property
=
"HorizontalFrom"
Value
=
"{Binding HorizontalFrom}"
/>
<
Setter
Property
=
"HorizontalTo"
Value
=
"{Binding HorizontalTo}"
/>
<
Setter
Property
=
"Stroke"
Value
=
"Yellow"
/>
</
Style
>
</
tk:ChartAnnotationDescriptor.Style
>
</
tk:ChartAnnotationDescriptor
>
</
tk:ChartAnnotationsProvider
>
</
tk:RadCartesianChart.AnnotationsProvider
>
<
tk:RadCartesianChart.Series
>
<
tk:ScatterLineSeries
ItemsSource
=
"{Binding Path=ProfilePointsConverted}"
XValueBinding
=
"X"
YValueBinding
=
"Y"
>
<
tk:ScatterLineSeries.LegendSettings
>
<
tk:SeriesLegendSettings
Title
=
"Profile"
/>
</
tk:ScatterLineSeries.LegendSettings
>
</
tk:ScatterLineSeries
>
</
tk:RadCartesianChart.Series
>
</
tk:RadCartesianChart
>
My ProfileRegionVm class -- which represents an instance of this horizontal reagion is like this:
using
System.Collections.Generic;
using
GApp.Core.ViewModels;
using
SWPoint = System.Windows.Point;
namespace
GApp.Analyze.ViewModels
{
public
class
ProfileRegionVm : BaseVm
{
public
ProfileRegionVm()
{
}
private
List<SWPoint> _profilePoints;
private
List<SWPoint> Points
{
get
=> _profilePoints;
set
=> SetProperty(
ref
_profilePoints, value);
}
private
Sdk.Line _line;
private
Sdk.Line Line
{
get
=> _line;
set
=> SetProperty(
ref
_line, value);
}
private
string
_name;
public
string
Name
{
get
=> _name;
set
=> SetProperty(
ref
_name, value);
}
private
double
_verticalFrom;
public
double
VerticalFrom
{
get
=> _verticalFrom;
set
=> SetProperty(
ref
_verticalFrom, value);
}
private
double
_verticalTo;
public
double
VerticalTo
{
get
=> _verticalTo;
set
=> SetProperty(
ref
_verticalTo, value);
}
private
double
_horizontalFrom;
public
double
HorizontalFrom
{
get
=> _horizontalFrom;
set
=> SetProperty(
ref
_horizontalFrom, value);
}
private
double
_horizontalTo;
public
double
HorizontalTo
{
get
=> _horizontalTo;
set
=> SetProperty(
ref
_horizontalTo, value);
}
}
}
Hi:
I recently encountered a problem when using Edit Collections. I want to save the database immediately after editing Edit Collections.Is it possible to customize the Edit Collections template and add save buttons other than add and remove to achieve this?
Hi Telerik-team,
Is it possible to select what columns should be shown in the dropdown from the GridViewMultiColumnComboBoxColumn, like it is possible in the RadMultiColumnComboBox? I could not find any documentation on that.
Thank you in advance!
Greetings, Mats