Telerik Forums
UI for WPF Forum
2 answers
336 views

Have a RadGridview that allows multiple selections. Currently only allowing rows.

<telerik:RadGridView x:Name="gvMrsUserSettings"
                                 Background="Black"
                                 FontFamily="Arial"
                                 Foreground="White"
                                 FontSize="11"
                                 GroupRenderMode="Flat"
                                 ItemsSource="{Binding MrsUserDataTable}"
                                 SelectionMode="Extended"
                                 AutoGenerateColumns="True"
                                 Margin="0,0,0,0"
                                 Grid.Row="1"
                                 ActionOnLostFocus="None"
                                 CanUserFreezeColumns="False"
                                 RowIndicatorVisibility="Collapsed"
                                 ShowGroupPanel="False"
                                 IsFilteringAllowed="True"
                                 ShowSearchPanel="True"
                                 SearchPanelCloseButtonVisibility="Collapsed"
                                 IsReadOnly="True"
                                 CanUserReorderColumns="False"
                                 CanUserDeleteRows="False"
                                 CanUserInsertRows="False"
                                 CanUserGroupColumns="False"
                                 CanUserSearch="False"
                                 CanUserSortGroups="False"
                                 EnableColumnGroupsVirtualization="False"
                                 ClipboardCopyMode="All,Header"
                                 ClipboardPasteMode="Cells,AllSelectedRows"
                                 IsBusy="False"
                                 >

If you select row 1, 4, 6 - 10 and 20, do a Ctrl+C then a Ctrl+V in a text file or excel all the rows between the numbers are blank.

Not sure what feature needs to be included in the XAML to prevent this behavior. Or what must be done short of modifying the collection in the clipboard.

sample of result is:

GROUP
UTI-KELLER
 
 
CLK_FINANCE
 
EMS_FIRE
CEL
COURT_ADMIN
COURT_ADMIN
COURT_ADMIN
 
 
 
 
 
 
 
 
 
UTILITIES

 

 

herb
Top achievements
Rank 1
Veteran
Iron
 answered on 21 Aug 2021
1 answer
184 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
257 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
232 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
486 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
401 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
692 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
391 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
250 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
341 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
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?