Telerik Forums
UI for WPF Forum
1 answer
136 views

I have a radgridiview with a selectcolumn and a datacolumn with a textbox embedded (not edit mode).

I would like that when the row is selected(selectcolumn) the textbox is focused.

How would i goabout doing that . Any assistance would be appreciated.

<telerik:RadGridView x:Name="GridPackages" Grid.Column="0" GridLinesVisibility="Both"  Grid.Row="3" ItemsSource="{Binding Packages}"  ShowGroupPanel="False"  AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" IsReadOnly="True" Margin="10" >
    <i:Interaction.Behaviors>
        <behaviors:SyncMultiSelectBehavior SelectedItems="{Binding SelectedPackages,Mode=TwoWay}" />
    </i:Interaction.Behaviors>
 
    <telerik:RadGridView.Columns>
        <telerik:GridViewSelectColumn />
        <telerik:GridViewDataColumn Header="UID" Width="Auto" IsFilterable="False" IsSortable="False" DataMemberBinding="{Binding UID}"  />
        <telerik:GridViewDataColumn IsFilterable="False" IsSortable="False" DataMemberBinding="{Binding Z_No}" Width="Auto" >
            <telerik:GridViewDataColumn.Header>
                <StackPanel>
                    <TextBlock Text="Part" />
                    <TextBlock Text="Number" />
                </StackPanel>
            </telerik:GridViewDataColumn.Header>
        </telerik:GridViewDataColumn>
 
        <telerik:GridViewDataColumn IsFilterable="False" IsSortable="False" DataMemberBinding="{Binding DestBin}" Width="Auto" >
            <telerik:GridViewDataColumn.Header>
                <StackPanel>
                    <TextBlock Text="Destination" />
                </StackPanel>
            </telerik:GridViewDataColumn.Header>
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <controls:InoTextBoxOsk Text="{Binding DestBin}" Loaded="FrameworkElement_OnLoaded"  />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>
 
        <telerik:GridViewDataColumn Header="Qty" Width="Auto" IsFilterable="False" IsSortable="False" TextAlignment="Right" DataMemberBinding="{Binding QtyOnHand}" />
        <!--<telerik:GridViewDataColumn Header="Extra0" IsFilterable="False" IsSortable="False" />
                                <telerik:GridViewDataColumn Header="Extra1" IsFilterable="False" IsSortable="False" />
                                <telerik:GridViewDataColumn Header="Extra2" IsFilterable="False" IsSortable="False" />
                                <telerik:GridViewDataColumn Header="Extra3" IsFilterable="False" IsSortable="False" />-->
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
Vladimir Stoyanov
Telerik team
 answered on 17 Mar 2021
1 answer
177 views

Hi, 

I would like to implement the RadImageEditor for a person to save a signatur. No editing or anything is required. I load the ImageEditor with an empty png and directly load the drawtool. I've inherited the default DrawTool to hide the UIElement (since I don't want to have those settings visible) but when I stop drawing I still get the OK/Cancel buttons.How can I hide those as well? Any drawing made can be committed directly.

 

Thanks!

Vladimir Stoyanov
Telerik team
 answered on 17 Mar 2021
2 answers
125 views

I'm using the WPF Telerik R3 2020 version. When ever the ribbon view is collapsed, it goes off screen and I don't know why. see the screenshot of the UI and code below. Using .NEt 4.8. 

 

Capture — ImgBB (ibb.co)

Capture — ImgBB (ibb.co)

 

Martin Ivanov
Telerik team
 answered on 17 Mar 2021
1 answer
126 views

All,

I have a radgridview bound to a collection of custom objects. Is it possible to bind the GridViewDataColumn.Header property to the class indexer ?

e.g. public string this[string field] { …… }

 

Thanks in advance

 

 

 

Vladimir Stoyanov
Telerik team
 answered on 17 Mar 2021
1 answer
197 views

This "WPF BusyIndicator | Developer Focused Examples | Telerik UI for WPF " sample set found at this url:

https://docs.telerik.com/devtools/wpf/controls/radbusyindicator/sdk-examples#list-of-all-radbusyindicator-sdk-examples

Tried to build this sample as WPF with the new "Telerik.Windows.Controls.for.Wpf.2021.1.223" library. The BusyIndicator does not appear. Nothing seems to happen.

Trying to understand how "RadBusyIndicator" works so it can be used in my application. 

 

Martin Ivanov
Telerik team
 answered on 17 Mar 2021
1 answer
156 views

Newbie attempting to use the Carousel control.  The defaults of the control work fine for my needs, but I want to change the number of panels in the control.  I only have 3 items that I want to use in the carousel, which are images.  However, by default the carousel has 5 or 6 panels.  I only want 3 panels for my 3 images in the carousel.  How do I change the number of panels in the carousel?

 

 

Dilyan Traykov
Telerik team
 answered on 16 Mar 2021
2 answers
190 views

Hello

I have an application that uses RadDocking with tabbed RadPanes containing RadGridViews. It appears that the default behaviour of RadDocking is to lazy load the contents and data of a pane only when the tab is selected - so the data in my RadGridViews is only loaded when a tab is brought into view.

So, in this example the DataLoaded event for FirstGrid will fire on startup as FirstTab is the pane in view. The Dataloaded event for SecondGrid will only fire when the user selects SecondTab and brings it into view:

<telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
        <telerik:RadPaneGroup>
            <telerik:RadPane
                x:Name="FirstTab"
                Title="First">
                <telerik:RadGridView
                    x:Name="FirstGrid"
                    ItemsSource="{Binding Items}"
                    AutoGenerateColumns="True"
                    DataLoaded="FirstGrid_DataLoaded"/>
            </telerik:RadPane>
            <telerik:RadPane
                x:Name="SecondTab"
                Title="Second">
                <telerik:RadGridView
                    x:Name="SecondGrid"
                    ItemsSource="{Binding Items}"
                    AutoGenerateColumns="True"
                    DataLoaded="SecondGrid_DataLoaded"/>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

 

Whilst I can see the benefit of this behaviour, my application has a requirement to ensure that all the data is loaded at startup - partly for performance purposes, but also for another reason.

Is there a way to override the default behaviour and force the contents of all the tabs to load on startup?

 

Thanks for any help

 

Dave

David
Top achievements
Rank 1
Veteran
 answered on 15 Mar 2021
2 answers
218 views

Hi, 

I have a WPF application in which we have made a trend component which should be able to a display a large amount of log values.

We have not been using Sampling until now. So the SamplingThreshold has always been 200 (as I understand is the default value). This makes some of of the trends misleading, since some of the lowest/highest values wont be displayed because they are clustered with other datapoints.

What we would like to to, is to set the SamplingThreshold depending on how many log values we have, and depending on what kind of screen resolution the user has (some of out customers computers are out in a lab environment and has something like a 1280 x 800 res).

My problem now however, is that I'm not able to bind the SamplingThreshold property. 


I have a generic.xaml which datacontext is a ChartViewViewModel. 

Generic:

<telerik:RadCartesianChart x:Name="PART_Chart" Zoom="{Binding ChartZoom, Mode=TwoWay}" PanOffset="{Binding ChartPanOffset, Mode=TwoWay}">
    <telerik:RadCartesianChart.TrackBallInfoStyle>
        <Style TargetType="telerik:TrackBallInfoControl">
            <Setter Property="Header" Value="{Binding DataContext.TrackBallHeader, RelativeSource={RelativeSource AncestorType=local:ChartView}}" />
        </Style>
    </telerik:RadCartesianChart.TrackBallInfoStyle>
    <telerik:RadCartesianChart.Resources>
        <DataTemplate x:Key="trackBallInfoTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding DataPoint.Presenter.DataContext.Title}"/>
                    <TextBlock Text=": " />
                    <TextBlock Text="{Binding DataPoint.Value, Converter={StaticResource TrimToTwoDecimalsConverter}}" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="PointCustomTemplate">
            <Ellipse Height="3" Width="3" Fill="{Binding DataContext.Color, RelativeSource={RelativeSource AncestorType=telerik:PointSeries}}"/>
        </DataTemplate>
        <Style TargetType="telerik:LinearAxis">
            <Setter Property="LabelTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="{telerik:VisualStudio2013Resource ResourceKey=MarkerBrush}"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="telerik:DateTimeContinuousAxis">
            <Setter Property="LabelTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="{telerik:VisualStudio2013Resource ResourceKey=MarkerBrush}"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="telerik:LineSeries">
            <Setter Property="StrokeThickness" Value="1" />
            <Setter Property="Stroke" Value="{Binding Color}" />
            <Setter Property="TrackBallInfoTemplate" Value="{StaticResource trackBallInfoTemplate}" />
            <Setter Property="VerticalAxis" Value="{Binding Axis}" />
            <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource VisibilityConverter}}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsSelected}" Value="true">
                    <Setter Property="Opacity" Value="1" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsSelected}" Value="false">
                    <Setter Property="Opacity" Value="0.2" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="telerik:SplineSeries">
            <Setter Property="StrokeThickness" Value="1" />
            <Setter Property="Stroke" Value="{Binding Color}" />
            <Setter Property="TrackBallInfoTemplate" Value="{StaticResource trackBallInfoTemplate}" />
            <Setter Property="VerticalAxis" Value="{Binding Axis}" />
            <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource VisibilityConverter}}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsSelected}" Value="true">
                    <Setter Property="Opacity" Value="1" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsSelected}" Value="false">
                    <Setter Property="Opacity" Value="0.2" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="telerik:StepLineSeries">
            <Setter Property="StrokeThickness" Value="1" />
            <Setter Property="Stroke" Value="{Binding Color}" />
            <Setter Property="TrackBallInfoTemplate" Value="{StaticResource trackBallInfoTemplate}" />
            <Setter Property="VerticalAxis" Value="{Binding Axis}" />
            <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource VisibilityConverter}}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsSelected}" Value="true">
                    <Setter Property="Opacity" Value="1" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsSelected}" Value="false">
                    <Setter Property="Opacity" Value="0.2" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="telerik:PointSeries">
            <Setter Property="PointTemplate" Value="{StaticResource PointCustomTemplate}"></Setter>
            <Setter Property="TrackBallInfoTemplate" Value="{StaticResource trackBallInfoTemplate}" />
            <Setter Property="VerticalAxis" Value="{Binding Axis}" />
            <Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource VisibilityConverter}}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsSelected}" Value="true">
                    <Setter Property="Opacity" Value="1" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsSelected}" Value="false">
                    <Setter Property="Opacity" Value="0.2" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </telerik:RadCartesianChart.Resources>
    <telerik:RadCartesianChart.TrackBallLineStyle>
        <Style TargetType="Polyline">
            <Setter Property="Stroke" Value="Black" />
            <Setter Property="Opacity" Value="{Binding IsTrackballVisible, Converter={StaticResource BoolToOpacityConverter}}"/>
        </Style>
    </telerik:RadCartesianChart.TrackBallLineStyle>
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartPanAndZoomBehavior x:Name="PART_PanAndZoomBehavior" ZoomMode="Both" PanMode="Both" />
        <telerik:ChartTrackBallBehavior x:Name="PART_ChartTrackBallBehavior" ShowIntersectionPoints="{Binding IsTrackballVisible}" ShowTrackInfo="{Binding IsTrackballVisible}"  />
    </telerik:RadCartesianChart.Behaviors>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeContinuousAxis MajorStepUnit="{Binding MajorStepUnit}" MajorStep="{Binding MajorStep}" LabelFormat="{Binding HorizontalAxisLabelFormat}" LabelFitMode="MultiLine" />
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.SeriesProvider>
        <telerik:ChartSeriesProvider Source="{Binding Series}">
            <telerik:CategoricalSeriesDescriptor CategoryPath="LoggingTime"
            ValuePath="Value"
            ItemsSourcePath="LogValues"
            TypePath="SeriesType"
            TypeConverter="{StaticResource SeriesTypeConverter}" >
                <telerik:CategoricalSeriesDescriptor.ChartDataSourceStyle>
                    <Style TargetType="telerik:ChartDataSource" >
                        <Setter Property="SamplingThreshold" Value="20"/>
                    </Style>
                </telerik:CategoricalSeriesDescriptor.ChartDataSourceStyle>
            </telerik:CategoricalSeriesDescriptor>
        </telerik:ChartSeriesProvider>
    </telerik:RadCartesianChart.SeriesProvider>
</telerik:RadCartesianChart>

 

The code above works as intended, setting the value to SamplingThreshold 20.

Now I want to bind the SamplingThreshold to the ViewModel like below. ChartView is what works as the code behind where the DataContext is set to the ChartViewViewModel.

<telerik:RadCartesianChart.SeriesProvider>
    <telerik:ChartSeriesProvider Source="{Binding Series}">
        <telerik:CategoricalSeriesDescriptor CategoryPath="LoggingTime"
        ValuePath="Value" 
        ItemsSourcePath="LogValues"
        TypePath="SeriesType"
        TypeConverter="{StaticResource SeriesTypeConverter}" >
            <telerik:CategoricalSeriesDescriptor.ChartDataSourceStyle>
                <Style TargetType="telerik:ChartDataSource" >
                    <Setter Property="SamplingThreshold" Value="{Binding DataContext.SamplingThresholdValue, RelativeSource={RelativeSource AncestorType=local:ChartView}}"/>
                </Style>
            </telerik:CategoricalSeriesDescriptor.ChartDataSourceStyle>
        </telerik:CategoricalSeriesDescriptor>
    </telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>
public ChartView()
{
    this.DefaultStyleKey = typeof(ChartView);
    var container = ChartViewContainerFactory.CretateContainer(DesignerProperties.GetIsInDesignMode(this));
    viewModel = container.Resolve<IChartViewViewModel>();
    DataContext = viewModel;
}

 

And in the ViewModel the SamplingThresholdValue is set to 20 in the constructor. 
But if I try to get the SamplingThreshold from the CategoricalSeriesDescriptor Style in code behind after the chart is loaded, the value for SamplingThreshold is always unset when it's binded.
I understand that the SamplingThreshold cant be changed when the trend is loaded. But if the value is set in the ViewModel before its loaded, it should be able to find the correct value.

I have also tried the approach where you create a ChartDatasource:

<telerik:ChartDataSource x:Name="chartDataSource1" ItemsSource="{Binding Series}" SamplingThreshold="20"/>

 

Then bind the Seriesprovider to the DataSource:

<telerik:ChartSeriesProvider Source="{Binding ElementName=chartDataSource1}">

 

But when I try this the SamplingThreshold value of 20 set directly in the ChartDataSource won't even be used. It still is unset and has the default value of 200.
All I want to do is to be able to set the SamplingThreshold dynamicly before the chart itself is loaded.
Do you have any idea what I might do wrong here?

Kind Regards, Johannes

Johannes
Top achievements
Rank 1
 answered on 15 Mar 2021
3 answers
131 views

Hello,

I am using your WatermarkTextBox inside a RadToolBar.The property 'WatermarkBehavior' is set to 'HiddenWhenFocused'.

Now when I am click on an area outside the RadToolBar, the Watermark text isn't reset due to the LostFocus-Event for the control is not called.

Can you help me with a workaround for that?

Thanks!

Tobias

Dilyan Traykov
Telerik team
 answered on 15 Mar 2021
1 answer
132 views

The context menu of RadOpenFolderDialog causes multiple exceptions, e.g. an arithmetic overflow.

Here are the steps to reproduce with the demo application:

   - Select a folder

   - Create new folder

   - Right click on new folder and delete it

 

When I'm  trying to use the context menu from my own application, than my application crashes immediately.

And a minor problerm: For some reason the navigation buttons in the upper left part of the dialog are missing in my application. Any idea how to solve this?

 

Thanks,

Michael

Martin Ivanov
Telerik team
 answered on 15 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?