Telerik Forums
UI for WPF Forum
2 answers
69 views
When the user presses enter the selection of the radgridview goes to the next row. I don't want this behaviour. Is there a way to prevent this as there is no SelectionChanging event on the radgridview yet?
Davy Tavernier
Top achievements
Rank 1
 answered on 20 Sep 2010
3 answers
103 views

I have two treeviews, the "A" is an inventory of stuff, and "B" is a "shopping list". In "A" I don't want any changes and no drop is allowed.

Problems:

1. On "A"  treeview I don't want any drop at all so I have IsDropAllowed=False on each RadTreeViewItem, but still I can drop between two items, I don't want that, what to do?

2. When I drag from "A" to "B" the item removes on "A" treeview, I don't want items removed on my "stuff list". 

3. When drop on "B" treeview I can drop between RadTreeViewItems, I only want to drop on specific Items. How to solv that?

My code is based on Telerik "DragDrop.Example", so no drag-drop code in C#, only WPF. But code is OK for this solution.

Thanks!
Daniel Munnings
Top achievements
Rank 1
 answered on 20 Sep 2010
2 answers
85 views
I have a RadChart which receives data in a fairly ordered fashion (the data points are not guarenteed to be ordered, but almost always are). However, charts seem to have their data ordered bizarrely (I'm basically trying to sort by the XCategory). If I apply an ascending sort descriptor to the chart, there is no effect; descending does indeed "go in reverse" but the data still isn't actually sorted. For horizontal bar charts this results in shuffled data, but for line charts, it results in tens of lines darting horizontally back and forth. The sort descriptors are added to both RadChart.SortDescriptors and SeriesMapping.SortDescriptors. A grouping is in effect, but not by XCategory.

Is this a common pitfall? Is something obvious missing?
Adam Petaccia
Top achievements
Rank 1
 answered on 17 Sep 2010
4 answers
104 views
I have a RadCarousel (not RadCarouselPanel) which is sometimes updated from an external source, or via the mouse, etc. What I need to be able to do is be notified that RadCarousel (or its panel) is changing which items are in view, and discover them so that the rest of the UI may update its state accordingly.

What events would I need to bind to in order to accomplish this?
Adam Petaccia
Top achievements
Rank 1
 answered on 17 Sep 2010
2 answers
89 views
I have some charts which require multiple groupings. Unfortunately, this tends to create a new chart legend item for each possible combination. For example, my first grouping (by Foos) may contain A, B, and C. The second grouping (say Bars) may contain 1, 2, and 3. Currently what happens is that RadCharts generate a new item for all combinations leading to A1, A2, A3, B1, B2, etc. This is overkill as the chart legend quickly becomes over populated and the number of unique colors required would be extreme (more than Telerik has).

Rather than this behavior, I would like for the data to be grouped by both Foos and Bars, but rely on tooltips to display the additional data. So the bars would be located in the same position as with multiple groupings, but rather than going A1 A2 A3 B1 B2 B3 it read 1 2 3 1 2 3 and be colored as such.
Adam Petaccia
Top achievements
Rank 1
 answered on 17 Sep 2010
1 answer
43 views
Is there any resolution to the issue when displaying a drilldown chart using the drilldown sample code that when it displays off screen it just flashes over and over?

The issue was discussed in this thread... 

Thanks,
Mike
Giuseppe
Telerik team
 answered on 17 Sep 2010
3 answers
195 views
Hello

There is an unresolved problem considering the theme which should be applied to RadDocking control in run-time mode.
Here a little code snippet:
 public MainWindow() 
        { 
            StyleManager.ApplicationTheme = new Office_BlueTheme(); 
            InitializeComponent();   
        } 
 
private void RadButton_Click(object sender, RoutedEventArgs e) 
        { 
            StyleManager.ApplicationTheme = new Office_SilverTheme(); 
            StyleManager.SetTheme(myRadDocking, StyleManager.ApplicationTheme); 
        }      

This code can be applied to any sample project (where Docking control is used) available on your forum. The problem is that when this code is executed:
StyleManager.ApplicationTheme = new Office_SilverTheme(); 
StyleManager.SetTheme(myRadDocking, StyleManager.ApplicationTheme); 

the layout of Docking windows will be destroyed. It stops working correctly. Please take a look on this and advise what can I do to resolve this problem. Note: this is not the Windows7Theme issue, this considers all themes.

Thanks
Konstantina
Telerik team
 answered on 17 Sep 2010
1 answer
91 views
Hi,

Lately, I made a custom map provider class to use ArcGis tile web service. 
The map runs fine but the the information/dynamic layers are missing/not showing. 
Also the navigation control is missing while it is set on visible. 
Did I forgot anything specific or do you know a way to fix this?

Kind Regards,

Martijn
Andrey
Telerik team
 answered on 17 Sep 2010
7 answers
1.0K+ views

We are trying to set the conditional style of a RadGridView cell programatically using the CellStyleSelector however, while no errors occurs the styling is not being reflected in the grid.  Our columns in the RadGridView are populated by binding to an ObservableCollection and are not defined explicitly in XAML.

We're not sure what we are doing wrong and wanted to see if you could give us some pointers on what we're missing.

If the value in a cell is negative we would like the cell to be colored red and if the value is positive we'd like the cell to be the normal color.

//We are trying to set the style of a cell to red if it is negative and it is not working.  Value converter is working fine though.
private void GridView_AutoGenerateColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)
        {
            if (e.Column.UniqueName == "Something")
            {
                //Styles
                // Negative Style
                Style negativeStyle = new Style();
                negativeStyle.TargetType = typeof(GridViewCell);
  
                Setter backGroundSetter = new Setter();
                backGroundSetter.Property = GridViewCell.BackgroundProperty;
                backGroundSetter.Value = Brushes.Red;
                negativeStyle.Setters.Add(backGroundSetter);
  
                // Positive Style
                Style normalStyle = new Style();
                normalStyle.TargetType = typeof(GridViewCell);
  
                //Selector and Rules
                ConditionalStyleSelector selector = new ConditionalStyleSelector();
                ConditionalStyleRule negativeRule = new ConditionalStyleRule();
                negativeRule.Style = negativeStyle;
                negativeRule.Value = false;
                ConditionalStyleRule normalRule = new ConditionalStyleRule();
                negativeRule.Style = normalStyle;
                negativeRule.Value = true;
  
  
                selector.Rules.Add(negativeRule);
                selector.Rules.Add(normalRule);
                NegativeValueConverter converter = new NegativeValueConverter();
                selector.ConditionConverter = converter;
                e.Column.CellStyleSelector = selector;
            }
        }
  
  
public class NegativeValueConverter : IValueConverter
    {
        #region IValueConverter Members
  
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            SupplyAdjustmentModel converterValue = (SupplyAdjustmentModel)value;
  
            if (converterValue != null)
            {
                return converterValue.Value > 0 ? true : false;
            }
  
            return null;
        }
  
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
  
        #endregion
    }
  
/// <summary>
    /// Conditional style selector
    /// Example Usage: To conditionally style the cell in a grid based on a set of rules (e.g. negative number = red cell)
    /// </summary>
    public class ConditionalStyleSelector : StyleSelector
    {
        public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container)
        {
            object conditionValue = this.ConditionConverter.Convert(item, null, null, null);
            foreach (ConditionalStyleRule rule in this.Rules)
            {
                if (Equals(rule.Value, conditionValue))
                {
                    return rule.Style;
                }
            }
  
  
            return base.SelectStyle(item, container);
        }
  
        List<ConditionalStyleRule> _Rules;
        public List<ConditionalStyleRule> Rules
        {
            get
            {
                if (this._Rules == null)
                {
                    this._Rules = new List<ConditionalStyleRule>();
                }
  
                return this._Rules;
            }
        }
  
        IValueConverter _ConditionConverter;
        public IValueConverter ConditionConverter
        {
            get
            {
                return this._ConditionConverter;
            }
            set
            {
                this._ConditionConverter = value;
            }
        }
    }
  
    public class ConditionalStyleRule
    {
        object _Value;
        public object Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }
  
        Style _Style;
        public Style Style
        {
            get
            {
                return this._Style;
            }
            set
            {
                this._Style = value;
            }
        }
    }
Maya
Telerik team
 answered on 17 Sep 2010
1 answer
109 views

Hi,

Can i group columns in Radgridview, which will shows one of the following data :
 

  - RowCount.

  - Average of a column.

  - Maximum of a column.

  - Minimum of a column.

  - Sum of a column.

Thanks,
-Narendra

 

Veselin Vasilev
Telerik team
 answered on 17 Sep 2010
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?