Telerik Forums
UI for WPF Forum
1 answer
348 views
Hi,
how can i remove selected row and how can i add new one to the top? Im writing simple email app, and i need to add new rows to the top when messages come, and remove selected row (because someone can delete it, or move to another folder). I know there is an event Deleted and Deleting, but that is not what i need.
Stefan Dobrev
Telerik team
 answered on 02 Jul 2010
2 answers
158 views
I've been working on an application using a multi-level self-referencing heirarchy, and have come across a problem with using the RowLoaded event for any level other than the first level.  Hopefully someone can give me a pointer on how to get this working. 

My basic goal at the moment is to disable the expand button (+) next to items that do not have a heirarchy beneath them,  I've recreated the sample from here in WPF, as a simple baseline.   I've added a little to this to try to make it work as I need (including only having heirarchies related to some items),  So I'll post my version of the code below.   As I mentioned, I'm using the RowLoaded event to decide whether or not to make the row expandable, but this only works for the first level. 

Is there a way I  can use this RowLoaded event (or another one) to do the same for levels 2 - 10 (or however deep it goes)?

Thanks,
Russell

The MainWindow.xaml:
<Window x:Class="HeirarchicalGridExample.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
        xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
        Title="MainWindow" Height="350" Width="525">  
    <Grid> 
        <telerikGrid:RadGridView x:Name="RadGridView1" ItemsSource="{Binding}" DataLoading="RadGridView1_DataLoading" RowLoaded="RadGridView1_RowLoaded" /> 
    </Grid> 
</Window> 

The MainWindow.xaml.cs:
using System;  
using System.Collections.Generic;  
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Windows;  
using System.Windows.Data;  
using Telerik.Windows.Controls.GridView;  
using Telerik.Windows.Controls;  
using Telerik.Windows.Data;  
 
namespace HeirarchicalGridExample  
{  
    /// <summary> 
    /// Interaction logic for MainWindow.xaml  
    /// </summary> 
    public partial class MainWindow : Window  
    {  
        public MainWindow()  
        {  
            InitializeComponent();  
            DataContext = from i in Enumerable.Range(0, 5)  
                          select new MyObject()  
                          {  
                              ID = i,  
                              Name = String.Format("Name{0}", i),  
                              Level = 1 
                          };  
        }  
 
        public class MyObject  
        {  
            public int ID { get; set; }  
            public string Name { get; set; }  
            public int Level { get; set; }  
 
            public IEnumerable<MyObject> Items  
            {  
                get  
                {  
                    if (ID == 1 || ID == 3 || ID == 5 || ID == 7)  
                    {  
                        return from i in Enumerable.Range(0, 10)  
                               select new MyObject()  
                               {  
                                   ID = i,  
                                   Name = String.Format("{0}", Name + " - " + i.ToString()),  
                                   Level = Level + 1  
                               };  
                    }  
                    else  
                        return Enumerable.Empty<MyObject>();  
                }  
            }  
        }  
 
        private void RadGridView1_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)  
        {  
            var grid = (GridViewDataControl)sender;  
 
            var d = new GridViewTableDefinition();  
            d.Relation = new PropertyRelation("Items");  
            grid.TableDefinition.ChildTableDefinitions.Add(d);  
 
            grid.AutoGenerateColumns = false;  
            grid.Columns.Add(new GridViewDataColumn() { DataMemberBinding = new Binding("Level") });  
            grid.Columns.Add(new GridViewDataColumn() { DataMemberBinding = new Binding("ID") });  
            grid.Columns.Add(new GridViewDataColumn() { DataMemberBinding = new Binding("Name") });  
        }  
 
        // this is only working for the top level of the grid  
        private void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e)  
        {  
            GridViewRow row = e.Row as GridViewRow;  
            MyObject rowItem = e.DataElement as MyObject;  
 
            if (row != null && rowItem != null)  
            {  
                if (rowItem.Items.Count<MyObject>() > 0)  
                    row.IsExpandable = true;  
                else  
                    row.IsExpandable = false;  
            }  
        }  
    }  
}  
 

Russ
Top achievements
Rank 1
 answered on 02 Jul 2010
3 answers
170 views
Does Telerik intend to make RadControls for WPF complient with the DotNet 4.0 Client Profile?   Based on what is said:

http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx

"Since we are considering to make the NET4 Client Profile available broadly to desktops via Windows Update, most client desktops may have NET4 Client Profile soon after NET4 releases making it ubiquitous."

It would be great we could build WPF apps with RadControls and know that many of our customers may already have the current framework.  (I'm not so concerned about 3.5 Client Profile, btw, skipping right over that).



Stefan Dobrev
Telerik team
 answered on 02 Jul 2010
1 answer
79 views
I just wanted to know what is the best way to update the TreeView with entirely new content. i.e. Refresh the list completely.
Kiril Stanoev
Telerik team
 answered on 02 Jul 2010
1 answer
115 views
I want my users to select a month using the RadDatePicker. The default behavior is that the user selects a date. Can I change that somehow?

An idea I had was to catch the DisplayModeChange-event and check if it was changing from YearView to MonthView. When that happens I now that the user has clicked on a month. But I can't find any way to find out which month was clicked, since nothing has really been selected yet (only dates can be selected).

Is there a solution to this problem?

A clarification: When I say I want the users to select a month, I don´t mean just "February" but "February 2010" (a specific month in a specific year).
Kaloyan
Telerik team
 answered on 02 Jul 2010
5 answers
149 views
Hi

I use in my application a RadTabControl that uses a Close button in the TabItem template. The problem is that when I use the DropDown it successfully shows the template that I used for the TabItems in the DropDown but If I click the close button from the dropdown the tab is closed and deleted from the RadTabControl but the DropDown does not get refreshes and this can lead to problem since if a click again in the close button of that tab from the dropdown I will get an error obviously because that Tab doesn't exists anymore.

I am using the Q2 2010 beta

Any solutions for that? There is a workaround for that?

Thanks,

Ariel
Kiril Stanoev
Telerik team
 answered on 01 Jul 2010
1 answer
54 views
When I check and then uncheck a tree node (in code C#)  that is in tri-state mode and I have never opened all of the nodes below a common parent the nodes are not unchecked properly.

If I open all of the nodes first manually by clicking them with the mouse then close all the nodes then do the same in code (C#) everything works fine.

I have tried many things in code such as expanding and closing nodes, however nothing seems to work unless I have used the mouse to expand the nodes first.

Any ideas?

thank you,
Rick
Tina Stancheva
Telerik team
 answered on 01 Jul 2010
3 answers
165 views
Hello,

we have a problem using the tree view, when the control is databound to a list with duplicate objects (the object occurs in tree node X and tree node Y). The problem is, that the selection automatically switches to the first occurrence of the object whatever item of the object you click.

I attached the code of a demo-project, which shows this behaviour. With the standard WPF-tree everything is working.

For your information: we are not using the latest version of Rad Controls. An update to the newest version is not possible for us due to compatibility issues.

Thanks in advance for the support.
Matthias
Valentin.Stoychev
Telerik team
 answered on 01 Jul 2010
1 answer
85 views

Drag and Drop

When I using flow direction right to left on the tree view the drag and drop act strange

Someone know this problem?

Best Regards

Ehud

 

Viktor Tsvetkov
Telerik team
 answered on 01 Jul 2010
6 answers
226 views
I wish to get the group aggregate.
Basically the count of items in each group, but I do not wish to display the data as group under grid View.


Xaria D
Top achievements
Rank 1
 answered on 01 Jul 2010
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
Slider
Expander
TileList
PersistenceFramework
DataPager
TimeBar
Styling
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
CardView
DataBar
WebCam
FilePathPicker
Licensing
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?