Telerik Forums
UI for WPF Forum
1 answer
245 views
Hi -

I have a RadGridView bound to a DataTable. Some columns in the table are calculated (via the Expression in the DataColumn).
E.g. I have 3 columns called Position, Demand, and Generation. Position is setup like this (where table is the DataTable):

DataColumn dc = table.Columns["Position"];
dc.Expression = "-Demand+Generation";

(Actually it gets more complicated - there are up to 250+ columns about which I be submitting another question!)

The problem I have here is that when I change either the Demand or Generation column the Grid isn't picking up on the change to the Position column. If I switch to another window in the app and then back, or scroll so that the Position column isn't visible (there are a lot of columns!) then the new calculated figure is shown correctly.

Is there any way I can force the refresh of this calculated column without having to get the users to do this?

Thanks -
svs
Top achievements
Rank 1
 answered on 18 Apr 2013
6 answers
172 views
Dear sir,

I want to make a own custom settings pan to a custom diagram shape.
I referred to a Mindmap example in the  WPF demo. 
I tried to make SettingsPane.xaml like the Mindmap sample, but RadTabControl in SettingsPane.xaml seems to be worked abnormally.
It display a RadTabControl but it can not display RadTabItem content.

Could you tell me how to make a custom settings pan with TabControl?

I tested it with your demo source as follows.

[SettginsPan.xaml of Diagrams.WPF project in Demo]
<UserControl x:Class="Telerik.Windows.Examples.Diagrams.MindMap.SettingsPane"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Telerik.Windows.Examples.Diagrams.MindMap"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" d:DesignHeight="300" d:DesignWidth="300"
mc:Ignorable="d">
<Border MouseLeftButtonDown="Border_MouseLeftButtonDown">
<Grid Margin="15 15 0 15">
            <telerik:RadTabControl>
                <telerik:RadTabItem Header="General" Content="hello"/>
                <telerik:RadTabItem Header="Video Profiles"  Content="hello2"/>
            </telerik:RadTabControl>

       </Grid></Border>

It can't display content of RadTabItem. Actually I want to insert RadGridView into RadTabItem, but It doesn't work.
My custom shape should display fully customized settings pan content with tab control.

Thank you.
Pavel R. Pavlov
Telerik team
 answered on 18 Apr 2013
3 answers
298 views

Hello everyone, I've done recently the upgrade from WPF Q2 2012 to Q1 2013 and I've a strange problem with RadGridView.

In my project I've created an extension of Windows context menu, adding my custom options, and using one of these option a show a WPF Window that contained a RadGridView.
This Windows accepts some criteria to perform a search and its results is displayed into RadGridView. To avoid Windows freeze I've done a BackgroundWorker that call the backend WCF and after that update RadGridView.

In particular I've used MVVM pattern and before start BackgroundWorker I've used a RadBusyIndicator to show that current Window is busy during search operation.
With WPF Q2 2012 all works fine and, after search, RadGridView is updated correctly with operation results but when I upgrade my project to Q1 2013 I've the following exception when I try update RadGridView :
"The calling thread cannot access this object because a different thread owns it".

I try to search in this forum and I didn't find any idea to solve it, but in the release notes of Q1 2013 RadGridView I read this :
BUGFIX : "Support for source collection changes from a thread that is different from the UI thread".

Could it somehow involve with my problem?

Thanks in advance, Regards
Davide
Pavel R. Pavlov
Telerik team
 answered on 18 Apr 2013
6 answers
339 views
I've attached a sample project showing me trying to load 5000 rows and 14 columns. The data load happens when you click the button labeled "Push". This seems like it takes far too long to load this amount of data. Here is the XAML and designer code:

XAML:
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="WpfApplication2.MainWindow"
        Title="MainWindow" Height="350" Width="525" >
    <Grid>
        <StackPanel>
            <Button Content="Push" Click="Button_Click" />
            <telerik:RadGridView  ItemsSource="{Binding Data}" ColumnWidth="100" MaxColumnWidth="100"/>
        </StackPanel>
 
    </Grid>
</Window>

Designer:
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
 
    public IEnumerable<DataItem> Data {get;set;}
 
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        var data = new List<DataItem>();
        for (int i = 0; i < 5000; i++)
        {
            data.Add(new DataItem());
        }
 
        this.Data = data;
        this.DataContext = this;
    }
}
 
 
 
public class DataItem
{
    public string Col {get;set;}
    public string Col2 { get; set; }
    public string Col3 { get; set; }
    public string Col4 { get; set; }
    public string Col5 { get; set; }
    public string Col6 { get; set; }
    public string Col7 { get; set; }
    public string Col8 { get; set; }
    public string Col9 { get; set; }
    public string Col0 { get; set; }
    public string Col11 { get; set; }
    public string Col12 { get; set; }
    public string Col13 { get; set; }
    public string Col14 { get; set; }
}

I should add that this is using version 2012.2.912.40 of the WPF RadGridView component in a .NET 4.5 WPF application.

Dimitrina
Telerik team
 answered on 18 Apr 2013
2 answers
142 views
-
Vlad
Telerik team
 answered on 18 Apr 2013
1 answer
209 views
Hi, I have a project where I synchronize multiple controls. The RadGridView control is bound to an observable collection of data. Whenever I need to select multiple items, I execute
grid.UnselectAll();
grid.SelectedItems.Add(element);
.... do this for all selected elements .....

The grid does what it's suppose to do, however, I need to customize all selected rows to have blue font color. At first I tried using
grid.ItemContainerGenerator.ContainerFromItem(item) as GridViewRow

However I quickly learned that this will only work for rows currently visible (based on some other threads I have read). The item itself does not have any kind of "IsSelected" property, so customizing styles probably will not work. I am looking for a c#-based code solution to find all necessary rows and change the Foreground property.

Thanks in advance
Maya
Telerik team
 answered on 18 Apr 2013
1 answer
177 views
Hi,
I followed this example to add a button column in my grid using the data template solution
http://www.telerik.com/help/wpf/gridview-add-button-column.html

By default all the buttons have Visibility = "Hidden". I want to button to be made visible when user select a row.
By handling SelectionChanged Event and accessing SelectedItem I do get the selected row. But after that I have no idea how to access the custom column ..i.e. Radbutton in the selected row and change its property. Any ideas?

Thanks.
Vlad
Telerik team
 answered on 18 Apr 2013
3 answers
740 views
Hi Guys,

I downloaded telerik WPF controls trial version and intended to replace the Microsoft TreeView control in our existing product with Telerik RadTreeView. Currently, I am at the stage of building a prototype to make sure that all of the existing features are still working.

We have extended RadTreeView and RadTreeViewItem to support various stuff such as ViewModel binding, custom Events and custom Drag and Drop. 

Our custom drag and drop functionality utilizes the mouse events (i.e. take the mouse position on mouse down, decide whether it triggers a drag operation, end drag on mouse up, etc). 

For the last couple of days, I've been struggling with the conflicts in handling the MouseButtonDown in our drag and drop subsystem and the MouseButtonDown handle in RadTreeViewItem. Based on the Telerik forum posts, I found that the  MouseLeftButtonDown event is handled internally and if we want to handle the events we have to call AddHandler with the third parameter  set to true. 

http://www.telerik.com/community/forums/wpf/gridview/q3-mousedown.aspx
http://www.telerik.com/community/forums/silverlight/gridview/radgridview-mouse-event-handling-and-performance-issues-in-q3-2009.aspx

I've done the above workaround and able to handle the MouseLeftButtonDown. However because e.Handled is now set to true, all of the controls up in the visual tree that use MouseLeftButtonDown event must handle the MouseLeftButtonDown event through AddHandler call as well. Unfortunately, it is not possible at the moment to change other subsystem to use the AddHandler.

At the moment, I'm thinking of setting the 'Handled' value to false in the MouseLeftButtonDown handle (from the AddHandler call) and allow the event to be bubbled up. Are there any way to detect that the MouseLeftButtonDown event is handled within the Telerik control? Because our treeviewitem contains a contentcontrol that displays edit button and delete button, if those button are pressed, we still want the Handled property to be true. If there is a guaranteed way to detect whether the MouseLeftButtonDown is handled internally in Telerik control, I could live with it and set the Handled to false when that happen.

Or, is there a way to configure the Telerik RadTreeViewItem to not set the Handled property to true? 

PS: I only have one or two weeks trial left. Does anyone know what happen if the trial expires? Can I still continue building the prototype? 

Kind regards,
Andie
Andie
Top achievements
Rank 1
 answered on 18 Apr 2013
4 answers
100 views
I'm not sure if this is a bug, or if I'm doing something wrong, but when I change a string property of my business object, the gridpropertyview string editor field doesn't reflect the new value, I have to force the control to update (ie. type in the search field) for the new value to be displayed.  The radcombobox seems to update automatically, as does the checkbox.  Is there a way to force the update with the textbox automatically?
Andrew
Top achievements
Rank 1
 answered on 17 Apr 2013
2 answers
659 views
Hello,

Is it possible to make the RTF editor in control also an html editor? So if I allow user to create a document inside RTF editor, they can have choice to choose "edit source html" instead?

I thought this control allowed this?
Petya
Telerik team
 answered on 17 Apr 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?