Telerik Forums
UI for WPF Forum
1 answer
240 views

Does the RadTimeBar support when Windows has a non-Gregorian calendar set? Specifically this one: https://docs.microsoft.com/en-us/dotnet/api/system.globalization.umalquracalendar?view=net-5.0. I get an exception that says this when I change my Windows settings to get that calendar:

Exception Stack Trace: System.Windows.Markup.XamlParseException: Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date), inclusive.

I can reproduce it with XAML as simple as this:

		<telerik:RadTimeBar x:Name="TimeBar"
                            PeriodStart="1-Jan-2019 12:00:00 AM"
                            PeriodEnd="31-Dec-2019 11:59:59 PM"
                            VisiblePeriodStart="14-March-2019 12:00:00 AM"
                            VisiblePeriodEnd="11-Nov-2019 11:59:59 PM">
			<telerik:RadTimeBar.Intervals>
				<telerik:YearInterval />
				<telerik:MonthInterval />
				<telerik:WeekInterval />
				<telerik:DayInterval />
			</telerik:RadTimeBar.Intervals>
		</telerik:RadTimeBar>


Stenly
Telerik team
 answered on 20 Aug 2021
1 answer
300 views

Hello

 

I am using it by making a ViewModelBase class by default.

I looked at Telerik's ViewModelBase class documentation and this is not what I'm looking for.
https://docs.telerik.com/devtools/wpf/common-information/mvvm-helpers/common-viewmodelbase-class

I prefer to display getter setters on one line.


using Telerik.Windows.Controls;

private object item; public object Item { get => item; set { item= value; RaisePropertyChanged(); } }

 


// Create ViewModelBase helper method
protected virtual bool SetField<T>( ref T member, T newValue, [CallerMemberName] string propertyName) ... ... 

private object item;
public object Item
{
    get => item;
    set  => SetField(ref item, value);
}

 

I want to keep it simple. Do you have any plans to improve this?
Or I would like to ask if it is possible to create a similar one and use it while using the Telerik ViewModelBase Class.

 

If that doesn't work, I'll continue to create and use my ViewModelClass.

Thanks.

Martin Ivanov
Telerik team
 answered on 20 Aug 2021
1 answer
268 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
591 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
441 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
732 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
443 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
298 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
383 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
178 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
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?