Telerik Forums
UI for WPF Forum
1 answer
222 views

I use RadDateTimePicker  in GanttView like the example "GanttView ", but the theme not work.

My themes is windows8, but not work in RadDateTimePicker .

my xaml is:

       <telerik:RadGanttView x:Name="ganttview" TasksSource="{Binding Tasks}" BorderBrush="#FFD6D4D4"
				BorderThickness="1 0 1 1" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
				VisibleRange="{Binding VisibleRange}" HighlightedItemsSource="{Binding HighlightedItems}" Grid.Row="1"
				Margin="0 6 0 0"
				PixelLength="{Binding PixelLenght, Mode=TwoWay}">
            <telerik:RadGanttView.Columns>
                <telerik:TreeColumnDefinition Header="Title" MemberBinding="{Binding Title}" Width="240">
                    <telerik:TreeColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" telerik:TouchManager.TouchMode="None" />
                        </DataTemplate>
                    </telerik:TreeColumnDefinition.CellEditTemplate>
                </telerik:TreeColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding Start}" Header="Start" Width="120">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadDateTimePicker SelectedValue="{Binding Start, Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding End}" Header="End" Width="120">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadDateTimePicker SelectedValue="{Binding End, Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding Progress}" Header="Progress" Width="AutoHeaderAndContent">
                    <telerik:ColumnDefinition.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadNumericUpDown Value="{Binding Progress, Mode=TwoWay}" CustomUnit="%" Minimum="0"
									Maximum="100" telerik:TouchManager.TouchMode="None" />
                        </DataTemplate>
                    </telerik:ColumnDefinition.CellEditTemplate>
                </telerik:ColumnDefinition>
                <telerik:ColumnDefinition MemberBinding="{Binding IsMilestone}" Header="IsMilestone" Width="100" />
            </telerik:RadGanttView.Columns>
        </telerik:RadGanttView>

 

Thanks for your help

Stenly
Telerik team
 answered on 19 Aug 2021
0 answers
437 views

So, this isn't something that comes up everywhere in my project but seems similar to https://www.telerik.com/forums/pathbutton-pathgeometry-error-glyph-has-an-incompatible-type but also different. In all of the following cases, I get the error `The resource "<glyphname>" has an incompatible type.` at design-time as well as not seeing the glyph in the XAML Designer:

<TextBlock FontFamily="{StaticResource TelerikWebUI}" Text="{StaticResource GlyphArrowUpward}" />

<Grid Width="16" Height="16">
	<Path Fill="Black" Data="{telerik:RadGlyph Glyph={StaticResource GlyphArrowUpward},Type=Path}" />
</Grid>

<Image Width="16" Height="16" Source="{telerik:RadGlyph Glyph={StaticResource GlyphArrowUpward}}" />

<telerik:RadGlyph Glyph="{StaticResource GlyphArrowUpward}" />

I have attempted all 4 of the above within the content of a WPF Button as well as a Telerik RadButton.

Strangely, I am able to use the last one as the content of RadFilePathPicker.ShowDialogButtonContent and don't get any errors and see the glyph just fine in the XAML Designer.

I have the proper resource dictionary within my App.xaml inside the ResourceDictionary.MergedDictionaries portion of it. I assume I wouldn't be getting the glyphs otherwise. I am using Visual Studio 2019 16.11.1 and I use Telerik UI for WPF via Telerik's NuGet packages, currently on 2021.1.325 (I cannot update past that), but I was having this issue with earlier versions as well. I also attempted to follow the directions in the help article linked in the above forum question. The problem persists even after all of that.

I don't necessarily need this fixed, it is more of an annoyance than a showstopper. But if there is some solution to this, that would be nice.

CyberBotX
Top achievements
Rank 2
Veteran
 asked on 17 Aug 2021
1 answer
365 views

Hello

I have a question regarding highlighting of selected item in navigation view. I noted a behavior in context of subitems where I'm not sure if it behaves like designed or if it is a bug. With term "highlight" I mean the small colored block that appears at the selected item.

For demonstration I used from WPF Demos the "Sub Items" example. Attached there is a Windows steps recorder session (can be opened with e.g. Internet Explorer) that contains screenshots from every click and I can refer to the step numbers.

I can observe the behavior when navigation view is collapsed (shows only icons).

Short:

After a subitem was selected the highlight is not shown anymore when selecting the corresponing (main)item.

 

Long:

First I switch between different items with and without subitems. Everything is like expected, the selected item shows the highlight (Step 1 - Step 12).

Then I select a subitem. Still, highlight is shown at (main)item (Step 13- Step 14).

Next I click on another item that still behaves fine (Step 15)

Now, when I click again on the (main)item, where I selected the subitem before, the highlight is not shown anymore (Step 16)

I can click on the item several times. Just the subitems (dis)appear but no highlight (Step 17 - 19)

Only when I select a subitem the highlight appears (Step 20 - Step 21)

Again, click on (main)item, it is selected but no highlight (Step 22 - Step 24)

 

Is this behavior intended? If so, can someone explain me the idea behind it. For me it feels strange at the moment.

 

Thanks and regards

Philipp

 

Martin Ivanov
Telerik team
 answered on 16 Aug 2021
1 answer
667 views

Hi

I am using wpf grid view as shown below. 


 <telerik:RadGridView Grid.Row="1" ItemsSource="{Binding ExistingFilesCollection}" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserGroupColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserSearch="False" ShowGroupPanel="False" IsFilteringAllowed="False" 
                             AutoGenerateColumns="False" SelectionMode="Extended"   Margin="0,10,0,0" GridLinesVisibility="Both" RowIndicatorVisibility="Collapsed">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Selected, Mode=TwoWay}"  IsSortable="False">
                    <telerik:GridViewDataColumn.Header>
                        <StackPanel>
                            <CheckBox  IsChecked="{Binding DataContext.SelectAll, ElementName=ExistingFilePopUpRoot,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                        </StackPanel>
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox  IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid},AncestorLevel=4}, Path=DataContext.CheckBoxEvent}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type Grid},AncestorLevel=4}, Path=DataContext}"   />
                            
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewDataColumn>
				  </telerik:RadGridView.Columns>
        </telerik:RadGridView>

I don't want to use GridviewCheckboxcolumn or select column since it doesn't fit my requirement.

Now the issue is when I do databinding based on element name it fails but as shown above based on ancestor level it works.

Is there a way I can do command binding based on elementname?

Martin Ivanov
Telerik team
 answered on 16 Aug 2021
1 answer
363 views

I'm using the 3 lines below to try to update the CurrentItem on the grid.
The code runs but the grid does not update (shows same text on all columns in current row as before)

StaffGridView.Items.EditItem(this.StaffGridView.CurrentItem);
this.StaffGridView.CurrentItem = updatedObject;
StaffGridView.Items.CommitEdit();

 

in the xaml

ItemsSource="{Binding StaffList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
CurrentItem="{Binding CurrentStaff, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsSynchronizedWithCurrentItem="True"

 

Is something else needed in the xaml or the code to tell the Grid to update with the change to CurrentItem?

 

Stenly
Telerik team
 answered on 13 Aug 2021
1 answer
218 views

I recently updated Telerik for WPF to the latest version. Since then I have following problem:

When I work with the designer I get this error:

[A]Telerik.Windows.Controls.RadWatermarkTextBox cannot be cast to [B]Telerik.Windows.Controls.RadWatermarkTextBox. Type A originates from 'Telerik.Windows.Controls, Version=2021.2.615.45, Culture=neutral, PublicKeyToken=...' in the context 'LoadFrom' at location 'C:\Program Files (x86)\Progress\Telerik UI for WPF R2 2021\Binaries\WPF45\Telerik.Windows.Controls.dll'. Type B originates from 'Telerik.Windows.Controls, Version=2021.2.615.45, Culture=neutral, PublicKeyToken=....' in the context 'LoadNeither' at location 'C:\Users\user\AppData\Local\Microsoft\VisualStudio\16.0_589b9641\Designer\ShadowCache\sc041jsc.3tf\nxls5byu.o3i\Telerik.Windows.Controls.dll'.

This only occurs on UserControls I want to insert somewhere. So I can use the RadWatermarkTextBox normally. But if it's in a UserControl this error is thrown.

How can I resolve this errror?


Dilyan Traykov
Telerik team
 answered on 13 Aug 2021
3 answers
324 views

I am creating a little chat demo, by having two chat boxes next to each other (they communicate to each other). My issue is, when I load older messages from the database, I could not properly set a different "current author" for each chat box while maintaining MVVM structure (what I need is: in chatbox 1 user1 is the currentAuthor, in chatbox 2 user 2 is the currnetAuthor)

I am following an MVVM pattern. Code snippets are provided below (I tried to remove all lines irrelevant to the question):

1- my chat boxes

<telerik:RadChat x:Name="chat1" 
			 Width="400"
			 Height="550"
                         DataSource="{Binding Chat1Messages}"
                         CurrentAuthor="{Binding Chat1CurrentAuthor}">
</telerik:RadChat>

 <telerik:RadChat x:Name="chat2" 
			 Width="400"
			 Height="550"
                         DataSource="{Binding Chat2Messages}"
                         CurrentAuthor="{Binding Chat2CurrentAuthor}">

</telerik:RadChat>

2- My code in adding the messages from DB:

//some code to get data from DB//


this.chat1CurrentAuthor = this.FirstAuthor;
this.chat2CurrentAuthor = this.SecondAuthor;

//Iterator over data from DB
{
     //if message is written by first author:
     {
          this.Chat1Messages.Add(new TextMessageObject() { Text = row.MessageText, MsgAuthor = this.FirstAuthor, CreationDate = row.Time });
          this.Chat2Messages.Add(new TextMessageObject() { Text = row.MessageText, MsgAuthor = this.FirstAuthor, CreationDate = row.Time });
     }
     //if message is written by second author:
     {
          this.Chat1Messages.Add(new TextMessageObject() { Text = row.MessageText, MsgAuthor = this.SecondAuthor, CreationDate = row.Time });
          this.Chat2Messages.Add(new TextMessageObject() { Text = row.MessageText, MsgAuthor = this.SecondAuthor, CreationDate = row.Time });
     }
}


3- code to support MVVM:

public Author Chat1CurrentAuthor
{
            get { return this.chat1CurrentAuthor; }
            set
            {
                if (value != this.chat1CurrentAuthor)
                {
                    this.chat1CurrentAuthor = value;
                    OnPropertyChanged(() => this.chat1CurrentAuthor);
                }
            }
}
public Author Chat2CurrentAuthor
{
            get { return this.chat2CurrentAuthor; }
            set
            {
                if (value != this.chat2CurrentAuthor)
                {
                    this.chat2CurrentAuthor = value;
                    OnPropertyChanged(() => this.chat2CurrentAuthor);
                }
            }
}

 

With my current code, both authors are set up as current authors in both chatboxes (i.e in chatbox1, currentAuthor is both user1 and user2, in chatbox2 currentAuthor is both user1 and user2) which is not the desired behavior.

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 12 Aug 2021
1 answer
133 views

I've made a YearRange custom filtering control that expose a DependencyProperty called Vintage

<telerik:GridViewDataColumn Width="110" DataMemberBinding="{Binding ModelVariant.Vintage}" Header="Ã…rgang">
  <telerik:GridViewDataColumn.FilteringControl>
    <local:CustomGridFilter Vintage="{Binding ElementName=root, Path=VintageYear, Mode=TwoWay}" />
  </telerik:GridViewDataColumn.FilteringControl>
</telerik:GridViewDataColumn>

 public int? Vintage
        {
            get { return (int?)GetValue(VintageProperty); }
            set { SetValue(VintageProperty, value); }
        }

        public static readonly DependencyProperty VintageProperty =
            DependencyProperty.Register(
                "Vintage",
                typeof(int?),
                typeof(CustomGridFilter),
                new PropertyMetadata(
                    null,
                    (sender, evt) => { ((CustomGridFilter)sender).OnPropertyChanged("Vintage"); }
                )
            );

Apparently the property never changes (INotifyPropertyChanged) even though it's databound to a property on the container. 

So i suspect that the only other way to send a new filtering parameter to the Custom Filter Control is through other means ?

Or is this SUPPOSED to work ? 

How would i programatically send the new filtering parameter to the control ?

Dinko | Tech Support Engineer
Telerik team
 answered on 11 Aug 2021
1 answer
209 views

Large data and realtime append data with mvvm like use ObservableCollection or RadObservableCollection, it will deny UI for some seconds. Large data mean the list count greater than 200k even 1000k.

 

Some sence like follow:

 

a gridview binding vm.list. then vm.list.Add(data) and list.Count is greater than 200k. UI lags. list is ObservableCollection

a chart series bind a vm.chartseries[0]. then vm.chartseries[0].Add(data) .

those are similar.

 

Could some controls have a nother mode to work without mvvm? like:

Task.Run(()=>{

gridview1.AppendData(data);

 

vm.LineSeries[0].MaxCount = 200000;

chart1.Series[0].AppendData(data);

//or

vm.LineSeries[0].AppendData(data);

})

 

In this mode ,controls can append data in other thread (not ui thread, and it can use a better performence collection class) quick and reflesh UI it self. And this mode have more potential for performance optimization

Dilyan Traykov
Telerik team
 answered on 10 Aug 2021
0 answers
272 views

Hello.

First of all, my problem is that when the window is opened, the busy indicator appears after about 1-2 seconds.

 

The window is wrapped with a busy indicator.

I use async on Loaded Evenet to control the IsBsuy property.

<telerik:EventToCommandBehavior.EventBindings>
	<telerik:EventBinding EventName="Loaded" Command="{Binding OnEventLoadedCommand}"/>
</telerik:EventToCommandBehavior.EventBindings>
public ICommand OnEventLoadedCommand { get => new DelegateCommand(obj => Loaded(obj)); }
private async void Loaded()
{
    IsBusy = true;

        DataLoad . . . . (using async task)

    IsBusy = false;
}

 

In a simple sample project, it appears immediately.
However, in my actual project, it is a bit delayed.

 

This is my guess.
Before Loaded, my actual project contains a lot of controls.

The window contains navigation.

There are about 10 usercontrols.


<Window>
    <DataTemplate ....  dataconext = ViewModel> * 10
</Window>

<usercontrol> * 10
    <Many Controls Input Initial Setting>
</usercontrol>

ViewModel..cs => Read values ​​of many properties before constructor

 

User controls all share the window viewmodel (not separate, only the WindowViewModel).

I think this is the cause of the first creation, but what about it?


Is there any way to solve this? If not, what's the problem?

 

Thanks.

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 updated question on 10 Aug 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?