Telerik Forums
UI for WPF Forum
3 answers
96 views
I can only see Text Editing commands and Clipboard commands in the default context menu, and i don't want to customize another context menu, is there any possibility that i can show Table Editing commands by just setting somethings.
Petya
Telerik team
 answered on 17 Dec 2013
5 answers
1.2K+ views
I have a number of WPF RadComboBox controls in a WPF window and am handling the LostFocus event for each one so that I know which field has just been left. However, when a RadComboBox control gets focus via a mouse click it seems to fire a LostFocus event before its GotFocus event, which is causing my code to think it's left a field before it's even got there! This appears to be different behaviour from the other Rad input controls I'm using (e.g. RadWatermarkTextBox, RadDateTimePicker, etc).

Note that this problem only occurs when changing focus between the fields using mouse clicks. It doesn't appear to occur when navigating between the fields using the Tab key.

Is this a known bug or am I doing something wrong? Either way, is there a fix or workaround available.

The following is the xaml and code behind from a sample WPF window I created to highlight the problem...

<Window x:Class="MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
         
        <StackPanel Grid.Row="0"  Height="Auto" HorizontalAlignment="Stretch" Name="StackPanel1" VerticalAlignment="Stretch" Width="Auto">
            <telerik:RadComboBox Name="Combo1" Text="One"
                                 Margin="2" IsEditable="True"
                                 GotFocus="RadComboBox_GotFocus"
                                 LostFocus="RadComboBox_LostFocus">
                <telerik:RadComboBox.Items>
                    <telerik:RadComboBoxItem>One</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Two</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Three</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Four</telerik:RadComboBoxItem>
                </telerik:RadComboBox.Items>
            </telerik:RadComboBox>
            <telerik:RadComboBox Name="Combo2" Text="Six"
                                 Margin="2" IsEditable="True"
                                 GotFocus="RadComboBox_GotFocus"
                                 LostFocus="RadComboBox_LostFocus">
                <telerik:RadComboBox.Items>
                    <telerik:RadComboBoxItem>Five</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Six</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Seven</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Eight</telerik:RadComboBoxItem>
                </telerik:RadComboBox.Items>
            </telerik:RadComboBox>
            <telerik:RadComboBox Name="Combo3" Text="Eleven"
                                 Margin="2" IsEditable="True"
                                 GotFocus="RadComboBox_GotFocus"
                                 LostFocus="RadComboBox_LostFocus">
                <telerik:RadComboBox.Items>
                    <telerik:RadComboBoxItem>Nine</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Ten</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Eleven</telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem>Twelve</telerik:RadComboBoxItem>
                </telerik:RadComboBox.Items>
            </telerik:RadComboBox>
        </StackPanel>
         
        <ListBox Grid.Row="1" Height="Auto" HorizontalAlignment="Stretch" Name="EventList" VerticalAlignment="Stretch" Width="Auto" />
    </Grid>
</Window>

Imports Telerik.Windows.Controls
 
Class MainWindow
 
    Private Sub RadComboBox_GotFocus(sender As System.Object, e As System.Windows.RoutedEventArgs)
        Dim cbo = CType(sender, RadComboBox)
        AddEventToList(cbo.Name, "GotFocus")
    End Sub
 
    Private Sub RadComboBox_LostFocus(sender As System.Object, e As System.Windows.RoutedEventArgs)
        Dim cbo = CType(sender, RadComboBox)
        AddEventToList(cbo.Name, "LostFocus")
    End Sub
 
    Private Sub AddEventToList(ByVal ctrlName As String, ByVal eventName As String)
        EventList.Items.Add(String.Format("{0} : {1} : {2}", EventList.Items.Count, ctrlName, eventName))
        EventList.ScrollIntoView(EventList.Items(EventList.Items.Count - 1))
    End Sub
 
End Class
Petya
Telerik team
 answered on 17 Dec 2013
0 answers
110 views
Hi.,

How to increase the size of the data pager button ie, Height And Width of button tin data pager.... And i want to show the data pager if number of items in the datagrid exceeds the limit.
 
Prakash
Top achievements
Rank 1
 asked on 17 Dec 2013
1 answer
393 views

I have a RadCartesianChart chart with a dynamic number of date/double series.  So, I'm using a ChartSeriesProvider and programmatically generating the CategoricalSeriesDescriptor instances for the series.  The x values for the data are of type DateTime, but the query results are actually grouped by the actual query already so that they are per year, month, etc.  So, if the query was grouped by month, I would have a single point to plot where the Datetime value is on the first of the month.  For most groupings, I can use the axis.LabelFormat property to provide an x axis label that is appropriate to the grouping.  Ex. for month, I'd provide something like "MMM, yyyy". However, there is no format specifier for week number (of the year) or quarter number for me to generate labels like "Week 12, 2013".  Is there a way for me to generate that kind of label? Maybe some other method besides using Axis.LabelFormat?


Thanks - Mitch

Peshito
Telerik team
 answered on 17 Dec 2013
12 answers
674 views

I think I've seen this problem before, but none had a documented resolution.  I have a list of objects from the database that I want to display in a property grid.  The tables and view have been built to provide all that I need for the property grid.  Here is the poco def:

public class Setting

{

public string ParameterName { get; set; }

public string ParameterValue { get; set; }

public string DataTypeName { get; set; }

public string ParameterTypeName { get; set; }

public string Description { get; set; }

}

I am trying it in code behind first, so my xaml is simple:

<telerik:RadPropertyGrid x:Name="_propertyGrid" AutoGeneratePropertyDefinitions="False" />

and the code-behind gets the list of Setting instances from the view model and wraps a PropertyDefinition around it.  It adds that PropertyDefinition to the property grid, then binds the property grid to the entire list:

List<Setting> settings = viewModel.Settings;

foreach (Setting setting in settings)

{

_propertyGrid.PropertyDefinitions.Add(new PropertyDefinition(/*new ItemPropertyInfo(setting.ParameterName, Type.GetType(setting.DataTypeName), setting.Description)*/)

{

 Binding = new Binding("ParameterValue") { Mode = BindingMode.TwoWay /*, Path = new PropertyPath("ParameterValue")*/ },

 

 Description = setting.Description,

 DisplayName = setting.ParameterName,

 GroupName = setting.ParameterTypeName,

});

}

_propertyGrid.Item = settings;

 

This works perfectly in some ways: every instance gets a row in the grid; and the DisplayName, Description, and GroupName all match the poco from whence it came.

However, I cannot get the ParameterValue to display.  I know it is set because I can set DisplayName or Description to setting.ParameterValue and the actual value shows in the name or description, but never in the bound data.

I look at my output window and get no binding errors.  However I get no errors even if I intentionally misspell the ParameterValue property's name, so I don't think that is conclusive.

 

The commented out code is stuff I've tried that either generates a runtime error (new ItemPropertyInfo), or has no effect (new PropertyPath). Both seem interesting though, so I left them in for exploration.

So my question is, can I bind the value of a property grid to a specific property of a poco in a list of them, as I can bind things like Description, DisplayName and GroupName?

Thank you very much for your time on this.

 
Edit: Somebody else commented in another post that it works if PropertySetMode is set to None, so I added this:

_propertyGrid.PropertySetMode = PropertySetOperation.None;

with no effect.  However, if I set to to Union or Intersection, the *GroupName* (not the value, but the category) shows up in the data.  How is that possible?

Dimitrina
Telerik team
 answered on 17 Dec 2013
5 answers
205 views
Hallo,
we have a new issue with RadTabControl - when we use style selector to use RadTabControl in MVVM concept, after we create more than one TabItems, after each active tab control item change, the View's constructor is everytime called.. - why RadTabControl is creating everytime new instance??? (-> Click on the button to add any tab items, create breakpoint into constructor UserControl1() and switch between the tabs...)
When we change RadTabControl into TabControl (remove all Telerik's stuff from MainWindow.xaml), the problem is solved... Thank you for your help...
Joel
Top achievements
Rank 1
Iron
 answered on 17 Dec 2013
3 answers
161 views
I have a DataTable bound to a RadGridView. I wish to display data errors for all rows on load.

When I create my DataTable I validate it, and if a cell has an error I call the following:

row.SetColumnError(1, "This cell has an error");

I can't get this to show up in the grid. How can I do this with a DataTable?

Thanks
Yoan
Telerik team
 answered on 16 Dec 2013
1 answer
157 views
We have a RadGridView that's data-bound to a DataView (via ItemsSource). The DataTable can have 1 million records or more and we're sometimes experiencing out-of-memory errors, and memory never seems to be freed. Typical column count for our grid is anywhere from 10 or so to maybe 20+. The more columns, the worse, of course.

The grid is on a WPF UserControl that's hosted inside a WinForms form, in case that makes a difference, and it's set up to auto-generate columns because it's designed to show practically any kind of data from the database that the user wants to query. We have column and row virtualization enabled, and we're using the lightweight templates (which we recently implemented because they're faster).

We really have 2 problems:

1. Memory usage versus the standard .NET data view control. Are there any known issues with excessive memory usage?

2. Memory never seems to be released, even after disposing the DataTable, setting references to null, removing the grid from its parent, disposing the disposables, and other things we've tried. This hurts because even if each of the user's query returns less than a million rows, it adds up over time and the grid doesn't seem to release memory for what was there before.

Thanks for any help.
Dimitrina
Telerik team
 answered on 16 Dec 2013
0 answers
69 views
Hi,

We are using schedule view to display list of appointments in the range of 1 year with 1500 schedules.

We need to show some of the text in the subject as bold. For that, we are using Run control inside appointment template.
This implementation makes scroll navigation very slow.
Pls let me know the solution or any alternate way for implementing this.


- Sugumar P
Sugumar
Top achievements
Rank 1
 asked on 16 Dec 2013
1 answer
60 views
Hello,
that's now 10 days that the Q3 2013 SP1 version is out, but the offline CHM file still refers to the Q3 2013 version.
It's really a recurrent problem and I had to regularly ask for offline documentation update (for Silverlight and WPF), so please keep it current when a new version is out.
Patrick
Yana
Telerik team
 answered on 16 Dec 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?