public class CustomKeyboardCommandProvider : DefaultKeyboardCommandProvider
{
private GridViewDataControl parentGrid;
public CustomKeyboardCommandProvider(GridViewDataControl grid)
: base(grid)
{
this.parentGrid = grid;
}
public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
{
List<ICommand> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
if (key == Key.Enter)
{
commandsToExecute.Clear();
commandsToExecute.Add(RadGridViewCommands.CommitEdit);
commandsToExecute.Add(RadGridViewCommands.BeginInsert);
commandsToExecute.Add(RadGridViewCommands.CommitEdit);
this.parentGrid.ChildrenOfType<GridViewScrollViewer>().First().ScrollToEnd();
}
return commandsToExecute;
}
}
Is there a way to drag from a radtreeview control and get the drop event in a C++ Windows window. We do get the event, but we do not know how to get access to the data. Can we override the drag and drop and do our own implementation?
Mike
RadGridView when source is RadDataPager + IQueryable/QueryableCollectionView:
RadGridView when source is RadDataPager + QueryableDataServiceCollectionView:
Why is the filter list empty when using IQueryable/QueryableCollectionView and how to fix this? Sample attached.
WPF Chart - Empty Values - Telerik UI for WPF
I have added link for EmptyPointBehaviour for wpf but it's available for windows, I want to implement same for wpf or uwp xaml UI.
Hi,
I use this behavior to manage multiple selection on radgridview (with selection mode = "extended" and with GridViewSelectColumn)
It works but when I try to initialize the selection with some items at the end of initialization I receive the OnSelectionChanged that remove all the elements selected but the first.
public class GridViewMultiSelect : Behavior<RadGridView>
{
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.DataContextChanged += OnDataContextChanged;
AssociatedObject.SelectedItems.CollectionChanged += OnSelectedItemsChanged;
AssociatedObject.SelectionChanging += OnSelectionChanged;
AssociatedObject.Items.CollectionChanged += OnItemsChanged;
}
private void OnSelectionChanged(object? sender, SelectionChangingEventArgs e)
{
}
private void OnItemsChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
}
private void Select(IEnumerable<NsMisuraViewWithType> misure)
{
foreach (var item in misure)
{
AssociatedObject.SelectedItems.Add(item);
}
}
private void OnDataContextChanged(object? sender, DependencyPropertyChangedEventArgs e)
{
if (AssociatedObject.DataContext is LoadedMeasurmentsVM viewModel)
{
viewModel.SelectAction = Select;
SetSelectMeasurements();
}
}
private void SetSelectMeasurements()
{
if (AssociatedObject.DataContext is LoadedMeasurmentsVM viewModel)
{
foreach (var item in AssociatedObject.SelectedItems)
{
if (viewModel.SelectedMeasurements.All(m => m.Misura.Id != ((NsMisuraViewWithType)item).Misura.Id))
{
viewModel.SelectedMeasurements.Add((NsMisuraViewWithType)item);
}
}
}
}
private void OnSelectedItemsChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
SetSelectMeasurements();
}
protected override void OnDetaching()
{
base.OnDetaching();
AssociatedObject.DataContextChanged -= OnDataContextChanged;
AssociatedObject.SelectedItems.CollectionChanged -= OnSelectedItemsChanged;
}
}
Hi,
in my project there is one RadGridView is present. Inside it there is GridViewComboBoxColumn but whenver I am selecting other item from that comboboxcell, binded property setter is not being called and as a result datacontext also remains same.
But whenever cell of that combobox column loses the focus property setter is called and as a result datacontext is fixed.
So, I found one workaround that is I added UpdateSourceTrigger=PropertyChanged property for my DataMemberBinding like below:
DataMemberBinding="{Binding ****, UpdateSourceTrigger=PropertyChanged}"
So it started working whenever I am selecting other item from that comboboxcell, binded property setter is being called and as a result datacontext also updated.
But the issue is that whenever comboboxcell loses its focus then again binded property setter is called the second time, which I don't want.
<telerik:HtmlDataProvider RichTextBox="{Binding ElementName=radRichTextBox}" Html="{Binding MyRichText, Mode=TwoWay, NotifyOnValidationError=true, TargetNullValue='', ValidatesOnExceptions=true}">
<telerik:HtmlDataProvider.FormatProvider>
<telerik:HtmlFormatProvider>
<telerik:HtmlFormatProvider.ExportSettings>
<telerik:HtmlExportSettings DocumentExportLevel="Fragment"
ImageExportMode="AutomaticInline"
StyleRepositoryExportMode="DontExportStyles"
StylesExportMode="Inline"
ExportEmptyDocumentAsEmptyString="True"
/>
</telerik:HtmlFormatProvider.ExportSettings>
</telerik:HtmlFormatProvider>
</telerik:HtmlDataProvider.FormatProvider>
</telerik:HtmlDataProvider>
<telerik:RadRichTextBox x:Name="radRichTextBox" DocumentInheritsDefaultStyleSettings="True" Foreground="black" FontFamily="Times New Roman" FontSize="12" Padding="10">
</telerik:RadRichTextBox>