Telerik Forums
UI for WPF Forum
0 answers
1 view

I have a wpf radtreeview, now I can use left click to select item,

but i want to the selection behavior to be changed to double click, how could I achieve that?

Guang
Top achievements
Rank 1
Iron
 asked on 16 Apr 2024
0 answers
8 views

Hi

I have the following datatemplate:

		<DataTemplate 
			x:Key="ReportComponentTemplate">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="30"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="30"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<CheckBox IsChecked="{Binding Included}" Margin="5,0"/>
				<TextBlock
					Grid.Column="1" Text="{Binding Didascalia}" HorizontalAlignment="Stretch"
					TextWrapping="Wrap"/>
				<t:RadComboBox Grid.Row="1" Grid.ColumnSpan="2"
					Width="150"
					Visibility="{Binding DataContext.TemplatePath, 
						RelativeSource={RelativeSource AncestorType=local:TreeViewReportControl},
						Converter={StaticResource StringEmptyToHide}}"
					VerticalAlignment="Top" Margin="5,0"
					HorizontalAlignment="Left"
					ItemsSource="{Binding TagsDisponibili}"
					SelectedItem="{Binding TagSelezionato, NotifyOnTargetUpdated=True, Mode=TwoWay}">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="SelectionChanged">
							<i:InvokeCommandAction Command="{Binding DataContext.TagSelezionatoUpdatedCommand
								, RelativeSource={RelativeSource AncestorType=local:TreeViewReportControl}}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</t:RadComboBox>
			</Grid>
		</DataTemplate>
This datatemplate is used as itemtemplate of a internal node of a radtreeview.
The Vsual tree is the following:

<t:RadDocking>
	<t:RadSplitContainer MaxWidth="600" t:DockingPanel.InitialSize="400,150" Name="LeftContainer" InitialPosition="DockedLeft">
		<t:RadPaneGroup>
			<t:RadPane>
				<Grid>
					<t:RadBusyIndicator>
						<t:RadTreeView>
						</t:RadTreeView>
					</t:RadBusyIndicator>
				</Grid>
			</t:RadPane>
		</t:RadPaneGroup>
	</t:RadSplitContainer>
</t:RadDocking>

Of course there are many other controls.
The strange here it is that textblock inside the row 1 of  ReportComponentTemplate systematically overflow the width of its parents.
I can set a fixed width or a maxwidth, but I want that it occupy the full available area (but not over).
Thank you
Luigi

Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
 asked on 02 Apr 2024
1 answer
20 views

I've read this thread but it is a bit confusing and old: Live sorting/grouping in UI for WPF | Telerik Forums

What is the current situation?

I am having problems with Devexpress GridControl as they dont support what they call "Live Data Shaping" eg sorting with real-time updates IF you use WPF binding.

Question - can Telerik data grid and/or virtual grid do live data shaping where columns use custom templates with WPF binding to a dictionary. For example: `{Binding Fields[abc].Value}`?

Martin Ivanov
Telerik team
 answered on 11 Mar 2024
1 answer
39 views

Hi,

I used the documentation to create a tree view with Windows folders. I wish to expand the item from from a specified path, e.g.. I want to have expanded Documents folder from the beginning, but I did not find anything that works.

Thanks!

Martin Ivanov
Telerik team
 answered on 01 Mar 2024
0 answers
27 views

Hello, 

I am using a RadTreeView component in a WPF application that looks like in the following photo. The hierarchy is: a Category can contain a list of SubCategories and a SubCategory contains a List of Activities that have some properties. I would like to transform my RadTreeView into a RadTreeListView or RadGridVew in order to beneficiate from SelectionUnit property and the navigation between cells from the keyboard but I could not find anything that meets by needs:

a component with cells only on the last level of the hierarchy, to be able to select a cell and edit it  and, if possible, to have a tabular header with details from the last level of the hirarchy.

 

Thank you!

Andreea
Top achievements
Rank 1
Iron
 updated question on 08 Feb 2024
1 answer
16 views

Currently I'm using a ProjectItem classes and FileItem classes into a RadTreeView for displaying the ProjectItem content. And when I'm trying to handle the Edited event, there occurs a problem with Old and New value, in case that given objects to RadTreeView.ItemsSource will be a reference type, it might create a problem. 

I would like to handle the Edited event for checking the NewValue, and according to conditions return there a OldValue.

Github with the solution

Dimitar
Telerik team
 answered on 26 Jan 2024
0 answers
18 views

Hi,

I am using <telerik:RadTreeListView> and the scroll functionality does not work. this is how my code looks like:

<UserControl x:Class="WISN.Windows.Survey.FacilityStaffControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:vm="clr-namespace:WISN.Windows.Survey.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">

    <telerik:RadTreeListView x:Name="stufftreeListView" AutoGenerateColumns="False"
                                 AutoExpandItems="True" GroupRenderMode="Flat" CanUserDeleteRows="False"
                                 ItemsSource="{Binding AllStaffByType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding StaffCategories,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></telerik:TreeListViewTableDefinition>
            </telerik:RadTreeListView.ChildTableDefinitions>

            <telerik:RadTreeListView.Columns>
                <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" AutoSelectOnEdit="True" EditTriggers="CellClick">
                    <telerik:EventToCommandBehavior.EventBindings>
                        <telerik:EventBinding Command="{Binding CustomCommandCommand}" EventName="MouseLeftButtonDown" />
                    </telerik:EventToCommandBehavior.EventBindings>
                </telerik:GridViewCheckBoxColumn>
                <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Name}" Header="Stuff"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding AnnualSalary}" Header="Annual Salary"></telerik:GridViewDataColumn>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
</UserControl>

 

I really do not know how to fix it.

Thanks

Andreea
Top achievements
Rank 1
Iron
 asked on 16 Jan 2024
1 answer
26 views

I just started WPF trial. I need help though. I am going to have large grids (10Ks rows x 100 columns) with frequent update of certain cells (100s upd/sec).

I am not sure I can use your virtual grid - need more time to understand what are the drawbacks.

So I use RadGridView (see below - this is not final version - just a first try - what I quickly read in your article on making grid more performant).

Columns are made in C# and bound to dictionaries using string key like: `Binding("f[NAME].Value")` where `Value` is of type object (this is best I can do - dont ask - a requirement i cannot circumvent)

Now, what is my question here - when I load grid with data initially - most of the values in cells arent available yet. I am asked to display something to highlight that state. Also sometime some rows might get unavailable in the middle of use. But bottom line - these "unavailable" cues are going to live may be 0.5% of the grid life-time..

I dont want to write cell templates that will lengthen the visual tree and  make grid slow for something that i need for very short period of time.. 

Is there a way to optimise it?

One theory - add something to the visual tree in the beginning and then take it away.. (like walking visual tree manually and inserting a semi-transparent red border or something like that? or changing template of rows, that have became available, into lightweight ones). Concern here - binding might get broken after manipulation with visual tree..

Or I can set all the values to a string like "N/A". However concern here is that what happens with the columns types in this case? Wont this screw the grid ability to sort/filter - because columns will pick up initial "string" type and later, when I change it to real data, (can be date/number/etc) - they break down completely.

Can I set columns type explicitely after N/A disappeared (however not clear - N/A might stay in some rows longer than in others and few could be N/A for lot longer)...

Any trick you can recommend?

NOTE: the same question applies on tree view (even more so)

 

<telerik:RadGridView x:Name="dg" ItemsSource="{Binding data}" ValidatesOnDataErrors="InEditMode" IsPropertyChangedAggregationEnabled="False" GroupRenderMode="Flat" ShowGroupPanel="False"AutoGenerateColumns="False"CanUserFreezeColumns="False"RowIndicatorVisibility="Collapsed"CanUserResizeColumns="False">

Martin Ivanov
Telerik team
 answered on 08 Dec 2023
1 answer
41 views

How to disable or overwrite background brush for selection in the TreeView?

What kind of templates I will be need to rewrite? Cause there's template for RadTreeViewItem  but I cannot reach this brush.

Dinko
Telerik team
 answered on 26 Oct 2023
1 answer
36 views
When I use a Hierarchical Template for generating a TreeView the branches of the TreeView wont use the entire width of the TreeView, even when I use a Grid with a column of * width.  Is there a way to get the template content to make use of the entire width?
Dinko
Telerik team
 answered on 04 Oct 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?