Telerik Forums
UI for WPF Forum
2 answers
23 views

Dear Teleriker,

I have a grid using RadGridView with grouping like below image.

I developed a context menu based on the GridViewHeaderCell.

Actually, I would have the behavior like that: When I click on an item of Context Menu (Expand All or Collapse All), it will expand/collapse only the sub-groups which are under the same group.

For example, in the image below, as I'm currently on the group "Cash" of group parent "Asset...Pictet & Cie (Suisse)", I expect that it will close all the groups under the group parent "Asset...Pictet & Cie (Suisse)" (like:Cash, Share, Bonds...) but let expanded other groups (like: group "Cash" under group parent "Asset...First Americain National Bank".

 

 

Is there any solution for that?

Many thanks for your help,

Minh

minh
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 21 Jul 2022
1 answer
21 views
is it possible to select two locations which is displaying on the radmap and draw a curve line. initially a simple straight line needs to be drawn and then user can select the line between the locations and change it to a curve by dragging the line. Currently we achieved placing the marker on the radmap.
Petar Mladenov
Telerik team
 answered on 20 Jul 2022
0 answers
13 views

Tried to adapt the ScheduleView and TimeBar (MiniMap) example. from the WPF Example Controls App.

As in the example the ScheduleView and TimeBar lie in the same column. As in the example TimeBars VisiblePeriodStart is bound to CurrentDate of MiniMapScheduleView. Visible Days of MiniMapScheduler are calculated by a Converter from TimeBar VisiblePeriod..

The problem is that the underlying ScheduleView is only updating its view when clicking on the TimbeBar (even on startup/when itemsource is new bound)).

When scrolling or zooming in the TimeBar all shown MiniMap appointments vanish except the ones which are in the area "selected" by the TimeBer Selector. 

Only when clicking again in the TImeBar (Selection) all MIniMap appointment appear again.

in the mentioned example the underlying ScheduleView updates instant and accordingly to the timebars zoom level.

Tried already:

Manually Update Scheduler (UpdateLayout() etc. in VisiblePeriodChanged- no effect.

Copied the bound Appointments observable collection from the MasterScheduleView to an own MiniMapAppointmentsCollection (thought had maybe something to do with virtuilaziation) - no effect.

Automatically updating the view when changing the underlying parameters (ItemsSource,VisiblePeriod, VisibleDays etc. etc) should be something very essential, am i missing something?

 

 

 

Technik
Top achievements
Rank 1
 asked on 20 Jul 2022
0 answers
13 views

The NavigationPane is not shown in the following example.

I "almost" follewed the description. I removed DataContext to get my pdf file rendered.

 

<Grid

<Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition/> </Grid.RowDefinitions>

 <telerik:RadPdfViewerToolBar RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}"/> <Grid Grid.Row="2"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition/> </Grid.ColumnDefinitions> <telerik:RadPdfViewerNavigationPane Grid.Column="0" RadPdfViewer="{Binding ElementName=pdfViewer, Mode=OneTime}" PaneWidth="300" /> <telerik:RadPdfViewer Grid.Column="1" x:Name="pdfViewer" DocumentSource="{Binding PdfFileName, Mode=OneWay, Converter={StaticResource PdfDocumentSourceValueConverter}, ConverterParameter=ReadOnDemand}" RenderOptions.BitmapScalingMode="NearestNeighbor"/> </Grid> </Grid>

Axel
Top achievements
Rank 1
 asked on 18 Jul 2022
0 answers
8 views

Hi Telerikers,

I have a RadCartesianChart with 2 series: Line and Bar. I would expect that the labels of LineSeries should be out of the bar item zone.

Below is my current situation with the red highlighted in the problem. All I need is to put out the label "-0.02%" from the orange bar item zone.

I would be much appreciated if you guys have a solution for that.

Many thanks in advance.

minh
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 15 Jul 2022
1 answer
28 views

Windows 11 build 22000.795

XAML Code:

<telerik:RadWindow x:Class="WpfApp1.MainWindow" 
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
                   xmlns:helpers="clr-namespace:Telerik.Windows.Controls.Theming.Helpers;assembly=Telerik.Windows.Controls" 
                   helpers:WindowEffectsHelper.BackdropMaterial="Acrylic" 
                   Header="RadWindow" Style="{StaticResource RadWindowStyle}" Width="400" Height="400">
    <Grid>
        
    </Grid>
</telerik:RadWindow>

 

App.xaml file:
<Application x:Class="WpfApp1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:WpfApp1"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Input.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Data.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

App.xaml.cs file:

using System.Windows;

namespace WpfApp1
{
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            new MainWindow().Show();
            base.OnStartup(e);
        }
    }
}

Result - see in attachment (no effect)

 

 

Vicky
Telerik team
 answered on 14 Jul 2022
0 answers
5 views

I have a number of xaml files that are are using telerik masked inputs, specifically

  • telerik:RadMaskedDateTimeInput
  • telerik:RadMaskedNumericInput

and will likely be using more. These are being used to make sure the user is entering the correct input. Once the user enters the input the input data needs to run through a multiconverter. I have not been able to find a solution to bind the input data to a muliconverter. Is this possible?

I have been able to make this work in the RadGrid columns using the published work around which does not work in this context and am looking for either a way to make this work or if this is even possible.

For example, below is one of the date time inputs. How can the bound data, singleSpeedDataInt, be run through a multi binding converter?

   <telerik:RadMaskedDateTimeInput
                                                     IsEnabled="{Binding singleSpeed.UseDataInt, Mode=OneWay}"
                                                     IsClearButtonVisible="false"
                                                     Placeholder=""
                                                     Mask="HH:mm:ss"
                                                     Height="36"
                                                     Width="120"
                                                     Margin="8,0,0,0"
                                                     Value="00:01:00"
                                                     Text="{Binding singleSpeed.DataInt, Mode=TwoWay}" />
  
Paul
Top achievements
Rank 1
 asked on 14 Jul 2022
0 answers
9 views

What do I need to change for me to see the Subject above correctly?

And how do I make each AppointmentItem (in MonthView) double the size from now on?

 

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 14 Jul 2022
1 answer
14 views

I want to do something in the style of Outlook so that the change (in terms of design) of working hours can be noticed

 

Krasimir Balchev
Telerik team
 answered on 13 Jul 2022
1 answer
8 views


I'm binding my GridView to a custom report class with records.   The `Report`class has a list of field types that is not known until runtime.  It exposes an array of `Record` objects.  The Record class derives from System::DynamicObject.  Binding an IEnumerable<Record> to GridView is pretty easy with the AutoGenerateColumns turned on.    (Note this code is C++/CLI but the client code that uses it is C#/WPF/XAML)

public ref class Record 
    : public DynamicObject
{
    int     m_row;
    Report^ m_rep;

public:
    Record(Report^ rep, int row);
#pragma region DynamicObject Overrides
    virtual bool TryGetMember(GetMemberBinder^ binder, [SRI::Out]Object^% obj) override;
    virtual bool TrySetMember(SetMemberBinder^ binder, Object^ value) override;
    virtual IEnumerable<String^>^ GetDynamicMemberNames () override;
    virtual bool TryGetIndex(GetIndexBinder^ binder, array<Object^>^ indices, [SRI::Out]Object^% result) override;
#pragma endregion 
    
    property Object^    default[int]  { Object^ get(int idx); }
    property Object^    default[String^] { Object^ get(String^ name); }
};

The problem is that when I bind it, this way, the values displayed just use the default `ToString()` method of each object.  That's not going to work.  I need to use DataTemplates, For example, I want any double value to use 3 decimal places. 


<tk:RadGridView.Resources>
    <DataTemplate x:Key="MyDoubleTemplate" DataType="{x:Type sys:Double}">
        <Label ContentStringFormat="{}{0:F3" Content="{Binding}"/>
    </DataTemplate>
</tk:RadGridView.Resources>


So I tried adding a handler for the `AutoGeneratingColumn` column event.  In the handler and explicitly specifying the `CellTemplate` to be used for each column.  (I named the templates in XAML and then loaded them directly via TryFindResource)

private void GridView_OnAutoGeneratingColumn(object? sender, GridViewAutoGeneratingColumnEventArgs e)
{
    if (e.Column is not GridViewDataColumn col)
        return;
    
    var name = col.DataMemberBinding.Path.Path;

    if (!TryGetField(name, out var field, out var rep))
        return;

    // Based on the field type, use a default DataTemplate that we previously loaded via TryFindResourcee

    switch (field.PropType)
    {
    case PropType.Double:  col.CellTemplate = DoubleTemplate; col.DataType = typeof(double); break;

// NOTE: Other types/templates not shown for brevity. default: e.Cancel = true; break; // Some type we don't recognize } col.CellEditTemplate = null; }


But this fails too.  The value supplied to my `DataTemplate' binding is not the individual record field double value, it is the entire Record object.     Likewise every other template reports errors because it is expecting the individual column double/int/string, etc but instead getting the whole `Record` object.

Next I tried using the CellTemplateSelector approach.,  I created one and then set THAT in the event handler above.  But the problem remained the same.  The selector's SelectTemplate method was receiving an object of type Record  

 OK, then I looked at your XAML-SDK where you show a nice example of binding to `ICustomTypeDescriptor`  (the BindingToCustomTypeDescriptor example).  That was a lot of work.  I made my Record class implement that interface just as in your exmaple.  I see its methods being called..  Hooked it up to the GridView. 

But results are exactly the same.  GridView still supplies the Record value instead of the individual cell value to the bindings.

Please tell me what I am doing wrong...



 


Petar Mladenov
Telerik team
 answered on 13 Jul 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Toby
Top achievements
Rank 3
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Veteran
Bernd
Top achievements
Rank 4
Bronze
Iron
Iron
minh
Top achievements
Rank 2
Iron
Iron
Iron
Sebastien
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Toby
Top achievements
Rank 3
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Veteran
Bernd
Top achievements
Rank 4
Bronze
Iron
Iron
minh
Top achievements
Rank 2
Iron
Iron
Iron
Sebastien
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?