Hi @ all,
In the last WPF build the DataForm control got changed (single, multiple editors).
But this change broke some other functionality of the control.
I attached a screenshot of small test project when using controls from version 2020.3.1020
And also the screenshot when using controls from version 2021.1.119
This is basically the XAML code I used for the view:
<
Window
x:Class
=
"TelerikDataFormTest.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Width
=
"525"
Height
=
"350"
>
<
Window.Resources
>
<
DataTemplate
x:Key
=
"DataFormEditTemplate"
>
<
StackPanel
Margin
=
"10"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"0.5*"
/>
<
ColumnDefinition
Width
=
"0.5*"
/>
</
Grid.ColumnDefinitions
>
<
StackPanel
Grid.Column
=
"0"
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding DataName}"
Label
=
"Name"
/>
<
telerik:DataFormDataField
Label
=
"Date"
>
<
telerik:RadDatePicker
SelectedValue
=
"{Binding DataDate}"
TodayButtonVisibility
=
"Visible"
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
" "
>
<
telerik:RadButton
Width
=
"250"
Margin
=
"0,5,0,5"
HorizontalAlignment
=
"Left"
Content
=
"Test Button"
/>
</
telerik:DataFormDataField
>
</
StackPanel
>
<
StackPanel
Grid.Column
=
"1"
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding DataName}"
Label
=
"Name"
/>
<
telerik:DataFormDataField
Label
=
"Date"
>
<
telerik:RadDatePicker
SelectedValue
=
"{Binding DataDate}"
TodayButtonVisibility
=
"Visible"
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
" "
>
<
telerik:RadButton
Width
=
"250"
Margin
=
"0,5,0,5"
HorizontalAlignment
=
"Left"
Content
=
"Test Button"
/>
</
telerik:DataFormDataField
>
</
StackPanel
>
</
Grid
>
</
StackPanel
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"DataFormReadOnlyTemplate"
>
<
StackPanel
Margin
=
"10"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"0.5*"
/>
<
ColumnDefinition
Width
=
"0.5*"
/>
</
Grid.ColumnDefinitions
>
<
StackPanel
Grid.Column
=
"0"
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding DataName}"
Label
=
"Name"
/>
<
telerik:DataFormDataField
Label
=
"Date"
>
<
telerik:RadDatePicker
SelectedValue
=
"{Binding DataDate}"
TodayButtonVisibility
=
"Visible"
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
" "
>
<
telerik:RadButton
Width
=
"150"
Margin
=
"0,5,0,5"
HorizontalAlignment
=
"Left"
Content
=
"Test Button"
/>
</
telerik:DataFormDataField
>
</
StackPanel
>
<
StackPanel
Grid.Column
=
"1"
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding DataName}"
Label
=
"Name"
/>
<
telerik:DataFormDataField
Label
=
"Date"
>
<
telerik:RadDatePicker
SelectedValue
=
"{Binding DataDate}"
TodayButtonVisibility
=
"Visible"
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
" "
>
<
StackPanel
>
<
telerik:RadButton
Width
=
"150"
Margin
=
"0,5,0,5"
HorizontalAlignment
=
"Left"
Content
=
"Test Button"
/>
</
StackPanel
>
</
telerik:DataFormDataField
>
</
StackPanel
>
</
Grid
>
</
StackPanel
>
</
DataTemplate
>
</
Window.Resources
>
<
Grid
>
<
telerik:RadDataForm
Width
=
"400"
Height
=
"300"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
AutoEdit
=
"True"
AutoGenerateFields
=
"False"
CurrentItem
=
"{Binding Data}"
EditTemplate
=
"{StaticResource DataFormEditTemplate}"
ReadOnlyTemplate
=
"{StaticResource DataFormReadOnlyTemplate}"
/>
</
Grid
>
</
Window
>
Until the change this worked for years now and is also used in our projects.
The question is: Is this a bug or a wanted behaviour of this control.
If there won't be a chance to use the old setting somehow we're stuck with the old version from now on.
I'm really looking forward to your suggestion on this topic.
Kind Regards,
Thomas
Version 2020.3.1020.310
I know BindingList is old from WinForms but why does it behave differently to ObservableCollection<T> and is it correct?
Take this xaml and the code and run it. When a new row is added the SelectedItem changes before accepting the new row. Press escape twice to cancel the new row and the SelectedItem does not change, it is still set to the now canceled item. Change the ItemsSource Binding from `TradeBindingList` to `Trades` and repeat. You'll notice that SelectedItem is not changed when adding a new row. This latter behavior is much more preferable and is correct as it does not leave the SelectedItem incorrect. Why is this?
<telerik:RadGridView ItemsSource="{Binding TradeBindingList}" IsSynchronizedWithCurrentItem="True" CanUserInsertRows="True" NewRowPosition="Top" SelectedItem="{Binding SelectedTrade, Mode=TwoWay}"
AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding TradeNumber}"></telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
public partial class MainWindow : Window, INotifyPropertyChanged
{
object selectedTrade;
public MainWindow()
{
InitializeComponent();
Trades = new ObservableCollection<Trade>
{
new Trade(),
};
TradeBindingList = new BindingList<Trade>
{
new Trade(),
};
DataContext = this;
}
public ObservableCollection<Trade> Trades { get; set; }
public BindingList<Trade> TradeBindingList { get; set; }
public object SelectedTrade
{
get => selectedTrade;
set
{
selectedTrade = value;
Debug.WriteLine("Selected changed");
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public class Trade : ViewModelBase
{
public Trade()
{
TradeNumber = "1";
}
public string TradeNumber { get; set; }
}
<
tk:RadCartesianChart
x:Name
=
"Chart"
>
<
tk:RadCartesianChart.TrackBallLineStyle
>
<
Style
TargetType
=
"Polyline"
>
<
Setter
Property
=
"Visibility"
Value
=
"{Binding ElementName=Root, Path=ShowInfo, Converter={StaticResource CvtBoolToVis}}"
/>
</
Style
>
</
tk:RadCartesianChart.TrackBallLineStyle
>
<
tk:ChartTrackBallBehavior
ShowIntersectionPoints
=
"{Binding ElementName=Root, Path=ShowInfo}"
ShowTrackInfo
=
"{Binding ElementName=Root, Path=ShowInfo}"
SnapMode
=
"ClosestPoint"
/>
I would like to tweak the timeline to have it work as a "slider" for a video editing like behavior. I have made some tests and tweaks but there are a couple of points I don't manage to tweak:
1. Having a thumb position which can be set by click.
I have managed to display a bar that can move from code using the annotations and a negative margin but I would like to know if there is a way to make it work like a slider thumb (i.e. click or drag&drop)?
2. I have some trouble to find how to use custom interval type to display the text every X seconds but keep some ticks at a smaller interval (see timeline 1).
3. Is it possible to display only specific times (for example beginning and ending time) either on the ruler or as on timeline 3 image?
Note that I am using the NuGet packages and Fluent Dark Theme.
I'm trying to build a worksheet header section with will be roughly six row.
Where cell A1 will have a fontsize of 20 and in green.
Cell D1 will be a date and time as a string.
Cell A2 will have some data, A3 blank, A4 some string, A5 some string.
Row 7 have the column header.
Not clear on how this work. My test code failed. Not understanding how Telerik walks through Cell's rows and column. Can you help with what documentation to read and samples to use?
Hi,
we have a MVVM Scenario, where changes in the Raddiagram need to be reflected in the underlying viewmodel.
For shapes and connections that is easy, because we can implement IObservableGraphSource and contruct the necessary objects. ConnectionPoints however seem tricky. While moving a point triggers a ConnectionManipulationEvent, adding or deleting points via CTRL+Click apparently do not trigger this event?
I do realize that, even though it only exposes IList, ConnectionPoints is actually an ObeservableCollection and with this knowledge I can hack my way around this, but then adding a new Point causes this collection to reset and add all points one by one again, which is also not really what I want to do in my Viewmodel.
Is there an easier way to reflect these changes (adding/removing ConnectionPoints) back into the viewmodel properly, without having to create a custom ConnectionManipulationTool wihich notifies on such changes?
Thanks in advance!
Regards
I have a FilePathPicker with the FilePath property set to a two-way binding to a view-model property. Whenever (in code-behind) I set the corresponding bound property (and then Raise a PropertyChanged notification for it), the FilePath in the text box does not update, no matter what the UpdateSourceTrigger. I cannot understand why.
I went and wrote a test application and reproduced the same effect. Isn't the FilePath property supposed to work as a two-way binding?
Here is the XAML binding.
<
tk:RadFilePathPicker
FilePath
=
"{Binding ReportHeaderImagePath, Mode=TwoWay}"
IconVisibility
=
"Collapsed"
/>
And here is the bound property in the ViewModel
private
string
_reportHeaderImagePath;
public
string
ReportHeaderImagePath
{
get
=> Settings.ReportHeaderImagePath;
set
{
_reportHeaderImagePath = value;
RaisePropertyChanged(nameof(ReportHeaderImagePath));
}
}
When my code sets this ReportHeaderImagePath property to null or string.Empty, I can see the value being set in the debugger and I can see the PropertyChanged event being raised. But still the editor in the RadFilePathPicker does not change. The previous path stays there. I have to either manually edit it or click the little "X" button inside it.
I have tried setting the Binding's UpdateSourceTrigger value all possible choices Default, LostFocus, PropertyChanged and even Explicit. Nothing works.
What am I missing?
The SyntaxEditor is great! I'd like to use it inside a LayoutControl though, basically like this:
<telerik:RadLayoutControl >
<telerik:LayoutControlGroup Orientation="Vertical">
<telerik:LayoutControlGroup Orientation="Horizontal">
<telerik:LayoutControlSplitter />
<telerik:RadSyntaxEditor />
</telerik:LayoutControlGroup>
<telerik:LayoutControlSplitter />
</telerik:LayoutControlGroup>
</telerik:RadLayoutControl>
I have that working with a fixed size editor, but it would be much nicer if the editor resized when the splitters were moved. However, if I don't make the editor fixed size I get the error "Placing RadSyntaxEditor in a panel or control that measures it with infinite height is not supported unless height is set to the control".
Is there a work-around for this? If not, could you add support in a future release?
Regards,
Georg