Telerik Forums
UI for WPF Forum
1 answer
9 views

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. 

Martin Ivanov
Telerik team
 answered on 21 May 2024
1 answer
9 views

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;
	}
}
Dimitar
Telerik team
 answered on 21 May 2024
0 answers
9 views

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.

Shraddha
Top achievements
Rank 1
 asked on 21 May 2024
0 answers
10 views
I have a telerik radRichTextbox that I need to set some defaults on for all areas that it is dynamically generated but nothing I am doing is working.

Here is my XAML set up below.
        <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>


What is the proper way to default to SINGLE line spacing and fontsize 12 with font family of Times New Roman?

Obviously the user should be able to change if they wish but I need it to atleast default initially to these values.
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 17 May 2024
1 answer
14 views

How can I show animation like the following video in diagram control with pause and play option?

Which control is used in the following image?

Martin Ivanov
Telerik team
 answered on 16 May 2024
1 answer
15 views

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.

 

Please suggest fixes for this one.

 

Also is there any way to manually update datacontext ? If yes then how to retrieve changed places and how to update them in datacontext using selection change listener?

Dimitar
Telerik team
 answered on 16 May 2024
0 answers
10 views
When the RadDocking control is added, the window will blank for a moment and then display normally
Telerik
Top achievements
Rank 1
 updated question on 16 May 2024
0 answers
8 views
I am trying to customize the style of a RadRichTextBox. Previously with the standard RichTextBox you could target Textbox base and do a datatrigger to bind to IsKeyboard focused in XAML to change the background if the user had clicked inside the richtextbox to insert or type.

Does the RadRichTextBox have something similar? How can I check to see if it is selected?
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 15 May 2024
1 answer
14 views

Hi, I followed the steps on how to save / load filters on my c# WPF app from this link and it is working correctly

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-save-and-load-filter-settings

My grid is filtered and it works for all the columns (Just in case it wasn’t clear, the grid is indeed filtered by Source and Order Id). For all the fields that are strings, the filters look good when it shows:

But the fields that are enums, The header shows the icon as if a filter has been applied, but when it shows me the list, the values are not checked:


Code:

<telerik:RadGridView 
    x:Name="DesignQueueOrderGridView"
    ShowGroupPanel="False" 
    AutoGenerateColumns="False" 
    ItemsSource="{Binding FilteredDesignQueueOrderViewModels}"
    RowDetailsVisibilityMode="Visible"
    RowIndicatorVisibility="Collapsed"
    Grid.Row="1"
    VerticalAlignment="Top"
    RowStyle="{StaticResource RowStyleOdd}" 
    AlternationCount="2" 
    AlternateRowStyle="{StaticResource RowStyleEven}"
    CanUserSortColumns="False">

 

<telerik:GridViewDataColumn 
        UniqueName="ImageSource"
        Header="Source"
        HeaderTextAlignment="Center"
        DataMemberBinding="{Binding ImageSource}"
        IsReadOnly="True">

<telerik:GridViewDataColumn DataMemberBinding="{Binding UserId}" UniqueName="UserId"

                

                            HeaderTextAlignment="Center" 
                            Header="User Id" 
                            IsReadOnly="True"/>

              </telerik:GridViewDataColumn>

Enum:

[DataContract]
public enum ImageSource
{
    [EnumMember]
    Unknown = 0,

    [EnumMember]
    OnlineDesigner = 1

}

public void LoadColumnFilters(IList<FilterSetting> savedSettings)
{
    Application.Current.Dispatcher.Invoke(() =>
    {
        GridViewDataControl.FilterDescriptors.SuspendNotifications();

        foreach (FilterSetting setting in savedSettings)
        {
            Telerik.Windows.Controls.GridViewColumn column = GridViewDataControl.Columns[setting.ColumnUniqueName];

            if (column is null)
                continue;

            IColumnFilterDescriptor columnFilter = column.ColumnFilterDescriptor;

            if (setting.SelectedDistinctValues is not null)
            {
                foreach (string? distinctValue in setting.SelectedDistinctValues)
                {
                    columnFilter.DistinctFilter.AddDistinctValue(distinctValue);
                }
            }
        }

        GridViewDataControl.FilterDescriptors.ResumeNotifications();
    });
}

 

Thank you in advance! Juan

Martin Ivanov
Telerik team
 answered on 13 May 2024
0 answers
15 views

Hi.

Is it possible to have a RadGridView with Grouping, Virtualization and still have Content based scrolling (CanContentScrol=true)?

We have a rather big List of Items with unequal height. The List is dynamically managed based on the state of an external peripheral. List Items are added or removed when the state of the peripheral changes. This leads to unwanted movement of the Items in the List.

We are trying to encounter Item movement when the List changes. We implemented a solution similar to this one: Keep Selected Item in Viewport when Collection Changes - Telerik UI for WPF 

But when enabling Grouping or Sorting, the RadGridView seems to change to pixel based scrolling instead of Item based scrolling. Then it seems the above solution is not working anymore, because the Offset then needs to be given in Pixels instead of Items.

Is it possible to have Item based scrolling despite Grouping or Sorting?

Else is it possible to get the height of the inserted/removed Item to calculate the offset needed, even if Virtualization is enabled?

Or is possibly some other approach better suited?

Johannes
Top achievements
Rank 1
 asked on 13 May 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?