Telerik Forums
UI for WPF Forum
1 answer
157 views
I have upgraded to the latest WPF RadControls and have moved from the RsdRibbonBar to the RadRibbonView.

When I used the RadRibbonBar, if I hit a button on the bar it would cause a lose focus on the row of the RadGridView that I was editing and move it out of this mode.

However the RadRibbonView does not have this default behaviour. It will not cause a lose focus event and when a button on it is clicked, the RadGridView row that is being edited will stay in edit mode.

How can I get the RadRibbonView to behave in the same way as the RadRibbonBar??

Thanks
Tina Stancheva
Telerik team
 answered on 12 Mar 2013
1 answer
59 views
I would like to set default focus once my page loaded. For example, I have User class and bind to PropertyGrid.
The User class has Name, LastName, Age. Once the page load, i would like to set focus at Age in SelectedField.

Please help on this.
Yoan
Telerik team
 answered on 12 Mar 2013
1 answer
109 views
Hi,

i use a RadComobox and i populate data this way:
ProfileQuelle_cbx.ItemsSource = ITA_Packetverwaltung.Dialog.Settings.Verbindungen.GetVerbindungen();

This works fine. Now i click a button and on it's click_event i will get the Objetc Profile:
Model.Profile.Profiles Quelle_obj = new Model.Profile.Profiles();
Quelle_obj = ProfileQuelle_cbx.SelectedItem;

But this will not work?

Thanks
best REgards
Rene
Yana
Telerik team
 answered on 12 Mar 2013
5 answers
332 views
public class PlotItemViewModel
    {
        //y-axis value
        public string City { get; set; }
        //x-axis value
        public DateTime StartTime { get; set; }
        //added to provide a value useful to a linear axis
        public int Sequence { get; set; }
    }
 
public class PlotItems
{
    public ObservableCollection<PlotItemViewModel> Items { get; set; }
 
    public DateTime RangeStart { get; set; }
    public DateTime RangeEnd { get; set; }
 
    public PlotItems()
    {
        Items = new ObservableCollection<PlotItemViewModel>();
        var dateTime = DateTime.Now;
        Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(50), Sequence = 6 });
        Items.Add(new PlotItemViewModel() { City = "Atlanta", StartTime = dateTime.AddMinutes(10), Sequence = 6 });
        Items.Add(new PlotItemViewModel() { City = "New York", StartTime = dateTime.AddMinutes(100), Sequence = 5 });
        Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(120), Sequence = 4 });
        Items.Add(new PlotItemViewModel() { City = "Miami", StartTime = dateTime.AddMinutes(150), Sequence = 4 });
        Items.Add(new PlotItemViewModel() { City = "Savannah", StartTime = dateTime.AddMinutes(200), Sequence = 3 });
        Items.Add(new PlotItemViewModel() { City = "Birmingham", StartTime = dateTime.AddMinutes(250), Sequence = 2 });
        Items.Add(new PlotItemViewModel() { City = "New Orleans", StartTime = dateTime.AddMinutes(280), Sequence = 1 });
         
         
 
 
        Items = new ObservableCollection<PlotItemViewModel>(Items.OrderBy(x => x.StartTime));
        RangeStart = Items.First().StartTime.AddMinutes(-Items.First().StartTime.Minute);
        RangeEnd = Items.Last().StartTime.AddMinutes(-Items.Last().StartTime.Minute).AddHours(1);
    }
}
<telerik:RadCartesianChart Margin="5" >
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeContinuousAxis Title="Time" MajorStepUnit="Hour" MajorStep="1" LabelFormat="h:mm tt" Minimum="{Binding RangeStart}" Maximum="{Binding RangeEnd}">
        </telerik:DateTimeContinuousAxis>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Title="Cities" />
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:LineSeries   ItemsSource="{Binding Items}"
                            CategoryBinding="StartTime" ValueBinding="Sequence"
                            Stroke="Orange" StrokeThickness="2">
        </telerik:LineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

I'm working on a simple application with a burn-down chart that will display city names along the y-axis while displaying time values along the x-axis. I am having difficulty getting the chart to display when setting up the line series to display both the string property and date time property.

Is there a way to do this by default? Which axes would provide this functionality if any? I've provided an image of what currently displays, which is what I would like; except that rather than the integers I would like to see the city names. I have provided the integer values as that has been the only way I have been able to get the data to plot in a way that most resembles the final product I wish to have.
Petar Marchev
Telerik team
 answered on 12 Mar 2013
1 answer
260 views
Telerik,

Our development team use your WPF controls, in particular, this issue deals with the RadChart control.  I have a need to change the color on an individual bar without changing the other bar colors in the data series, and I need to do this in code-behind.

I've attached a picture of my chart output.  In the example, the y-axis is minutes and the x-axis is divided into four categories (3,10,11,18).  Each category could display up to three bars.  Based on a threshold per category/bar, a single bar could change color.  For example, bar 2 under category 3 may need to turn red, but I don't want any of the other bars to turn red (just that bar only).

At the DataPoint level, I'm updating dp.YValue and dp.Tooltip for each bar, and it is at this level that I make a decision about the bar's color based on the YValue.

The entire chart (RadChart) is being created in code-behind (no XAML).  How can I accomplish this task?

Thanks, 
Evgenia
Telerik team
 answered on 12 Mar 2013
1 answer
356 views
Hi,

I am trying to create a RadGridView with a child template, I based my code this example : http://demos.telerik.com/silverlight/#GridView/Hierarchy/HierarchyChildTemplate

But on top of this I wanted to have a number of dynamic columns at the top level and also at the child template level.  However when I set the XAML AutoGenerateColumns attribute to True it does not interpret the column with the data for the child template, it just processes it as a regular field value.

I am using the DataTable objects to store the dynamic property values.

What do I need to do to get WPF to process the "LowerLevel" property into the ChildTemplate?

(FYI: I am consuming an XML file hence the need for dynamic columns, below is a simplified example of what I am trying to do)

Thanks for your help!

John

<Window
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfRadGridViewCustomHierarchyDynamicColumns.MainWindow"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <telerik:RadGridView x:Name="DynamicGridUi" ShowColumnFooters="True" GroupRenderMode="Flat"
                             CanUserFreezeColumns="False"
                             ColumnWidth="*"
                             GridLinesVisibility="Both"
                             RowIndicatorVisibility="Collapsed"
                             IsReadOnly="True"
                             AutoGenerateColumns="True">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition/>
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridView1" GroupRenderMode="Flat"
                                         BorderThickness="0,1,0,1"
                                         GridLinesVisibility="None"
                                         CanUserFreezeColumns="False"
                                         AutoGenerateColumns="False"
                                         ItemsSource="{Binding LowerLevel}"
                                         ShowGroupPanel="True"
                                         IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
    </Grid>
</Window>


using System;
using System.Collections.Generic;
using System.Data;
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;
 
namespace WpfRadGridViewCustomHierarchyDynamicColumns
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
 
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Random gen = new Random();
 
            DataTable dtTopLevel = new DataTable();
            // Define the top level columns
            dtTopLevel.Columns.Add("KnownCol", typeof(string));
 
            // Generate dynamic column names for top level
            List<string> DynamicColumns = new List<string>();
            int intColCount = gen.Next(1, 6);
            for (int i = 0; i < intColCount; i++)
            {
                DynamicColumns.Add("Col" + i);
            }
            // Add those dynamic columns to the top level
            foreach (string strItem in DynamicColumns)
            {
                dtTopLevel.Columns.Add(strItem, typeof(string));
            }
            // DataTable for child template
            dtTopLevel.Columns.Add("LowerLevel", typeof(DataTable));
 
            string[] RowDataForKnownColumn = new string[] { "1st", "2nd", "3rd", "4th", "5th", "6th" };
            foreach (string item in RowDataForKnownColumn)
            {
                // Add cell value for known column
                var aryStart = new object[] { item };
                // Generate dynamic columns cell values
                List<string> listCellValuesForRow = new List<string>();
                foreach (string strColumnName in DynamicColumns)
                {
                    listCellValuesForRow.Add("Val" + item + "," + strColumnName);
                }
 
                // Data for Child Template
                DataTable dtLowerLevel = new DataTable();
                // Define the columns for the lower level data for each row
                foreach (string strColumnName in DynamicColumns)
                {
                    dtLowerLevel.Columns.Add(strColumnName, typeof(string));
                }
                // Then generate and add the cell data for the lower level table
                for (int i = 0; i < gen.Next(1, RowDataForKnownColumn.Length); i++)  // generate a random number of rows for the lower
                {
                    List<string> listLowerLevelCellValues = new List<string>();
                    foreach (string strColumnName in DynamicColumns)
                    {
                        // Generate the cell contents for the the row in the lower table
                        listLowerLevelCellValues.Add("LowerVal " + RowDataForKnownColumn[i] + "," + strColumnName);
                    }
                    // Add the cell values for the current row in the lower table
                    dtLowerLevel.Rows.Add(listLowerLevelCellValues.ToArray());
                }
                // End data for child template
 
                // Include the cell values for the dynamic columns for this row
                var aryMiddle = listCellValuesForRow.ToArray();
                // Include the the data table value which contains the row values for the lower level
                var aryEnd = new object[] { dtLowerLevel };
                // Concatenate all the row values into a single array
                var aryRowValues = aryStart.Concat(aryMiddle).ToArray().Concat(aryEnd).ToArray();
                // Add all the cell values for this row in the top level
                dtTopLevel.Rows.Add(aryRowValues);
            }
            DynamicGridUi.ItemsSource = dtTopLevel;
        }
    }
}




Vlad
Telerik team
 answered on 12 Mar 2013
1 answer
160 views
Hello, when I took a look to wpf telerik demos I was impressed of loading time of the grid binded to one milion record.
I'm doing the same in my application, but I can't get same performance.

I'm using linq to entity framework for data access and I bind to an Entity with one milion records.

Loading time is very high, so I want to know hoe to obtain such performance.

I also download this example, but it's not working, it gives error in opening database:

http://blogs.telerik.com/vladimirenchev/posts/10-04-15/blazing_fast_performance_with_radgridview_for_wpf_4_0_and_entity_framework_4_0.aspx

Anyone can halp me?
Vlad
Telerik team
 answered on 12 Mar 2013
2 answers
186 views
Hi,

I have setup Entity Framework in my WPF application and have used the example, but it keeps telling me that the object Context I am using is not allowed even though I am using the DBContext that the Entity Framework wizard created for me.

Below is my xaml:

<UserControl
...
<xmlns:data="clr-namespace:Stats.Data"
...
<Grid>
<telerik:RadEntityFrameworkDataSource Name="statsDS" QueryName="Client">
<telerik:RadEntityFrameworkDataSource.ObjectContext>
<data:StatsEntities/>
</telerik:RadEntityFrameworkDataSource.ObjectContext>
<telerik:RadEntityFrameworkDataSource>
<telerik:RadGridView itemsSource="{Binding DataView, Elementname=statsDS}"/>
</Grid>
</UserControl>

StatsEntities is the DBContext within my Entity Framework model.
Andrew
Top achievements
Rank 1
 answered on 12 Mar 2013
1 answer
156 views
Hello, is it possible using MVVM to have different data types in a single column? I would want one cell to be string, another to be numeric, and another to be a dropdown etc. Or possibly use 1 datatype(String), but have different editors in each cell. Your new spreadsheet control may be a better solution, but it may be some time before it is done, and if this can work using the GridView, I'd use that.

Thanks
Scott
Ivan Ivanov
Telerik team
 answered on 12 Mar 2013
1 answer
125 views
Please, I am Felipe Lucio Quirino and I`m using a custom RadTreeListView custom control that is almost what I want. 
The problema is that i`m setting the ItemSource of the RadTreeListView, and its cells types and validations are built as the type of the source I was binding to the RadTreeListView, but, I have a column that is an object type and I want to change the cell DataFormatString if possible for datetime, decimal or other type when the application is running.  I did not find a way for doing it. please, help!
I got a project attached in this thread that you could customize, but to try to reprodoce what I want you have to put other property in the File class type defined like an object and when begin editing the RadTreeListView when the app is running , try to set some specific datatype like decimal.

change de extension of the file to .rar.. to extract the project or download by the following link http://www.telerik.com/ClientsFiles/231850_radtreelistviewdraganddropsample-wpf-1.zip

Thanks!



Felipe Lucio
Top achievements
Rank 1
 answered on 11 Mar 2013
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
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?