Telerik Forums
UI for WPF Forum
1 answer
125 views
I've tried to inherit class from RadTreeListView and add it on form via XAML and app shows nothing in debug.
How can I fix it quickly?
RadControls version = 2011.3.1220.40

public class TestTreeView : RadTreeListView
{
}
<controls:TestTreeView ItemsSource="{Binding Items}" />  -> empty screen
...
<t:RadTreeListView ItemsSource="{Binding Items}" />  -> fine
Dimitrina
Telerik team
 answered on 11 Oct 2013
1 answer
130 views
The company for which I'm consulting has a specific business requirement that each instance of
certain WPF Windows MUST have their own UI Thread and NOT share the default UI thread created
by .NET Framework when the application is first loaded. From a coding perspective, 
this is easy to
accomplish and works well, until introducing the Telerik RadDocking control in the WPF Xaml.  I have
copied and pasted the xaml form telerik's RadDocking example directly from the sample code without
modifying it. When the app launches, both instances of WindowWithTelerikDockingFromExample
[seemingly] load without issue at first, in fact, the second instance of the window (titled "Window on
seperate UI Thread...") is operational and works, as does "MainWindow". It's not until you activate
the second window and then activate the main window, and then switch back to the second window
that the following exception is thrown:

"The calling thread cannot access this object because a different thread owns it."

Locating source for 'c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs'. Checksum: MD5 {3e 1e cd 2a 97 89 30 7e c9 1c 28 c2 28 13 aa e9}
The file 'c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs' does not exist.
Looking in script documents for 'c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs'...
Looking in the projects for 'c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs.
The debugger could not locate the source file 'c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\AutoHideArea.cs'.

Here is the code from my files:

App.xaml.cs:
public partial class App : Application
 {
     protected override void OnStartup(StartupEventArgs e)
     {
         this.ShutdownMode = System.Windows.ShutdownMode.OnLastWindowClose;
 
         // Init the application's main window...
         var mainWindow = new WindowWithTelerikDockingFromExample();
         mainWindow.Title = "Main Window";
         this.MainWindow = mainWindow;
         mainWindow.Show();
 
         // init another instance of the window with the telerik docking, on a seperate UI thread...
         var thread = new Thread(() =>
         {
             SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
             var window2 = new WindowWithTelerikDockingFromExample();
             window2.Title = "Window on seperate UI Thread...";
             window2.Show();
             System.Windows.Threading.Dispatcher.Run();
             window2.Closed += (s2, e2) =>
                 {
                     window2.Dispatcher.InvokeShutdown();
                 };
 
         });
 
         thread.SetApartmentState(ApartmentState.STA);
         thread.Start();
 
         base.OnStartup(e);
     }
 
 }

WindowWithTelerikDockingFromExample.xaml:

<Window x:Class="TelerikDockingThreadIssueExample.WindowWithTelerikDockingFromExample"
        Title="Window with xaml copy and pasted from Telerik example" Height="300" Width="300">
    <Grid>
        <telerik:RadDocking   BorderThickness="0" Padding="0">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadDocumentPane Header="Document 1" Title="Document 1" />
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
 
            <telerik:RadSplitContainer InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Pane Left 1" IsPinned="False">
                        <TextBlock Text="Pane Left 1" />
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane Left 2" IsPinned="False">
                        <TextBlock Text="Pane Left 2" />
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane Left 3" IsPinned="False">
                        <TextBlock Text="Pane Left 3" />
                    </telerik:RadPane>
                    <telerik:RadPane Header="Pane Left 4" IsPinned="False">
                        <TextBlock Text="Pane Left 4" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
            <telerik:RadSplitContainer InitialPosition="DockedRight">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Pane Right 1" IsPinned="False">
                        <TextBlock Text="Pane Right 1" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
 
            <telerik:RadSplitContainer InitialPosition="DockedBottom">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Pane Bottom 1" IsPinned="False">
                        <TextBlock Text="Pane Bottom 1" />
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>
    </Grid>
</Window>

Any ideas?
George
Telerik team
 answered on 11 Oct 2013
1 answer
114 views
Hey guys,

I was wondering if there was anyway to force a floating-only pane to stay inside a certain boundary. For example, lets say I have a RadPane that takes up the top half of the screen. I would like the smaller floating pane to be restricted to stay inside that RadPane's border, so the user cannot 'float' the pane to the bottom half of the screen.

Is this possible?

Thanks,
Niko
Vladi
Telerik team
 answered on 11 Oct 2013
5 answers
412 views
Is there any (easy) way to create a fixed width label with a variable width edit control (anchored at left, expands to fill available space to the right)? I am not AutoGenerating the fields, but I would prefer to use the telerik:DataFormDataField control for the sake of simplicity, rather than butcher together my own mess using a StackPanel or something similar.

I have a number of resizable forms, and the default way that labels and controls resize themselves doesn't really work that well.

Thanks,

Dan.
Ivan Ivanov
Telerik team
 answered on 11 Oct 2013
3 answers
114 views
Hi,

I am trying to use GridViewComboBoxColumn in a RadTreeListView, but for some reason, the combobox field is always empty. Can someone tell me what am I doing wrong?


    public class WorkItemTree
    {
        public ObservableCollection<WorkItemNode> workItems
        {
            get;
            set;
        }
   }
 
    public class WorkItemNode
    {
        public ObservableCollection<WorkItemNode> Children
        {
            get;
            set;
        }
 
        public int Id
        {
            get;
            set;
        }
 
        public string Title
        {
            get;
            set;
        }
 
        public string State
        {
            get;
            set;
        }
        public List<MyState> States
        {
            get;
            set;
        }
}
 
    public class MyState
    {
        public string Name
        {
            get;
            set;
        }
    }
 
this.radTreeListView.ItemsSource = TFSManager.workItems.workItems;
 
<Window
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="TFSTreeView.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
 
        <telerik:RadTreeListView x:Name="radTreeListView"
                                 AutoGenerateColumns="False" ScrollMode="Deferred"
                                 LoadingRowDetails="radTreeListView_LoadingRowDetails"
                                 RowDetailsVisibilityMode="Visible"  Margin="0,0,0,-23"
                                 IsReadOnly="True"
                                 DataLoaded="radTreeListView_DataLoaded"
                                 >
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewComboBoxColumn Name="State" Header="State" DataMemberBinding="{Binding State, Mode=TwoWay}" ItemsSource="{Binding States}" DisplayMemberPath="Name" SelectedValueMemberPath="Name"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}"
                                    Header="Title" />
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
 
         
    </Grid>
</Window>

Dimitrina
Telerik team
 answered on 11 Oct 2013
1 answer
178 views
Hello,

I'm currently working on a WPF application which has a few RadNumericUpDown controls and RadMaskedNumericInput controls.

We are working with data annotations to perform validation (including custom validation)

Now i've noticed that for RadMaskedNumericInput controls, it will display the validation message next to the control and change the border color to red.
However, for RadNumericUpDown controls it only changes the border to red but doesn't display the message.

Is this standard behaviour or am I missing something?


Kind regards,
Kalin
Telerik team
 answered on 11 Oct 2013
3 answers
154 views
Hi,

we would like to do some tweaks in Property Grid Fields styling. Sometimes the property names are too long and overlap with the fields.

 I suppose the way to go is to edit the GridField template, but we are struggling to find it/generate it in Blend (using the Windows8 Theme).

Any ideas?
Thanks,
Stevo
Ivan Ivanov
Telerik team
 answered on 11 Oct 2013
4 answers
447 views
Hi, Telerik!

     I need to override default theme "Office_Black" and save ability for dynamically theme changing. I looked around this help (http://www.telerik.com/help/wpf/styling-apperance-themes-runtime.html). And found problem with inheritance styles. It's need using BasedOn attribute to inherite my default theme. This attribute is limited to StaticResources.
     How can I dynamically change custom style base theme? Hope for the further request!

Regards,
Anatoliy
Rosen Vladimirov
Telerik team
 answered on 11 Oct 2013
1 answer
157 views
I have been working on a user control to simplify chart generation based on our needs. We adhere strictly to MVVM. I created a content control in XAML and am creating all of the Telerik charting in the view model and binding the chart to the content control. So far it has gone fairly smooth but with a hitch. I am trying to display the grid lines declared in code but the grid lines simply aren't showing up. Is it not possible to generate the grid with appropriate grid lines in code? Note that I have been focusing on the bar series in the following code:

public void Create2DCharting(ObservableCollection<CategoricalDataItem> data, NewChartTheme chartTheme)
        {
            this.ShowCartesian3DChart = false;
            BarSeries barSeries = new BarSeries();
            if (chartTheme.ColorBrushes.Count > 0)
            {
                for (int i = 0; i < data.Count; i++ )
                {
                    data[i].Color = chartTheme.ColorBrushes[i];
                }
            }
 
            if (chartTheme.ChartTp == ChartType.PieChart || chartTheme.ChartTp == ChartType.DoughnutChart)
            {
                this.ShowPieChart = true;
                this.ShowCartesian2DChart = false;
 
                this.PieChart = new RadPieChart();
                this.PieChart.Palette = new ChartPalette();
 
                foreach (CategoricalDataItem cdi in data)
                    PieChart.Palette.GlobalEntries.Add(new PaletteEntry(cdi.Color, cdi.Color));
 
                if (chartTheme.ShowLegend)
                {
                    this.ChartLegend = new RadLegend();
                    this.ChartLegend.Items = this.PieChart.LegendItems;
                }
            }
            else
            {
                this.ShowPieChart = false;
                this.ShowCartesian2DChart = true;
                this.CartesianChart2D = new RadCartesianChart();
 
 
                if (chartTheme.BackgroundColor != null)
                    this.CartesianChart2D.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(chartTheme.BackgroundColor));
 
                barSeries.HorizontalAxis = new CategoricalAxis();
                barSeries.VerticalAxis = new LinearAxis();
 
                if (chartTheme.ShowLegend)
                {
                    this.ChartLegend = new RadLegend();
                    barSeries.ItemsSource = data;
                    barSeries.ValueBinding = new PropertyNameDataPointBinding("YValue");
                    barSeries.CategoryBinding = new PropertyNameDataPointBinding("XValue");
 
                    LegendItemCollection lic = new LegendItemCollection();
 
                    foreach (var d in data)
                        lic.Add(new LegendItem() { MarkerFill = (Brush)d.Color, MarkerStroke = (Brush)d.Color, Title = d.XValue });
 
                    this.ChartLegend.Items = lic;
                }
                else
                {
                    barSeries.ItemsSource = data;
                    barSeries.ValueBinding = new PropertyNameDataPointBinding("YValue");
                    barSeries.CategoryBinding = new PropertyNameDataPointBinding("XValue");
                }
            }
 
            switch(chartTheme.ChartTp)
            {
                case ChartType.BarChart :
                    if(chartTheme.ColorBrushes.Count > 0)
                        barSeries.PointTemplate = GetBarColorDataTemplate();
 
                    if (chartTheme.ShowGridLines)
                        this.CartesianChart2D.Grid = new CartesianChartGrid() { MajorLinesVisibility = GridLineVisibility.Y };
 
                    this.CartesianChart2D.Series.Add(barSeries);
 
                    break;
                case ChartType.HorizontalBarChart :
                    barSeries.VerticalAxis = new CategoricalAxis();
                    barSeries.HorizontalAxis = new LinearAxis();
 
                    if(chartTheme.ColorBrushes.Count > 0)
                        barSeries.PointTemplate = GetBarColorDataTemplate();
 
                    this.CartesianChart2D.Series.Add(barSeries);
                    break;
                case ChartType.LineGraph :
                    LineSeries lineSeries = new LineSeries();
 
                    lineSeries.HorizontalAxis = new CategoricalAxis();
                    lineSeries.VerticalAxis = new LinearAxis();
 
                    lineSeries.ItemsSource = data;
                    lineSeries.ValueBinding = new PropertyNameDataPointBinding("YValue");
                    lineSeries.CategoryBinding = new PropertyNameDataPointBinding("XValue");
 
                    lineSeries.PointTemplate = GetLineDataPointDataTemplate();
 
                    this.CartesianChart2D.Series.Add(lineSeries);
                    break;
                case ChartType.PieChart :
                    PieSeries pieSeries = new PieSeries();
                    pieSeries.ItemsSource = data;
                    pieSeries.ValueBinding = new PropertyNameDataPointBinding("YValue");
                    PieChart.Series.Add(pieSeries);
                    break;
                case ChartType.DoughnutChart :
                    DoughnutSeries doughnutSeries = new DoughnutSeries();
                    doughnutSeries.ItemsSource = data;
                    doughnutSeries.ValueBinding = new PropertyNameDataPointBinding("YValue");
                    PieChart.Series.Add(doughnutSeries);
                    break;
            }
 
        }
 
private DataTemplate GetBarColorDataTemplate()
        {
            StringReader markup = new StringReader(
                @"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">" +
                @"<Rectangle Fill=""{Binding DataItem.Color}""/>" +
                @"</DataTemplate>");
            XmlReader xmlReader = XmlReader.Create(markup);
            return XamlReader.Load(xmlReader) as DataTemplate;
        }
 
        private DataTemplate GetLineDataPointDataTemplate()
        {
            StringReader markup = new StringReader(
                @"<DataTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">" +
                @"<Ellipse Height=""10"" Width=""10"" Fill=""{Binding DataItem.Color}""/>" +
                @"</DataTemplate>");
            XmlReader xmlReader = XmlReader.Create(markup);
            return XamlReader.Load(xmlReader) as DataTemplate;
        }
Petar Kirov
Telerik team
 answered on 11 Oct 2013
1 answer
65 views
Hi!

Is it possible, that the INotifyPropertyChanged of my business object is not raised after a value in a cell was edit?

Thank you,
Manuel
Rossen Hristov
Telerik team
 answered on 11 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?