Telerik Forums
UI for WPF Forum
2 answers
245 views
Is it possible to use the symbols from the TelerikWebUi font in an RTF document?
Harald
Top achievements
Rank 2
 answered on 28 Jul 2019
5 answers
547 views

Hi,

Could you please help me to figure out how to define columns and properties for all-level nested tables in hierarchical gridview?

I'm referring to pages:

https://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/basic-hierarchies

https://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/how-to/access-child-gridview

 

But columns and properties AutoGenerateColumns and ShowGroupPanel are applied only for first child table and second-level table and deeper is not affected by that property.

MainWindow.xaml

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:HierarchyTest"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="HierarchyTest.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="513.789" Width="1084.149">
    <Grid>

        <telerik:RadGridView ItemsSource="{Binding}" DataLoading="RadGridView_DataLoading" AutoGenerateColumns="False" telerik:StyleManager.Theme="Fluent">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Id" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StartTime}" Header="Start Time" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Type}" Header="Type" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView ItemsSource="{Binding ChildJobs}" Name="childGrid" ShowGroupPanel="False" telerik:StyleManager.Theme="Fluent" AutoGenerateColumns="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Id" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding StartTime}" Header="Start Time" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Type}" Header="Type" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
    </Grid>
</Window>

 

MainWindow.xaml.cs

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;

namespace HierarchyTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public ObservableCollection<Build> Builds { get; set; } = new ObservableCollection<Build>();

        public MainWindow()
        {
            InitializeComponent();

            this.DataContext = this.Builds;

            this.Builds.Add(new Build() { Id = 1 });

            foreach (int i in Enumerable.Range(0, 10))
            {
                this.Builds[0].ChildJobs.Add(new Job() { Id = i });
                this.Builds[0].ChildJobs[i].ChildJobs.Add(new Job() { Id = i + 1 });
            }
        }

        private void RadGridView_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
        {
            var dataControl = (GridViewDataControl)sender;

            if (dataControl.ParentRow != null && dataControl.ChildTableDefinitions.Count == 0)
            {
                dataControl.ChildTableDefinitions.Add(new GridViewTableDefinition() { Relation = new PropertyRelation("ChildJobs") });
            }
        }
    }

    public class Build
    {
        public int Id { get; set; }

        public DateTime StartTime { get; set; } = DateTime.Now;

        public string Type { get; set; } = "Build";

        public ObservableCollection<Job> ChildJobs { get; set; } = new ObservableCollection<Job>();
    }

    public class Job
    {
        public int Id { get; set; }

        public DateTime StartTime { get; set; } = DateTime.Now;

        public string Type { get; set; } = "Job";

        public ObservableCollection<Job> ChildJobs { get; set; } = new ObservableCollection<Job>();
    }
}

 

Sergey
Top achievements
Rank 1
 answered on 26 Jul 2019
2 answers
1.8K+ views

I have a bit of a programming challenge…

We have a form that has a RadGrid whose itemsource is bound to collection.  That collection includes a Boolean field named ‘Selected’.
The form also has a ‘Select all’ button.

The user filters the grid based on customer, so it is displaying only 10 of the 50 items in the collection.

When they click the ‘Select all’ button, they want the items Selected property to be true for only the 10 records that are displayed in the grid.

If I can get a collection of just the rows displayed in the grid I could roll through both collections to locate matches.   I haven’t figured out a way to get the ‘filtered’ collection, and wonder if there is a more efficient way to accomplish the task.

Any ideas would be greatly appreciated.

Thanks in advance,
Lou

Lou
Top achievements
Rank 1
 answered on 25 Jul 2019
9 answers
195 views

        private void RadRibbonView_SelectionChanged(object sender, RadSelectionChangedEventArgs e)
        {

              if (ribbon.SelectedItem is RadRibbonTab)
                {
                    //keepBackstageOpen = false;
                    //MasterRadRibbonView.IsBackstageOpen = false;
                    System.Diagnostics.Debug.WriteLine("RadRibbonTab");
                }
                else if (ribbon.SelectedItem is RadRibbonBackstage)
                {
                    //keepBackstageOpen = true;
                    //MasterRadRibbonView.IsBackstageOpen = true;
                    System.Diagnostics.Debug.WriteLine("RadRibbonBackstage");
                }

        }

 

If I click on the backstage, this always triggers as a tab (the last one selected), and not as the backstage...which is causing me many problems.

Any advice ?

Barry
Top achievements
Rank 1
 answered on 25 Jul 2019
1 answer
163 views

Good morning, i had a issue when a try to move the RadPane that contains the RadGridView only when i use the theme VisualStudio2013. I try everything, with  any other theme work just fine. Pop into Output window in Visual Studio the following binding error for each column i have int the RadGridView, and it slows the application in a way that is very painful :

 

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor AncestorType='Telerik.Windows.Controls.GridView.DataCellsPresenter', AncestorLevel='1''. . BindingExpression:Path=Foreground; DataItem=null; target element is 'ContentControl' (Name='PART_ContentPresenter'); target property is 'Foreground' (type 'Brush')

 

I try taking of styles of header cells and such, but does not work. The others themes works with custom styles and without it.

Dimitar Dinev
Telerik team
 answered on 25 Jul 2019
9 answers
1.0K+ views

I want to add context menu for RadGridView and tried below code.. but it gives error as in the attached screenshot. please let me know how to proceed.

 

<telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False">
            <ui:RadContextMenu.ContextMenu>
                <ui:RadContextMenu x:Name="GridContextMenu" />
            </ui:RadContextMenu.ContextMenu>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}" Header="First Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Age}" Header="Age"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding IsMarried}" Header="Married"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

 

Martin Ivanov
Telerik team
 answered on 25 Jul 2019
1 answer
196 views

Hello,

Our app is extremely heavy with Telerik controls (we use it for just about everything in our UI). We've been getting complaints about the overall memory footprint of our app. Obviously most of that would likely be due to data and business logic, but we also were looking to do an analysis of all (Terlerik) controls being used to see if any are contributing factors. One of our designers mentioned that he feels the Telerik grid control is "very expensive" from a memory point of view - and we use it all over the place in our app, even in places where the stock WPF grid control may have been good enough.

Are there any utilities to track all the controls memory usage ?....or any ways to tap into the controls to find out the memory usage of each individually ?

Any suggestions would be appreciated.

Thanks,

Barry

Martin Ivanov
Telerik team
 answered on 25 Jul 2019
2 answers
127 views

Can i set the TreeListViewItem visibility to visible or hide, when i use the treelistiview in Virtualization model.

I want to use this method to search something,or may be another?

wang
Top achievements
Rank 1
 answered on 25 Jul 2019
4 answers
339 views
Hello Everyone,

I have users that can have 30 tiles on the RadTileList

I am trying to detect when the RadTileList is selected. Not the tiles inside the RadTileList.

The goal her, is to send the user back to the search textbox in the RadToolBar at the top.

I can't use  RadTileList_SelectionChanged since is not fired when not selecting a tile.

FocusManager.FocusedElement="{Binding ElementName=txtSearch}" doesn't work

and FocusManager.GotFocus="radTileLis_Focus" works once even if you click on a tile.

Is it possible to do that?

If so how?
Kermit
Top achievements
Rank 1
 answered on 24 Jul 2019
2 answers
140 views

Hi.

When clicked crop item and then directly press save button, cropped image is saved.It seems cropped result image save.

What i want  no cropping just save image. Please refer to the file for details.

How can i get uncropped image.

Please give me advise. 

Thanks reading this post.

Martin Ivanov
Telerik team
 answered on 24 Jul 2019
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?