Telerik Forums
UI for WPF Forum
5 answers
408 views
Hi,

after trying around for quite a while, I decided to post a message here because I just don't get the meaning of the different properties of a GridViewComboBoxColumn.

I have a MainViewModel with an ICollectionView property called "ItemsView" which is used as ItemsSource for my RadGridView. The ICollectionView contains items of type PersonViewModel. PersonViewModel has several properties, one of them is called "AgeGroup" and has the type EnumViewModel<EAgeGroup>. The EnumViewModel<TEnum> class has an object property called "LocalizedValue". The MainViewModel also has a property "AvailableAgeGroups" of type ObservableCollection<EnumViewModel<EAgeGroup>> which contains EnumViewModels for all available enum values of type EAgeGroup.

Here is some sample code showing all these classes and properties:

public class MainViewModel 
    public ICollectionView ItemsView { /* ... */ } 
 
    public ObservableCollection<EnumViewModel<EAgeGroup>> AvailableAgeGroups { /* ... */ } 
 
public class PersonViewModel  
{  
    public EnumViewModel<EAgeGroup> AgeGroup  
    {  
        get { /* ... */ }  
        set { /* ... */ }  
    }  
}  
  
public class EnumViewModel<TEnum>  
{  
    public object LocalizedValue { /* ... */ }  

As you can imagine, the EnumViewModel class serves as a "string/localization provider" for enums.

Now, I want to create a ComboBoxColumn which uses the "AvailableAgeGroups" collection as the ItemsSource for the ComboBoxes. The relevant property in the PersonViewModel is, of course, "AgeGroup". So, this property should decide which of the age groups is selected. But, the displayed value should be taken from the "LocalizedValue" property of the value from the "AgeGroup" property. To sum it up, I want to display "PersonViewModel.AgeGroup.LocalizedValue", but the actual item should be "PersonViewModel.AgeGroup".

Now, from what I know from typical .NET controls, I created this column as follows:
<telerik:GridViewComboBoxColumn 
    UniqueName="AgeGroup" 
    ItemsSource="{Binding AvailableAgeGroups}" 
    DisplayMemberPath="LocalizedValue" 
    SelectedValueMemberPath="AgeGroup" 
    Header="Age Group" 
    IsFilterable="True"/> 

But nothing is displayed in the column, only empty cells. However, when I click the Filter button in the header, all possible values are displayed, so it somehow knows the values. Not everything is wrong, it seems. :)

Any advice on this one?
Thanks.
Pavel Pavlov
Telerik team
 answered on 22 Mar 2010
1 answer
274 views
How do I control the selection box item template for a combobox when the SelectionBoxItemTemplate is read only? This seems to contradict the help documentation: http://www.telerik.com/help/wpf/radcombobox-populating-with-data-selectionbox.html
Valeri Hristov
Telerik team
 answered on 22 Mar 2010
1 answer
219 views
There appears tp be a bug in the RadTabControl when the TabStripPlacement is on the left. The TabOrientation is reversed. The following XAML displays tabs vertically. The tabs also are appear to be ordered backwards, from bottom to top of the tab strip rather than top to bottom.

        <telerikNav:RadTabControl TabOrientation="Horizontal" TabStripPlacement="Left">  
            <telerikNav:RadTabItem Header="Tab1"  /> 
            <telerikNav:RadTabItem Header="Tab2" /> 
        </telerikNav:RadTabControl> 
 

I will also submit a support ticket.

Thanks.
Bobi
Telerik team
 answered on 22 Mar 2010
6 answers
162 views
hello,

i'm having a problem collapsing a details grid from within the details grid. the master grid has a GridViewToggleRowDetailsColumn to display details and close them. the problem is, there is a button in the details grid (of type RowDetailsTemplate) which does some operation and afterwards should close the details automatically. i'm using event LoadingRowDetails so using a HierarchyChildTemplate is a problem.
how can i collapse the details grid with the button inside?




since the documention is very poor on wpf controls i'm having difficulties figuring out which property and which method does what. examples (how to's) are really appreciated.


thanks,
Milan
Telerik team
 answered on 22 Mar 2010
0 answers
70 views

Hi.. again...
I have GridViewComboColumn in a GridView. How can I programatically set focus the combox in the current row and open it?
I have button on a form that addes a new row... so I want to set focus to the combobox so the user can begin entereing.... thanks again

<
telerikPresentation:GridViewComboBoxColumn DisplayMemberPath="comm_name" SelectedValueMemberPath="comm_name" DataMemberBinding="{Binding comm_name}" Header="Commodity" Width="175" />

 

Jon
Top achievements
Rank 1
 asked on 22 Mar 2010
2 answers
137 views
Hi

I am having serious problems performing something that seems quite simple.
I want a RadScheduler filling the form, and a RadExpander to the right of it. When I expand the Expander, the Scheduler should decrease its size accordingly.
When I try this with the Expander on top, it works as intended, but when I put the expander to the right, the scheduler just will not stretch over the form. It stretches well vertically, but not horizontally.
I believe I have altered the directions etc on the components as I should, but without any luck.

This is my very small form:
<Page x:Class="RadControlsWpfBrowserApp2.Page1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Page1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">  
    <Grid> 
        <StackPanel Orientation="Horizontal">  
            <telerik:RadScheduler Name="radScheduler1" HorizontalAlignment="Stretch" /> 
            <telerik:RadExpander ExpandDirection="Left" HorizontalAlignment="Right">  
                <telerik:RadExpander.Header> 
                    <Grid HorizontalAlignment="Stretch">  
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto" /> 
                            <ColumnDefinition Width="*" /> 
                        </Grid.ColumnDefinitions> 
                        <TextBlock Text="Header" /> 
                        <Rectangle Grid.Column="1" Margin="5,0,0,0" VerticalAlignment="Center" Height="2" Fill="Gray" /> 
                    </Grid> 
                </telerik:RadExpander.Header> 
                <StackPanel Orientation="Vertical" > 
                    <Ellipse Width="33" Height="33" Margin="5" Fill="Yellow" /> 
                    <Ellipse Width="33" Height="33" Margin="5" Fill="Blue" /> 
                    <Ellipse Width="33" Height="33" Margin="5" Fill="Red" /> 
                </StackPanel> 
            </telerik:RadExpander> 
        </StackPanel> 
    </Grid> 
</Page> 

See attached screen shot.
Rappen
Top achievements
Rank 1
 answered on 22 Mar 2010
1 answer
161 views
Hi,

First of all let me tell you that We are using Q1 2009 Telerik controls.

I have a Time Picker in my window,Its showing proper 12 hour format when i select from time from Time Picker, Now When i say like radTimePicker.SelectedTime=new TimeSpan(23,05,00) it showing 24 hour format..

Another thing, its working fine with "Page" but not with  window and usercontrol.

Thanks,
Ravi Lakhani
Kaloyan
Telerik team
 answered on 22 Mar 2010
1 answer
184 views
Hi,

I have added a RadGridView and populated some data. Now i am giving an option to the user to select the column, i.e. when the user selects a column, we would make that record as selectedItem and scroll to that record.
I have used the following code :

this

 

.radGridView1.SelectedItem = radGridView1.Items[RecordNumber-1];

 

 

 

this.radGridView1.ScrollIntoView(this.radGridView1.SelectedItem);

 

 


The correct item is selected, but the scroller is still pointing to the first one.
I am attaching the screen shot for reference.  

Regards,
Prithvi
Rossen Hristov
Telerik team
 answered on 22 Mar 2010
1 answer
52 views
The RadTreeViewItem.RootItem property used to return an item's highest ancestor node (as of version 2009.1103), but in the current version (2010.0309) it always returns a reference to itself. Does anyone else see this behavior?

Here's a very simple example:
    <StackPanel> 
        <telerikNavigation:RadTreeView x:Name="tree"/> 
        <TextBlock x:Name="msg"/> 
    </StackPanel> 
 

And the code behind:
        private void Window_Loaded(object sender, RoutedEventArgs e) 
        { 
            RadTreeViewItem item1 = new RadTreeViewItem() { Header = "item1" }; 
            RadTreeViewItem item2 = new RadTreeViewItem() { Header = "item2" }; 
            RadTreeViewItem item3 = new RadTreeViewItem() { Header = "item3" }; 
 
            tree.Items.Add(item1); 
            item1.Items.Add(item2); 
            item2.Items.Add(item3); 
 
            // item3.RootItem returns item1 in 2009.1103 version (CORRECT) 
            // item3.RootItem returns item3 in 2010.0309 version (WRONG) 
            msg.Text = "item3.RootItem is " + item3.RootItem.Header.ToString(); 
 
            tree.ExpandAll(); // <-- This also doesn't seem to be working 
            item1.ExpandAll(); // <-- Neither does this 
        } 
 

Tihomir Petkov
Telerik team
 answered on 22 Mar 2010
5 answers
196 views
I am using the sample TreeView In ComboBox from this blog (http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx) and it looks really good. Now I would like to modify it a little by only allowing selection of the lowest level item from the tree view. How can I disable selection of higher level items but still allow the items to be collapsed?
Bobi
Telerik team
 answered on 22 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?