Telerik Forums
UI for WPF Forum
0 answers
176 views

Hello.

There are two gridviews.

These gridviews are connected 1:1 with the row.
So I'm done with the vertical scrolling synchronization.

All data is now displayed.
When I check here, I want to show the contents of the gridview on the other side.

When the GridView Checkbox Column is unchecked, I want to make it impossible to see the contents of the grid view on the other side.

This should be done with Rows only and not all data.

What method do you have?

I attach an example.

In case of additional scroll sync, it is written as a code-behind. Can you change this to MVVM pattern?(How to get 2 gridview parameters since EventToCommandBehavior event is loaded?)

Thanks.

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 updated question on 05 Jan 2022
0 answers
343 views

I'm having some real struggles with RadComboBox ... 


<telerik:RadComboBox x:Name="ModelPicker"
                                 Width="150"
                                 Height="28"
                                 CanAutocompleteSelectItems="False"
                                 DisplayMemberPath="ModelNavn"
                                 IsEditable="True"
                                 IsEnabled="{Binding CanChangeVariant}"
                                 ItemsSource="{Binding Source={StaticResource SortedModels}}"
                                 OpenDropDownOnFocus="True"
                                 SelectAllTextEvent="GotFocus"
                                 SelectedItem="{Binding BrandModel.SelectedCarModel}"
                                 StaysOpenOnEdit="True" />

 

1. ComboBox is AutoSelecting first element when ItemsSource changes

ItemsSource is set to an ObservableCollection<model> and the DataContext implements INotifyPropertyChanged (pretty straight forward MVVM) 

I've tested and found that if I REPLACE the ObservableCollection instead of Clear() + Add() , the UI update is MUCH faster. 

eg:

ItemsSource="{Binding MyModels}"

MyModels = new ObservableCollection<model>(/* List of Models */); 

HOWEVER - this causes the RadComboBox to AutoSelect the first element !!!

(to be fair - this is actually also how Microsoft WPF ComboBox works) ..  :-( 

 

2. CanAutocompleteSelectItems="False" is ignored

On almost every keystroke I do when AutoCompleting / Filtering - the ComboBox selects whatever item is partially matching 

eg : list contains 1000, 114i, 114 and 114d 

if I write "1" then 1000 is selected,

if I write "114d" and delete "d" then 114 gets selected. 

I'm pretty sure that CanAutoCompleteSelectItems=false should prevent this ??

 

 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 04 Jan 2022
1 answer
207 views

Hello.

 

I'm trying to use the "Column Chooser" from the telerik SDK.

The SDK is in a state where both ID and Name can be controlled Visible.

I want to change a specific column to be fixed.

For example, ID and Name in the SDK example. I want only Name to be IsVisible, excluding ID from Listbox.
(ID is always shown)

Is it possible to simply control it in xaml? Or do I need extra work in the viewmodel?

I'm using the "declarative column definition method using the DataMemberBinding property set".

 

thanks.

 

Dilyan Traykov
Telerik team
 answered on 04 Jan 2022
0 answers
99 views

Hi,

I have tried sub-classing a RadSplitButton. But no functionalities is being inherited from the original button. So, there is no dropdown content showing (popup) when clicking on the dropdown button, Command gets not executed and so on.

Any suggestion on how to properly base a custom control on this Split button, please?

Avrohom
Top achievements
Rank 1
Iron
Iron
 updated question on 03 Jan 2022
1 answer
230 views

Hi

I created a main window with RadDocking with DocumentHost and some RadSplitContainer.
Now with a user interaction I show a modeless window: I'd like to give the user the ability to dock this window in main window as docking part.
In the first look example of RadDocking there is a initial floating RadSplitContainer, but I would that my floating part only show after the user click a button and it was initially hidden.

Also, if I close the initially visible flaoting part, then I can't reopen it.

This is the flow of visibility:
1) Launch the application: floating window is not visible
2) Click on some button: floating window is now visible
3) User can dock the floating window on mainwindow docking

This is the RadDocking piece of xaml:

<t:RadDocking x:Name="radDocking1"
                            RetainPaneSizeMode="DockingAndFloating"
                            CanAutoHideAreaExceedScreen="True"
                            Grid.Row="1" Margin="0 0 0 10"                            
                            BorderThickness="0"
							CloseButtonPosition="InPane"
                            Padding="0"
						  PaneStateChange="radDocking1_PaneStateChange">
<t:RadDocking.DocumentHost>
<some code>
</t:RadDocking.DocumentHost>
<t:RadSplitContainer>
<some code>
</t:RadSplitContainer>
<t:RadSplitContainer>
<some code>
</t:RadSplitContainer>
<some code>
<t:RadSplitContainer>
</t:RadSplitContainer>
<t:RadSplitContainer Name="ImpulsiFloatContainer" 
						InitialPosition="FloatingDockable"
						 t:DockingPanel.InitialSize="900,1340"									 
						 Visibility="{Binding ImpulsiViewVisible, Converter={StaticResource BoolToVis}}">
					<t:RadPaneGroup >
						<t:RadPane  Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.ImpulsiViewHeader}}">
							<local:ImpulsiViewControl />
						</t:RadPane>
					</t:RadPaneGroup>
				</t:RadSplitContainer>
			</t:RadDocking>

Thank you

Luigi

 

Stenly
Telerik team
 answered on 03 Jan 2022
2 answers
299 views

I'm using a ChartSeriesProvider to display multiple LineSeries charts. Everything is working well except the legend items. I would like the Title property to display each series name, but instead I'm getting the same series name (the first one) for all of the legend titles.

If I do it via XAML it works, as shown in your example:

<Setter Property="LegendSettings">
  <Setter.Value>
    <telerik:SeriesLegendSettings x:Name="jobsLegendSettings" Title="{Binding SeriesName}" />
  </Setter.Value>
 </Setter>

However, I must do it via code behind. Here is my current code which doesn't work (I only pasted the relevant code, I hope it's enough):

Style style = new Style();
descriptor.Style = style;
jobsSeriesProvider.SeriesDescriptors.Add(descriptor);
style.TargetType = typeof(Telerik.Windows.Controls.ChartView.LineSeries);
Binding binding = new Binding();
binding.Path = new PropertyPath("SeriesName");
binding.Source = JobsData;
SeriesLegendSettings legendSettings = new SeriesLegendSettings();
BindingOperations.SetBinding(legendSettings, SeriesLegendSettings.TitleProperty, binding);

var legendSetter = new Setter
{
	Property = Telerik.Windows.Controls.ChartView.LineSeries.LegendSettingsProperty,
	Value = legendSettings,
};
style.Setters.Add(legendSetter);  
BTW JobsData is the ObservableCollection which contains all of the different series view models, which have a property called SeriesName.

 

Stenly
Telerik team
 answered on 31 Dec 2021
1 answer
114 views

Hi,

I want to change the color of the hours,

I tried to change the Foreground in TimeRulerItem but it does not change my color.

I would love to help,

Thanks.

 

 

 

   <Style TargetType="telerik:TimeRulerItem">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="BorderBrush" Value="White"/>
        <Setter Property="BorderThickness" Value="0 1 0 0"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Panel.ZIndex" Value="50"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:TimeRulerItem">
                    <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                        <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
Stenly
Telerik team
 answered on 27 Dec 2021
4 answers
474 views

Dear Team,

Im kinda new in WPF, i switched from winform ~a year ago. I have to move one of my old projects from winform to WPF (VB.NET), and as i see the basic gridview is not too good, so im about to buy the radgridview from Telerik.

Im trying, and i cant solve one thing:

I have a 'datatable', which is passed to the radgridview as itemsource. The columns are partnumbers the rows are dates, and both are dynamic - i mean the number of both them are dynamic - so i cannot pre-define them, in the xaml, but i need to change the backgorund color for some cell, and the triggers can be several kind:

 - If cell was edited

 - If cell value < 0  

 - triggers which doenst depend on the data in the grid, comes from other datadatable, but i know which column and row has to be changed.  

 

Since virtualization is ON for rows and columns as well, if i just set the background color of the cell, and scroll away, the color disappears.

My approach (probably wrong):

--------------------------------------------------------------------

      Dim myDataGridRow As Telerik.Windows.Controls.GridView.GridViewRow = CType(dgw_FG.ItemContainerGenerator.ContainerFromItem(dgw_FG.Items(1)), Telerik.Windows.Controls.GridView.GridViewRow)
         Dim G As Telerik.Windows.Controls.GridView.GridViewCell = myDataGridRow.Cells(4)
        G.Background = New SolidColorBrush(Colors.Blue)

--------------------------------------------------------------------

Is there a way to recolor a cell background/foreground knowing only the X/Y coordinate of the filed on vb-code-side?

I suffered 3 days with this question, reading a lot of threads here... but i stuck. An example code would make me happy ;)

Thank you for your answer !!!

 

Peter B (Hungary)

 

Peter
Top achievements
Rank 1
Iron
Iron
 updated answer on 27 Dec 2021
1 answer
272 views

How can I use different colors for positive and negative values?

This is my XAML Code:

                    <telerik:RadCartesianChart x:Name="DashboardChart" FontSize="{telerik:FluentResource ResourceKey=FontSizeS}">
                        <telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:CategoricalAxis />
                        </telerik:RadCartesianChart.HorizontalAxis>
                        <telerik:RadCartesianChart.VerticalAxis>
                            <telerik:LinearAxis LabelInterval="5"/>
                        </telerik:RadCartesianChart.VerticalAxis>
                        <telerik:RadCartesianChart.Series>
                            <telerik:BarSeries x:Name="DashboardChartBarSeries" ValueBinding="Difference" >
                            </telerik:BarSeries>
                        </telerik:RadCartesianChart.Series>
                    </telerik:RadCartesianChart>

The data binding is done in the C# code:

this.DashboardChartBarSeries.DataContext = _localViewModel.Document;
 The values are displayed correctly. I would like to display negative values in red and positive values in green. How can I implement this?
Stenly
Telerik team
 answered on 27 Dec 2021
1 answer
290 views

Hello!

I'm working with the RadMaskedNumericInput for the first time (first time using masked inputs at all) and am in need of advice. I want to have the control's value be set to a default value if the user were to clear the control's input, then remove the focus.

I have the control set up like so:

<telerik:RadMaskedNumericInput x:Name="txtDaysValid" Width="30" Value="30"
                               Mask="d2" TextMode="PlainText" InputBehavior="Insert"
                               maskedInput:MaskedInputExtensions.Minimum="1"
                               UpdateValueEvent="LostFocus"
                               LostFocus="txtDaysValid_LostFocus"/>

And the event handler is:

var numericInput = sender as RadMaskedNumericInput;

if (string.IsNullOrWhiteSpace(numericInput.Text))
{
    numericInput.Value = 30;
    numericInput.Text = numericInput.Value.ToString();
}

This is the behaviour I'm currently experiencing:

  • Control Reads 30 -> User sets blank -> Control Reads blank (incorrect)
  • Control Reads 30 -> User sets to 12 -> Control Reads 12 -> User sets blank -> Control reads 30 (correct)
  • Control Reads 30 -> User sets to 12 -> Control Reads 12 -> User sets blank -> Control reads 30 -> User sets blank -> Control reads blank (incorrect)
  • Control Reads Blank -> User sets to 1 -> Control Reads 1 -> User sets blank -> Control Reads blank (incorrect)
  • Control Reads Blank -> User sets to 21 -> Control Reads 21 -> User sets blank -> Control Reads 30 (correct)

What am I missing here? It appears that updating the value and text directly only works in some cases. Is there a better approach to ensuring that when the user clears the input's field, that it defaults to a specific value upon losing focus?

Thanks!

Stenly
Telerik team
 answered on 27 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?