Telerik Forums
UI for WPF Forum
6 answers
136 views
Hello,

I tried to customize style TreeListViewRow to add behavior, but i met a problem to keep the default alternating row style (row white and grey)
Indeed, I Have the default alternating style in my RadTreeListView, but if I customize only the row style, I lost the alternating row style (all the row are white)
So I decide to customize also the alternating row style, based on the row style.

<Style
                x:Key="rowStyle"
                BasedOn="{StaticResource {x:Type telerik:TreeListViewRow}}"
                TargetType="{x:Type telerik:TreeListViewRow}">
                <Style.Setters>
                    <EventSetter
                        Event="MouseDoubleClick"
                        Handler="HandleRowDoubleClick" />
                </Style.Setters>
            </Style>
 
            <Style
                x:Key="alternateRowStyle"
                BasedOn="{StaticResource rowStyle}"
                TargetType="{x:Type telerik:TreeListViewRow}">
            </Style>

But with this, I lost also the alternating row background color

I set the background color of the style with bind of the AlternateRowBackground of the control (to keep inheritance).
<Style
                x:Key="alternateRowStyle"
                BasedOn="{StaticResource rowStyle}"
                TargetType="{x:Type telerik:TreeListViewRow}">
                <Style.Setters>
                    <Setter
                        Property="Background"
                        Value="{Binding AlternateRowBackground, Source={RelativeSource TemplatedParent}}" />
                </Style.Setters>
            </Style>


With this, it's work, but I have binding error on each alternate line : BindingExpression path error: 'AlternateRowBackground' property not found on 'object' ''RelativeSource' (HashCode=46024298)'. BindingExpression:Path=AlternateRowBackground; DataItem='RelativeSource' (HashCode=46024298); target element is 'TreeListViewRow' (Name=''); target property is 'Background' (type 'Brush')

I undestand If the color work, it's because when binding fail, telerik engine seems to put the default value, because Value={Binding Foo or whatever produce the same result.

So I think it's because the AlternateRowBackground property isn't set in my RadTreeListView, I do this with yellow for test, but same error! (binding error, and the alternate background color is grey). I don't understand, can you explain this ?

Thanks,

Sincerly

Gourdon Julien

PS : sorry for my english, I'm french
Julien
Top achievements
Rank 1
 answered on 04 Nov 2013
3 answers
101 views
Hello,

how can I avoid that the EndEdit Method of my entity is raised when leaving/switching the row.
I changed the ActionOnLostFocus to "None", but this was not the solution.

Thank you,
Manuel
Yoan
Telerik team
 answered on 01 Nov 2013
1 answer
162 views
Hi guys I'm trying to draw a diagram like this one: http://www.wu.ac.at/ic/erp/webtrainer/dwh_webtrainer/exercise/20/20d-l-1.gif

Actually the only thing I really can't figure out is how to customize the connection template in order to draw an orthogonal line on top of a link (see the connection from the grayed node to the "driver" node).

The presence (or absence) of the line should be driven by a property in my model (the entire diagram is data bound to a graph source).

Thank you
Pavel R. Pavlov
Telerik team
 answered on 01 Nov 2013
1 answer
155 views

I just installed the latest version of WPF controls (2013.3.1016.40) and my TreeView no longer registers this property.  Can you tell me what the new alternative is for this property?  Thanks.

tv.ItemsOptionListType = OptionListType.CheckList;
Pavel R. Pavlov
Telerik team
 answered on 01 Nov 2013
1 answer
164 views
Hello, I would like to bind the gridview to viewmodels. I was thinking I'd have a TableViewmodel, which contains a collection of ColumnViewmodels and RowViewmodels, and finally CelViewModels. How would I go about doing this?

Thanks,
Scott
Dimitrina
Telerik team
 answered on 01 Nov 2013
1 answer
155 views
I already submitted a support ticket, but I just wanted to post here.

If the Template property of a RadComboBoxItem is set, then the DisplayMemberPath property of the RadComboBox will no longer display on each item in the drop down.  The currently selected item will still appear correctly.

The workaround is to explicitly set the ItemTemplate property on the RadComboBox.
Kalin
Telerik team
 answered on 01 Nov 2013
1 answer
155 views
Hi,
 
I have a need to have a movable slider on line charts. The way it should work is as follows:
 
1. Slider/Cursor should be parallel to Y-axis i.e. vertical axis
 
2. When user moves this slider, corresponding/intersecting Y values on all graphs show up in labels just like a stock ticker chart.
  3 the value of intersecting line should be displayed in label

 


 
Thanks,
avinash
Petar Marchev
Telerik team
 answered on 01 Nov 2013
2 answers
214 views
Hello,

I wonder if it is possible to combine stack and cluster bars to have something like the image that I am attaching.

So far I can create Bar series with combine mode stack or cluster but not both.

I am creating the series in the code behind like this:

BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Stack;
 
// or
 
BarSeries barSer = new BarSeries();
barSer.ShowLabels = true;
barSer.CombineMode = ChartSeriesCombineMode.Cluster;
 
foreach (DataRow dr in dtData.Rows)
            {
                barSer.DataPoints.Add(new CategoricalDataPoint() { Category = dr["Name"], Label = string.Format("{0:N}", dr["Value"]), Value = double.Parse(dr["Value"].ToString()) });
                 
            }

Thanks in advance.

Alberto
Alberto
Top achievements
Rank 1
 answered on 31 Oct 2013
9 answers
690 views
Hi,

I have in my App a RadScheduleView. Its theme is set to Windows8Theme in xaml :

<telerik:RadScheduleView x:Name="ScheduleView"
                         MinTimeRulerExtent="400"
                         MaxTimeRulerExtent="1920"
                         AppointmentNavigationButtonsVisibility="Never"
                         ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
                         telerik:StyleManager.Theme="Windows8"
                         GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}"/>

this theme is definitive, but I would like to be able to change the theme's AccentColor at runtime, so I wrote a method to do this:

public static void ChangeTheme(ColorTheme theme)
{
    var app = (App)Application.Current;
    if (theme == app.CurrentTheme) return;
     
    app.Resources.MergedDictionaries.Clear();
    AddResourceDictionary("resources/Common.xaml");
    AddResourceDictionary("resources/GeneralResources.xaml");
    AddResourceDictionary("resources/MenuResources.xaml");
    AddResourceDictionary("resources/DataGridResources.xaml");
    AddResourceDictionary("resources/DatePickerResources.xaml");
 
    app.CurrentTheme = theme;
    try { AddResourceDictionary(string.Format(CultureInfo.InvariantCulture, "themes/{0}.xaml", theme)); }
    catch { AddResourceDictionary("themes/Default.xaml"); }
 
    Windows8Palette.Palette.AccentColor = (Color)Application.Current.Resources["ThemeColor"]; // pour le calendrier
 
}
 
private static void AddResourceDictionary(string source)
{
    var resourceDictionary = Application.LoadComponent(new Uri(source, UriKind.Relative)) as ResourceDictionary;
    Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
}

My issue is quite simple: the ScheduleView's color is always exactly one color late. i.e.:
let's say I have 3 theme colors : green, red, blue. Blue is the color at the beginning. I call the method to set the color to red, it stays blue. I call the method to set green, it becomes red, I call the color to set blue again, it becomes green, and so on...

can anybody tell me what I am doing wrong? I am at a complete lost as to how on earth this behaviour is possible...

Edit: I forgot a potentially usefull piece of information: this used to work with earlier versions of the telerik libraries (Q3 2012 as far as I remember). At the time, I used Windows8Colors.PaletteInstance, though, as it was not yet flagged as Obsolete.


Rosen Vladimirov
Telerik team
 answered on 31 Oct 2013
15 answers
287 views
I am trying to bind the DataForm ItemsSource to a DataTable. Initially the DataForm is populated, but if I try to navigate through the records, I get an error.

I have spent past hour searching for a solution, and I could not find any mention of this issue. DataForm works fine if binded to an ObservableCollection of business objects. But in this case I need it binded to a DataTable, and I cant seem to find a way to get it working.

IDE: VS2010
.Net Version: 4.0
Telerik Version: 2011.3.1220.40

I have created a sample project that recreates the same issue. The error that I receive when navigating through the records is:

The type 'DataRowView' does not contain a public property named 'DateTime'.
Parameter name: propertyName


<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="Testing.DataForm.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadDataForm Name="dataForm"/>
    </Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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 System.Data;
 
namespace Testing.DataForm
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
 
        public MainWindow()
        {
            InitializeComponent();
            GenerateSomeData();
        }
 
        private void GenerateSomeData()
        {
            #region Data Generator
 
            DataTable baseTable = new DataTable();
            baseTable.Columns.Add("DateTime", typeof(DateTime));
            baseTable.Columns.Add("Value", typeof(decimal));
 
            DateTime date = new DateTime(DateTime.Now.Year, 11, 1);
 
            TimeSpan span = date.AddMonths(1).AddDays(-1) - date;
 
            int numDays = span.Days;
            int randHigh = 65;
            int randLow = 0;
 
            #region RANDOM DATA GENERATOR
 
            Random rand = new Random();
 
 
            int calculatedNumHours = 24 * numDays;
            for (int hour = 1; hour <= calculatedNumHours; hour++)
            {
                baseTable.Rows.Add(new object[]
                {
                    date.AddHours(hour).AddSeconds(-1),
                    rand.NextDouble() * ((randHigh - randLow) + randLow)
                });
            }
 
            #endregion
 
            dataForm.ItemsSource = baseTable.DefaultView;
 
            #endregion
        }
    }
}
Dimitrina
Telerik team
 answered on 31 Oct 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
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?