Telerik Forums
UI for WPF Forum
1 answer
298 views
Hey guys,
I am trying to use a RadComboBox to bind to a Specialized.StringCollection in my User.Settings. I am able to load the ComboBox from the collection, but the twoway binding does not seem to work. Is this possible with just stright XAML binding or do I need to create a whole class to accomodate this? I have the twoway binding working for my Window properties so I do know that I appear to have my ResourceDictionary configured correctly. Below is what I have so far.

XAML
<telerikInput:RadComboBox x:Name="comboTheme" ItemsSource="{Binding Source={StaticResource settings}, Path=Default.Theme}" 
                        SelectedItem="{Binding Default.Theme, Mode=TwoWay}"/> 

App.Config
<userSettings>       
    <EliteExtender.Shell.Properties.Settings> 
      <setting name="MainWidth" serializeAs="String">  
        <value>800</value> 
      </setting> 
      <setting name="MainHeight" serializeAs="String">  
        <value>625</value> 
      </setting> 
      <setting name="MainState" serializeAs="String">  
        <value /> 
      </setting> 
      <setting name="Theme" serializeAs="Xml">  
        <value> 
          <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">  
            <string>Office_Blue</string> 
            <string>Office_Black</string> 
            <string>Office_Silver</string> 
            <string>Summer</string> 
            <string>Vista</string> 
            <string>Windows7</string> 
          </ArrayOfString> 
        </value> 
      </setting> 
    </EliteExtender.Shell.Properties.Settings> 
  </userSettings> 

ResourceDictionary (registered in App.Xaml)
<ResourceDictionary  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:settings="clr-namespace:EliteExtender.Shell.Properties">  
    <ResourceDictionary.MergedDictionaries> 
        <ResourceDictionary> 
            <settings:Settings x:Key="settings" /> 
        </ResourceDictionary> 
    </ResourceDictionary.MergedDictionaries> 
</ResourceDictionary> 

Valeri Hristov
Telerik team
 answered on 23 Mar 2010
1 answer
164 views
i need to extend a RadComboBox which will load bind same data to itself. i dont want to rewrite this data binding code in different forms. so is it possible to extend combo box to bind some data and use it in other places?
Valeri Hristov
Telerik team
 answered on 23 Mar 2010
1 answer
89 views
Is it possible to set a margin for the last and first ticks that appears on the slider?
In the example giving at http://blogs.telerik.com/KirilStanoev/Posts/08-07-24/Using_ValueConverter_to_edit_Slider_s_TickTemplate.aspx?ReturnURL=%2fKirilStanoev%2fPosts.aspx
January and December do not have left and right margins, respectively. I do not want the first and last words to go beyond their ticks. What I want is the letter "J" of January to go right above its tick and so for the letter "R" of December.

I would also like to give the selected tick more visibility when selected. So I was wondering if it is possible to highlight or to maximize the tick when selected.
Kiril Stanoev
Telerik team
 answered on 23 Mar 2010
4 answers
153 views
Hi all,

I'm writing an app the MVVM way and have set up a ViewModel to bind to a view, which is a user control that contains a RadGridView. The data binds correctly and am able to see this however there are 3 group descriptors I wish to add and when I add this programmatically, the grid duplicates my rows, so now, my grid contains a duplicate or of each row. One type of the rows containing the full grouping while the other only with 2 of my 3 groupings. If I remove the groupings manually from the grid and re-add these they work perfectly (without duplicate rows). I am adding the group descriptions on the RadGridView_Load event. In the same event I also programmatically create columns.

Any help would be great.

Cheers,

Tim.
TSRG - IT
Top achievements
Rank 1
 answered on 23 Mar 2010
5 answers
401 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
269 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
209 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
156 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
64 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
131 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?