Telerik Forums
UI for WPF Forum
1 answer
92 views
Hi,

I have a radchart with a Canvas overlay.  In the canvas I allow my users to create a rectangle to enclose the bars/data points that he may be interested.  The Canvas is 1:1 size with the radChart.  

Now based on the rectangle coordinates... How do I find which bars the user selected on the bars underneath my layer?  Is there a way I can pass screen/canvas coordinates to the radchart and get back a collection with the items inside the range?

Something like:

selectedCollection =  radChart.getItems(Point p1, Point p2);

J
Ves
Telerik team
 answered on 05 Jul 2010
2 answers
1.3K+ views
Hi, hopefully this will be a simple question with a quick answer.

My logical data structure is a List (eg. List<TopList>) with each item in the first list also having it's own list (eg. TopList[0].MiddleList). Finally, each MiddleList has some other class (eg. TopList[0].MiddleList[0].BottomClass), and I want to display all three in the UI with a RadTreeView for expanding and drag and drop support.

My xaml is set up as:
        <HierarchicalDataTemplate x:Key="GroupListNestedContentTemplate"
            <bui:UserControlForBottomClass/> 
        </HierarchicalDataTemplate> 
         
        <HierarchicalDataTemplate x:Key="GroupListNestedTemplate" ItemsSource="{Binding BottomClass}" ItemTemplate="{StaticResource GroupListNestedContentTemplate}"
            <bui:UserControlForMiddleLevel /> 
        </HierarchicalDataTemplate> 
         
        <HierarchicalDataTemplate x:Key="GroupListTemplate" ItemsSource="{Binding MiddleList}" ItemTemplate="{StaticResource GroupListNestedTemplate}"
            <bui:UserControlForTopLevel/> 
        </HierarchicalDataTemplate> 
 
<Controls:RadTreeView x:Name="UiElement" DataContext="{Binding}" ItemsSource="{Binding}" ItemTemplate="{StaticResource GroupListTemplate}" IsDragDropEnabled="True" IsSingleExpandPath="True" IsExpandOnSingleClickEnabled="True" /> 

With codebehind setting UiElement.DataContext = TopList.

The problem is that (from all the examples I've seen) the RadTree requires my BottomClass to be in a List. Changing my BottomClass into a List will render and databind correctly. Ideally though, I don't want to do this to my logic and create a List with only one item. My question is basically: Is there a way to DataBind and display my BottomClass without putting it into a List and without using a for loop in the code behind?

As a side note I've considered turning my UI structure into a RadTree with Expanders as the contents, but this ran into display and usability issues when collapsing the expander vs closing the tree nodes.
William
Top achievements
Rank 1
 answered on 05 Jul 2010
1 answer
112 views

Hi

Is there property for the rows number (IsRowsNumbersEnable) or I need to build it myself like in the Sample?

Best regards

Ehud

Ваня
Top achievements
Rank 1
 answered on 04 Jul 2010
0 answers
134 views
Hello,

I have a RadCalendar and I'm binding the SelectedDate property. It's working fine - the source and the target get updated as normal. However, I want to bring the selected date into view when it doesn't belong to the month being displayed.

Edit: I solved my problem using DisplayDate.
Yavor
Top achievements
Rank 1
 asked on 02 Jul 2010
1 answer
392 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
185 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
194 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
100 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
142 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
176 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
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?