Telerik Forums
UI for WPF Forum
3 answers
97 views

I saw that you create a dynamic object that wraps the items in the IEnumerable I supply.

None of the attributes is being passed to the dynamic object. As a result, the PropertyDefinition EditorAttribute is null, and if I look at PropertyDefinition.SourceProperty, then it has no attributes.

 

Let me start by explaining why these attributes are important in my case:

Due to compatibility, and for ease of development, I use the Browsable attribute in order to filter properties that we don't want (In that case, I filter out, in the AutoGeneratingPropertyDefinitions event, properties with either Browsable = false, or properties without the browsable property. With such way, I don't care if a property was added to the ViewModel. Instead of setting Browsable=False to lots of lots of properties, I only add True to those I want to show).

 

Another useful scenario:

On some properties, I want to put a slider (bound to an int), and I want to be able to control the Minimum, and the Maximum of the slider.

Currently, this is not possible using the EditorAttribute.

I've added a new custom attribute called PropertyValueAttribute, which gets a string of the property name, and the value (object), and on the FieldLoaded event, I use reflection in order to set the required properties into the actual editor.

 

These are just small examples of how the attributes can be used in these cases.

 

However, none of these attributes is being copied into the dynamic object, and furthermore, the editor itself is not being set (so I'm seeing the default editor supplied by you, if any...)

This surely looks like a bug.

 

 

Furthermore, is there any way of getting the instance of the dynamic object? (the Item property returns the IEnumerable, and if I want to do some biding to the dynamic object, then I can't).

 

 

Another question:

If I decide to work in Unbound mode, then I need to create my own PropertyDefinition, but I cannot supply the EditorAttribute to it (since this property is internal/private).

I don't want to use EditorTemplate, since I already have the attribute in ViewModel and it contains the type of the editor and the name of the property in the control that is bound to the actual property in the view model.

Why is this EditorAttribute property inaccessible? (is there any good reason?)

 

 

Thanks

Maya
Telerik team
 answered on 08 Feb 2016
3 answers
429 views

Hello,

I'm working with the Office 2013 theme, perhaps the problem is not visible in other theme.

I have a WPF application with a combo box that can be enabled/disabled with a click on a button on the ribbon. Clicking on the button doesn't change the focus (that's important).

I the combo box is enabled and has the focus, pressing the ribbon button disables the combo box, but it stilll shows that it has the focus. When moving the focus to another control, the combo box still shows the focus state.

I think that the focus state should only be displayed when the combo box is enabled.

Yana
Telerik team
 answered on 08 Feb 2016
1 answer
79 views

I have a RadGridView that I am trying to put a custom filter on. The field that I am trying to put the filter on is actually a List<string> field that I am formatting into a comma delimited list with a Converter object. If I have it set up that way, the RadGridView refuses to accept the CompositeFilterDescriptor object (using the Contains operator), but if I format the List<> to a comma delimited string before populating the GridView and forgo the Converter, it works fine.

 

Is there anything special you have to do when the field is a List<> or is it possible at all?

Yoan
Telerik team
 answered on 08 Feb 2016
3 answers
228 views

Hello,

I'm trying to figure out how to relate GroupDescriptors that I add to my Grid with the Groups that get created from them.  I essentially want to say "Group my Grid by column X (using a ColumnGroupDescriptor), and have that group be expanded by default."  I don't want *all* groups to be expanded by default, though, just specific ones.

I see that there is an ExpandGroup() method exposed off of GridView that can expand individual groups for me, but I don't see how the actual groups in GridView.Items.Groups are related to the GroupDescriptors used to create them.

 Is there a good way for me to accomplish this?

 

Thanks,

Ryan

Stefan
Telerik team
 answered on 08 Feb 2016
1 answer
87 views

It happens if you add the contextual group in code, and it is set as active.

The size of the Tab inside the group should also be larger then the size of the header. The result is at appeared in the image.

 

Here is the code:

Main window xaml:

<telerik:RadRibbonWindow x:Class="ContextualTab_Bug.MainWindow"
        Title="MainWindow" Height="350" Width="525" WindowState="Maximized">
     
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
 
        <telerik:RadRibbonView telerik:StyleManager.Theme="Windows7" ApplicationButtonContent="Home" x:Name="ribbon">
            <telerik:RadRibbonTab Foreground="Black" Header="Edit" telerik:KeyTipService.AccessText="E">
            </telerik:RadRibbonTab>
 
            <telerik:RadRibbonTab Header="Controller" Foreground="Black" telerik:KeyTipService.AccessText="P" IsSelected="True">
            </telerik:RadRibbonTab>
 
            <telerik:RadRibbonTab Header="Tools" ToolTip="Tools" telerik:KeyTipService.AccessText="T">
            </telerik:RadRibbonTab>
 
            <telerik:RadRibbonTab Header="Help" telerik:KeyTipService.AccessText="S">
            </telerik:RadRibbonTab>
        </telerik:RadRibbonView>
         
        <Button HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Click="Button_Click">Add Contextual Tabs</Button>
    </Grid>
</telerik:RadRibbonWindow>

 

 

 code behind that demonstrates the problem:

   public partial class MainWindow : RadRibbonWindow
    {
        bool tabWasAdded = false;
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (!tabWasAdded)
            {
                RadRibbonContextualGroup telerikContextualTab = new RadRibbonContextualGroup()
                {
                    Name = "ct",
                };
 
                telerikContextualTab.Header = "Alarm";
                telerikContextualTab.IsActive = true;
                telerikContextualTab.Color = Brushes.Red;
 
                RadRibbonTab tab = new RadRibbonTab();
                tab.Header = "Alarms";
                tab.ContextualGroupName = "ct";
 
                ribbon.ContextualGroups.Add(telerikContextualTab);
 
                ribbon.Items.Insert(ribbon.Items.Count - 1, tab);
                tabWasAdded = true;
            }
            else
            {
                ribbon.ContextualGroups[0].IsActive = !ribbon.ContextualGroups[0].IsActive;
            }
        }
    }
}

 

 

If you click the twice again, then the contextual tabs will become inactive and then active, and this time, it will appear correctly.

It will also be drawn with the correct size, if you just resize the window.

 

 

I have a workaround for this issue:

Add the group with IsActive=false, and then Set the IsActive=true with BeginInvoke with priority Render and higher...

Martin Ivanov
Telerik team
 answered on 08 Feb 2016
1 answer
133 views

Hi,

 

I would like to know if it's possible to remove the group button in the control?

 

Thank's

Alain

Stefan
Telerik team
 answered on 08 Feb 2016
1 answer
78 views

Good  Evening,
there is a manner to diplay Document Host Strip on the right. I've read the thread where you explain how to set it bottom.
If it isn't possible, which componont can I use alternatively?

 

Thank you

Yana
Telerik team
 answered on 08 Feb 2016
1 answer
129 views

Hi, I need a couple of text rendering features that I can't find in your docs, and precisely:

1. Character spacing (horizontally): a numeric parameter to modify the spacing between chars. This measure could be expressed in pixels, points, percentage or whatever, the effect is that the single letters on the same line will be shown with a different spacing in between.

2. Show text in uppercase: a boolean switch. If enabled the text is shown in uppercase. When switched off, text will show back in original case, as it was written by the user. For this reason, this parameter must not modify the underlying text, only render it as uppercase when activated.

Are these features already implemented (and I just couldn't find them) or are they missing?

 

Thanks in advance.

Boby
Telerik team
 answered on 08 Feb 2016
2 answers
91 views

Hi,

Do you have a function to simplify a feature based on Geometry Algorithm ? 

We need to reduce the number of points in polyline - line - polygon. 

Thank you

 

 

Julien
Top achievements
Rank 1
 answered on 05 Feb 2016
7 answers
462 views

I’m developing a service where I need to create a chart using only code behind. The chart will then be exported to a bitmap and inserted into a RadDocument.

My code is:

Grid grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
 
RadCartesianChart chart = new RadCartesianChart();
chart.Grid = new CartesianChartGrid
             {
                 MajorLinesVisibility = GridLineVisibility.Y,
                 StripLinesVisibility = GridLineVisibility.Y
             };
 
chart.HorizontalAxis = new CategoricalAxis { PlotMode = AxisPlotMode.BetweenTicks };
chart.VerticalAxis = new LinearAxis { Minimum = 0, MajorTickLength = 5, Title = "Y axis title" };
 
// create series
for (int i = 0; i < series.Count; i++)
{
    LineSeries lineSeries = new LineSeries
                            {
                                Stroke = new SolidColorBrush(series[i].Color),
                                LegendSettings = new SeriesLegendSettings { Title = series[i].Title }
                            };
 
    foreach (var value in series[i].Values)
    {
        lineSeries.DataPoints.Add(new CategoricalDataPoint { Category = value.X, Value = value.Y });
    }
 
    chart.Series.Add(lineSeries);
}
 
RadLegend legend = new RadLegend
                   {
                       HorizontalAlignment = HorizontalAlignment.Center,
                       VerticalAlignment = VerticalAlignment.Bottom,
                       Items = chart.LegendItems
                   };
 
string panelTemplate = @"<ItemsPanelTemplate xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">" +
                       @"<StackPanel Orientation=""Horizontal""/>" +
                       @"</ItemsPanelTemplate>";
legend.ItemsPanel = (ItemsPanelTemplate)XamlReader.Parse(panelTemplate);
 
chart.SetValue(Grid.RowProperty, 0);
grid.Children.Add(chart);
 
legend.SetValue(Grid.RowProperty, 1);
grid.Children.Add(legend);
 
Size chartSize = new Size(width, height);
grid.Measure(chartSize);
grid.Arrange(new Rect(new Point(0, 0), chartSize));
 
grid.UpdateLayout();
 
RenderTargetBitmap bitmapRender = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32);
bitmapRender.Render(grid);
 
var encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmapRender));
 
encoder.Save(stream);

If I set a breakpoint where the RadLegend is created, I can see that the series I’ve created have been added to chart.Series but chart.LegendItems is empty.

If I continue and export the chart to a bitmap I get an empty image.

All the code seems to be alright, what am I doing wrong?


 
 
Cleanwatts
Top achievements
Rank 1
 answered on 05 Feb 2016
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?