Telerik Forums
UI for WPF Forum
4 answers
250 views
Hi,


I've got some problems with the GridView style:

1) How can I change the background of a RowIndicator. I tried this but it doesn't works:

 

 

 

 

<Style x:Key="{x:Type telerik:GridViewIndicatorCell}" TargetType="telerik:GridViewIndicatorCell">   
    <Setter Property="Background" Value="{StaticResource GridViewHeaderCellBackgroundBrush}" />   
</Style> 
 
 

 

 

 

 

 

2) How can I change the height of the columns header? This is not working correctly:

 

 

 

 

<Style TargetType="telerik:GridViewHeaderCell">   
    <Setter Property="Height" Value="50" />   
</Style> 
 
 

3) I've tried this:

 

 

 

 

<Style TargetType="{x:Type telerik:GridViewCell}">   
    <Setter Property="OverridesDefaultStyle" Value="False" />   
    <Setter Property="Validation.ErrorTemplate" Value="{x:Null}" />   
    <Style.Triggers>   
        <Trigger Property="Validation.HasError" Value="True">    
            <Setter Property="BorderThickness" Value="1" />    
            <Setter Property="BorderBrush" Value="Red" />   
            <Setter Property="ToolTip" Value="{Binding RelativeSource= {RelativeSource Self},                                                       Path=(Validation.Errors)[0].ErrorContent}" />    
        </Trigger>   
    </Style.Triggers>    
</Style> 
 
 

 

 

 

 

 

 

 

 

but this column doesn't work anymore after that (Cell is empty):

 

 

 

 

<telerik:GridViewColumn>    
<telerik:GridViewColumn.CellStyle>    
<Style TargetType="{x:Type telerik:GridViewCell}">    
    <Setter Property="Template">    
        <Setter.Value>    
            <ControlTemplate TargetType="{x:Type telerik:GridViewCell}">    
                <Border Background="{TemplateBinding Background}"    
                              BorderBrush="{TemplateBinding BorderBrush}"   
                              BorderThickness="{TemplateBinding BorderThickness}">   
                        <Button Style="{StaticResource GridImageButton}"     
                                     Click="Delete_Click">    
                                <Image Source="{StaticResource Delete}" />    
                        </Button>   
                </Border>     
            </ControlTemplate>    
        </Setter.Value>    
    </Setter>    
</Style>    
</telerik:GridViewColumn.CellStyle>    
</telerik:GridViewColumn> 
 

 

 

 

 

 

 

 

 

 

Do you know why?

Thanks,

Xavier.

 

 

 

 

 

 

 

 

 

Steffen
Top achievements
Rank 1
 answered on 11 May 2009
3 answers
215 views
Hi

     I am developing an application in which I require drag drop between two tree. But this is not directly supported in RadTreeView control,so can you suggest me how I can implement it using your RadTreeView control. Please provide me sample code if possible.
I need to implement it in urgent,so please respond it as soon as possible

Thanks in advance
Konstantin Petkov
Telerik team
 answered on 11 May 2009
2 answers
423 views
Can the NumberFormatInfo values (e.g. NumberDecimalDigits) be set in XAML or must they be set in the code behind? The OnLine help only gives examples using code behind.
Greg
Top achievements
Rank 2
 answered on 08 May 2009
1 answer
101 views
Hi,
    I just saw WPF Demo, nice work! By the way, I like the transitions when you click on navigation bar. I am new to WPF, I tried to look into code couldnt figure out how it is done. is there any way you can publish simple code here ? Do Telerik have plan to have transitions in Winforms too?

Thank you
Dwight
Telerik team
 answered on 08 May 2009
9 answers
208 views
Hi!

After upgrading to the latest release, I no longer receive updates after cells/rows have been edited.

I have attached a small example which I believe would work under last version (can't verify this since I have uninstalled it) but not under Q1.

Is there another way to hook up the events, or some other way to detect changes?

Thanks!

<Window x:Class="GraphTest.Window2" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window2" Height="300" Width="300" Loaded="Window_Loaded">  
    <Grid> 
        <telerik:RadGridView  AutoGenerateColumns="True" telerik:GridViewCell.EditEnded="gridview_EditEnded" telerik:GridViewRow.EditEnded="gridview_RowEditEnded" x:Name="gridview"  Grid.Column="0" Grid.Row="0" > 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 
using System.Windows;  
using System.Collections.ObjectModel;  
 
namespace GraphTest  
{  
    /// <summary>  
    /// Interaction logic for Window2.xaml  
    /// </summary>  
    ///   
 
    public partial class Window2 : Window  
    {  
        public Window2()  
        {  
            InitializeComponent();  
        }  
 
 
        private void Window_Loaded(object sender, RoutedEventArgs e)  
        {  
            gridview.ItemsSource = new TestList();  
        }  
 
        private void gridview_RowEditEnded(object sender, Telerik.Windows.Controls.GridView.Rows.RecordRoutedEventArgs e)  
        {  
            // Never gets called  
            MessageBox.Show("Row edit");  
        }  
 
        private void gridview_EditEnded(object sender, Telerik.Windows.Controls.GridView.Cells.CellRoutedEventArgs e)  
        {  
            // Never gets called  
            MessageBox.Show("Cell edit");  
        }  
 
    }  
 
    public class TestDataEntry  
    {  
        public int id { getset; }  
        public string value { getset; }  
    }  
 
    public class TestList : ObservableCollection<TestDataEntry>  
    {  
        public TestList()  
        {  
 
            Add(new TestDataEntry() { id = 1, value = "something" });  
            Add(new TestDataEntry() { id = 2, value = "something else" });  
        }  
 
    }  
}  
 


Nedyalko Nikolov
Telerik team
 answered on 07 May 2009
3 answers
93 views
I've got an application that updates the display every 5 mins or so and today I received this exception after it had been running for a couple hours.  I'm not using the tool tip at all so I just thought I'd make you aware of it.  The charts being shown are all 2D (1 pie, 1 bar and 2 line charts) and don't implement any user interactive behaviour.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Charting.BaseChartItem.get_ItemToolTipTimer()
   at Telerik.Windows.Controls.Charting.BaseChartItem.HideToolTip()
   at Telerik.Windows.Controls.Charting.BaseChartItem.BaseChartItemMouseLeave(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.MouseOverProperty.FireNotifications(UIElement uie, ContentElement ce, UIElement3D uie3D, Boolean oldValue)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(DependencyObject element, Boolean oldValue, DeferredElementTreeState treeState)
   at System.Windows.ReverseInheritProperty.OnOriginValueChanged(DependencyObject oldOrigin, DependencyObject newOrigin, DeferredElementTreeState& oldTreeState)
   at System.Windows.Input.MouseDevice.ChangeMouseOver(IInputElement mouseOver, Int32 timestamp)
   at System.Windows.Input.MouseDevice.PreNotifyInput(Object sender, NotifyInputEventArgs e)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.MouseDevice.Synchronize()
   at System.Windows.Input.MouseDevice.OnHitTestInvalidatedAsync(Object sender, EventArgs e)
   at System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
 



Vladimir Milev
Telerik team
 answered on 07 May 2009
2 answers
147 views
I've got 3 charts in my app. When I don't specify a series.Definition, it works great. When I do, I find that it locks up my app if I call DataSeries.Clear() or if I try to replace a data series. I found a kludgey work-around by calling DataSeries.Reset(), then re-adding the data series, however, I'm seeing a lot of overhead with this method.

When I tried to create my DataSeries on a background thread, then call Dispatcher.BeginInvoke() to update the graph on the UI, I'm getting, "The calling thread cannot access this object because a different thread owns it." If I remove the series.Defintion and have the graph draw as a bar graph instead of a line graph, there are no problems whatsoever.

I'm supposed to be showing this at a trade show tomorrow and I'm stuck. It appears that when I specify a LineSeriesDefinition, a new thread internal to the control is introduced into the equation and it's wreaking havoc. Help!

Below is some of the code.

StartUpdatingCharts() is called from a timer:

protected void StartUpdatingCharts(object dummy)

{

    foreach (object currentGraph in ActiveGraphs)

    {

        Thread t = new Thread(UpdateChartInBackground);

        t.Start(currentGraph);

    }

}


public void UpdateChartInBackground(Object threadContext)

{

    GraphControl currentGraph = threadContext as GraphControl;

    FillChartWithData(currentGraph);

}




FillChartWithData() is called from a background thread:

protected override void FillChartWithData(GraphControl graphControl)

{

    Dictionary<string, double> returnValues = Msi.GetReservoirData(graphControl.Arguments);

    DataSeries series = new DataSeries();

    series.Definition.ShowItemLabels = false;

    LineSeriesDefinition definition = new LineSeriesDefinition();

    definition.ShowItemLabels = false;

    definition.ShowPointMarks = false;

    //series.Definition = definition;  //THIS IS THE LINE THAT CAUSES ALL OF THE PROBLEMS!

 


    foreach (string sectionName in returnValues.Keys)

    {

        series.Add(new DataPoint(returnValues[sectionName]));

    }


    ChartArea
chartArea = graphControl.RadChart.DefaultView.ChartArea;

    chartArea.Dispatcher.BeginInvoke(new UpdateChart(BindDataToChart), chartArea, series);

}

 


private
delegate void UpdateChart(ChartArea chartArea, DataSeries series);


private static void BindDataToChart(ChartArea chartArea, DataSeries series)

{

 

    chartArea.DataSeries.Clear();

    chartArea.DataSeries.Add(series);

}

 

 

Mike
Top achievements
Rank 1
 answered on 06 May 2009
5 answers
174 views
Hello,

I would need a 3D surface graph, is it planned ?

Thanks
Mike
Top achievements
Rank 1
 answered on 06 May 2009
1 answer
67 views
When you create the radgrid on the fly and view it to the user you cannot drag any of the columns to group by (it doesnt let you).

Example:

Telerik.Windows.Controls.

RadGridView grid = new Telerik.Windows.Controls.RadGridView();

 

grid.ItemsSource = e.Result;

grid.IsReadOnly =

true;

 

grid.SelectionChanged +=

new EventHandler<Telerik.Windows.Controls.SelectionChangeEventArgs>(grid_SelectionChanged);

 

grid.CanUserSortColumns =

true;

 

grid.CanUserReorderColumns =

true;

 

 

 

Telerik.Windows.Controls.

RadWindow window = new Telerik.Windows.Controls.RadWindow();

 

window.Header =

"Product Listing";

 

window.Content =

null;

 

window.Content = grid;

window.ShowDialog();

window.Closed +=

new EventHandler<Telerik.Windows.Controls.WindowClosedEventArgs>(window_Closed);

In this example the window's content contains the grid that was pieced together at runtime but the user cannot group by any of the columns.

Is this a bug or am I doing something wrong here?

Thanks

 

Stefan Dobrev
Telerik team
 answered on 06 May 2009
3 answers
421 views
How can I hide the row header with the week number?
Miroslav
Telerik team
 answered on 06 May 2009
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?