Telerik Forums
UI for WPF Forum
5 answers
146 views
Hi, all....

There is a RadRichTextBox and want to select text from the Document object based on two positions, 2 parameters: initial position of the character and end character position. That is, the two parameters are only numbers.

Is this possible?

Thanks alls
Romell
Top achievements
Rank 1
 answered on 29 Aug 2012
4 answers
94 views
I've got a RRTB with the RRTBRUI in my application, where table cell alignment is all botched.

(The ribbon was created by dropping the RRTBRUI on the design surface.  I then removed editing options I don't want the user to have.)

To illustrate, please view the attached image.  You can see that not only is 1) the context menu alignment button 2) not being respected within the design surface, but also 3) within the ribbon you can click an entire row of alignment buttons.

To try and debug this, I have
  • copied the exact markup into a minimal solution
  • compared mouse events
  • examined application resources
  • cranked wpf trace levels to ALL
  • Listened to RTB command events

Copied the markup exactly, and was unable to repro in a minimal solution.  Damn.

I watched mouse events in both a working example and in my non-working example, and did not see events being handled any differently.  Damn.

I checked to see if there were any Styles with default keys that were interfering with the RadToggleButton in any way, and had none.  Damn.

Cranked up all trace levels and repro'd.  Nothing.  Well, actually LOTS of nothing.  But 99% was binding failures before the commands binding was updated ("DataItem=null"), and the rest were about "Path=Menu.IconColumnWidth".  Damn.

Listened to CommandError, CommandExecuting, and CommandExecuted.  Verified the correct command and the correct command parameters are being passed every time, for every button.  And CommandError never fires when using these buttons.  Damn.

So that leaves me stumped.  I know the RRTBRUI is doing stuff in the background, probably walking its children, managing their state.  But I don't know how this is happening, so I can't figure out what is going wrong.

How does the RRTBRUI handle cell alignment?  What are the things that could go wrong?  Any ideas?
Will
Top achievements
Rank 1
 answered on 29 Aug 2012
4 answers
111 views
If you mouse click a number or button and then use the keyboard to finish the calc and press enter the enter key enters the value of the selected button.

steps:

Mouse click 8
Keyboard press +
Keyboard press 5
Keyboard press Enter
Entry = 58 (Expecting 13(8+5)) (history would be 8+58 without a result because the enter key added was like pressing 8 not performing the calculation)


Guru
Top achievements
Rank 2
 answered on 29 Aug 2012
1 answer
153 views
Hi folks,

when I open the contexMenu on a RadGrid on primary monitor, everything is fine.
When I dragging the Application on the second monitor, and open the context, the context will be shown in the top right of primary monitor?

Any ideas??

Thx for help

David

Rosen Vladimirov
Telerik team
 answered on 29 Aug 2012
0 answers
206 views
Hello, I would like to ask you a question, and I hope someone can help me, I have a WPF browser application with a RadGridView to show some data, the data source for it is an Observable collection, so when the collection changes, you can see the changes directly in the grid, but the problem is that when an item changes, it goes to the last row, and what I want to do, is after changing the element in the observable collection, order the radGridView by one of it's columns.

This is my RadGridView, and I want it to be ordered by the "Name" column
<telerik:RadGridView Margin="178,118,0,0" Name="gridAnalog" AutoGenerateColumns="False" ColumnWidth="Auto" telerik:StyleManager.Theme="Vista" CanUserDeleteRows="False" CanUserInsertRows="False" ActionOnLostFocus="None"   Height="Auto" VerticalAlignment="Top" Visibility="Hidden" IsReadOnly="True" HorizontalAlignment="Left" Width="Auto">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Key}" Width="auto"/>
<telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Value.Description}"  Width="auto" />
<telerik:GridViewDataColumn Header="State" DataMemberBinding="{Binding Value.State}"  Width="auto"/>
<telerik:GridViewDataColumn Header="Current value" DataMemberBinding="{Binding Value.Curval}"  Width="auto" />
 </telerik:RadGridView.Columns>
</telerik:RadGridView>

Here I set the ItemsSource property to an ObservableCollection:

gridAnalog.ItemsSource = SummaryDictionary.analogData;

And this is the function that changes the values of the observableCollection, and at the end of this function is where I want to order my Grid:

public static void updateChanges(string key, string value)
{
    //Here I change an entry from the ObservableCollection
    subscriberData[key] = value;
   //And now I want to order
}

I have been searching through your webPage and I found this:
gridAnalog.SortDescriptors.Add(new ColumnSortDescriptor()
 {
        Column = gridAnalog.Columns["Name"],
        SortDirection = ListSortDirection.Ascending
});

so I added this code to the function that modify the content of the observable collection:
public static void updateChanges(string key, string value)
{
    //Here I change an entry from the ObservableCollection
    subscriberData[key] = value;
   //And now I want to order
   gridAnalog.SortDescriptors.Add(new ColumnSortDescriptor()
    {
           Column = gridAnalog.Columns["Name"],
            SortDirection = ListSortDirection.Ascending
    });
}
But it doesn't work,  I suppose I am doing something wrong, because when a value changes, the row goes to the las position on the grid.
Hope someone could help me, because I found a kind of article in your page named: Sorting DataGrid programatically, but the page is not working.
Thanks a lot!
Rocio
Top achievements
Rank 1
 asked on 29 Aug 2012
3 answers
306 views
Hello. I was created custom theme for RadColorPicker, but when I apply this custom theme i receive exception (see attached picture)
Note I use latest version (Q1 2010) of WPF controls
Here my code
<ResourceDictionary 
        xmlns:customTheme="clr-namespace:BlackTheme_WPF" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls" 
        xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
        xmlns:animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls" 
        xmlns:telerikChromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
<customTheme:BlackTheme x:Key="Theme" /> 
    <LinearGradientBrush x:Key="ControlOuterBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0"
        <GradientStop Color="#FF282828"/> 
        <GradientStop Color="#FF5F5F5F" Offset="1"/> 
    </LinearGradientBrush> 
    <LinearGradientBrush x:Key="ControlBackground_Pressed" EndPoint="0.5,1" StartPoint="0.5,0"
        <GradientStop Color="#FFFFDCAB" Offset="0"/> 
        <GradientStop Color="#FFFFD18F" Offset="0.5"/> 
        <GradientStop Color="#FFFE9227" Offset="0.5"/> 
        <GradientStop Color="#FFFFBA74" Offset="0"/> 
    </LinearGradientBrush> 
    <LinearGradientBrush x:Key="ControlInnerBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0"
        <GradientStop Color="#FFB69A78"/> 
        <GradientStop Color="#FFFFE17A" Offset="0.126"/> 
    </LinearGradientBrush> 
    <SolidColorBrush x:Key="ControlElement_Normal" Color="#FF000000" /> 
 
 
    <SolidColorBrush x:Key="ColorPicker_TitleBackground" Color="#FFDEDEDE" /> 
    <SolidColorBrush x:Key="ColorPicker_TitleBorder" Color="#FF848484" /> 
    <SolidColorBrush x:Key="ColorPicker_Background" Color="#FFFFFFFF" /> 
    <SolidColorBrush x:Key="ColorPicker_OuterBorder" Color="#FF848484" /> 
    <SolidColorBrush x:Key="ColorPicker_InnerBorder" Color="#FFF5F5F5" /> 
    <SolidColorBrush x:Key="ColorPicker_Foreground" Color="#FF000000" /> 
    <LinearGradientBrush x:Key="ColorPicker_ButtonBackground_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0"
        <GradientStop Color="#FFFFFBA3" Offset="1" /> 
        <GradientStop Color="#FFFFFBDA" Offset="0" /> 
        <GradientStop Color="#FFFFD25A" Offset="0.43" /> 
        <GradientStop Color="#FFFEEBAE" Offset="0.42" /> 
    </LinearGradientBrush> 
    <SolidColorBrush x:Key="ColorPicker_ButtonInnerBorder_MouseOver" Color="#FFFFFFFF" /> 
    <SolidColorBrush x:Key="ColorPicker_ButtonBorder_MouseOver" Color="#FFFFC92B" /> 
    <CornerRadius x:Key="ColorPicker_ButtonOuterBorder_LeftCornerRadius">1,0,0,1</CornerRadius> 
    <CornerRadius x:Key="ColorPicker_ButtonOuterBorder_RightCornerRadius">0,1,1,0</CornerRadius> 
 
    <SolidColorBrush x:Key="ColorPaletteViewItem_Border" Color="#FFC9C9CB" /> 
    <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_MouseOver" Color="#FFFFC92B" /> 
    <SolidColorBrush x:Key="ColorPaletteViewItem_InnerBorder_MouseOver" Color="#FFFFFFFF" /> 
    <SolidColorBrush x:Key="ColorPaletteViewItem_OuterBorder_Selected" Color="#FF5D5D5D" /> 
    <LinearGradientBrush x:Key="ColorPaletteViewItem_InnerBorder_Selected" EndPoint="0.5,1" StartPoint="0.5,0"
        <GradientStop Color="#FFB69A78" /> 
        <GradientStop Color="#FFFFE17A" Offset="0.126" /> 
    </LinearGradientBrush> 
 
    <CornerRadius x:Key="ColorPicker_HeaderButtonOuterBorder_CornerRadius">1</CornerRadius> 
    <CornerRadius x:Key="ColorPicker_HeaderButtonInnerBorder_CornerRadius">0</CornerRadius> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonBackground" Color="#FFDEDEDE" /> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonBorder" Color="#FF848484" /> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonOuterBorder_MouseOver" Color="#FFFFC92B" /> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonInnerBorder_MouseOver" Color="#FFFFFFFF" /> 
    <LinearGradientBrush x:Key="ColorPicker_HeaderButtonInnerBackground_MouseOver" EndPoint="0.5,1" 
            StartPoint="0.5,0"
        <GradientStop Color="#FFFFFBA3" Offset="1" /> 
        <GradientStop Color="#FFFFFBDA" Offset="0" /> 
        <GradientStop Color="#FFFFD25A" Offset="0.43" /> 
        <GradientStop Color="#FFFEEBAE" Offset="0.42" /> 
    </LinearGradientBrush> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonOuterColorStroke" Color="#FFFFC92B" /> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonColorFill" Color="#FF000000" /> 
    <SolidColorBrush x:Key="ColorPicker_HeaderButtonInnerColorStroke" Color="#FFBFBFBF" /> 
 
    <Style TargetType="telerikInput:RadColorPaletteViewItem" x:Key="DefaultStyle"
        <Setter Property="Color" Value="Black" /> 
    </Style> 
 
    <Style TargetType="Button" x:Key="RadColorPicker_HeaderButtonStyle"
        <Setter Property="Foreground" Value="{StaticResource ColorPicker_Foreground}" /> 
        <Setter Property="FontWeight" Value="Normal" /> 
        <Setter Property="BorderBrush" 
                Value="{StaticResource ColorPicker_HeaderButtonOuterColorStroke}" /> 
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="Button"
                    <Grid> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto" MinWidth="25" /> 
                            <ColumnDefinition Width="*" /> 
                        </Grid.ColumnDefinitions> 
 
                        <Border MinWidth="25" HorizontalAlignment="Left" 
                                Background="{StaticResource ColorPicker_HeaderButtonBackground}" 
                                BorderBrush="{StaticResource ColorPicker_HeaderButtonBorder}" 
                                BorderThickness="0 0 1 0" /> 
 
                        <Border BorderThickness="1" Grid.ColumnSpan="2" Opacity="0" 
                                CornerRadius="{StaticResource ColorPicker_HeaderButtonOuterBorder_CornerRadius}" 
                                x:Name="border_mouseover" 
                                BorderBrush="{StaticResource ColorPicker_HeaderButtonOuterBorder_MouseOver}"
                            <Border BorderThickness="1" 
                                    CornerRadius="{StaticResource ColorPicker_HeaderButtonInnerBorder_CornerRadius}" 
                                    BorderBrush="{StaticResource ColorPicker_HeaderButtonInnerBorder_MouseOver}" 
                                    Background="{StaticResource ColorPicker_HeaderButtonInnerBackground_MouseOver}" /> 
                        </Border> 
 
                        <Border Margin="2 2 3 2" BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="1" CornerRadius="2" x:Name="rectangleborder"
                            <Rectangle 
                                    Stroke="{StaticResource ColorPicker_HeaderButtonInnerColorStroke}" 
                                    Fill="{StaticResource ColorPicker_HeaderButtonColorFill}" 
                                    MinWidth="14" MinHeight="14" VerticalAlignment="Center" 
                                    Margin="1" /> 
                        </Border> 
 
                        <ContentPresenter Grid.Column="1" x:Name="contentPresenter" Margin="7 0 0 0" 
                                Content="{TemplateBinding Content}" 
                                ContentTemplate="{TemplateBinding ContentTemplate}" 
                                VerticalAlignment="Center" HorizontalAlignment="Left" /> 
 
                    </Grid> 
                    <ControlTemplate.Triggers> 
                        <Trigger Property="IsMouseOver" Value="True"
                            <Setter Property="Opacity" TargetName="border_mouseover" Value="1" /> 
                        </Trigger> 
                        <Trigger Property="IsFocused" Value="True" /> 
                        <Trigger Property="IsPressed" Value="True"
                            <Setter Property="Opacity" TargetName="border_mouseover" Value="1" /> 
                        </Trigger> 
                    </ControlTemplate.Triggers> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
    </Style> 
 
    <Style x:Key="ColorButtonDefaultStyle" TargetType="Button"
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="Button"
                    <Grid Height="25" Width="23"
                        <telerikChromes:ButtonChrome x:Name="Chrome" RenderNormal="False" 
                                telerik:StyleManager.Theme="{StaticResource Theme}" 
                                RenderPressed="{TemplateBinding IsPressed}" 
                                RenderHighlighted="{TemplateBinding IsMouseOver}" 
                                CornerRadius="{StaticResource ColorPicker_ButtonOuterBorder_LeftCornerRadius}" /> 
                        <Grid Height="25" Width="23"
                            <Grid.RowDefinitions> 
                                <RowDefinition Height="0.664*" /> 
                                <RowDefinition Height="0.336*" /> 
                            </Grid.RowDefinitions> 
                            <Path Fill="#FF364F87" Stretch="Fill" VerticalAlignment="Top" 
                                    HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" 
                                    Data="M3.8280001,4.8113337 C3.756,4.8113337 3.72,4.8593335 3.684,4.9673333 C3.6765001,4.9868336 3.6538124,5.0481458 3.6196642,5.141099 C3.5855157,5.2340522 3.5399063,5.3586459 3.4865625,5.5047083 C3.3798749,5.7968335 3.24225,6.1748333 3.1035001,6.5573335 C2.9647501,6.9398336 2.8248751,7.3268337 2.7136877,7.6369586 C2.6580937,7.7920213 2.6096718,7.927865 2.5721486,8.034318 C2.5346251,8.1407709 2.5080001,8.2178335 2.4960001,8.2553339 L4.8600001,8.2553339 C4.8464999,8.2103338 4.8236251,8.1315842 4.7937655,8.0276384 C4.7639065,7.9236932 4.7270627,7.7945528 4.6856251,7.6487713 C4.6027498,7.3572087 4.5015001,6.999084 4.401,6.6428337 C4.3004999,6.2865839 4.2007499,5.9322085 4.1208749,5.6481462 C4.0809374,5.506115 4.045969,5.3816619 4.0183597,5.2833414 C3.9907501,5.1850209 3.9705,5.1128335 3.96,5.0753336 C3.9359999,4.9853334 3.918,4.9193335 3.8985,4.8758335 C3.8789999,4.8323336 3.858,4.8113337 3.8280001,4.8113337 z M4.8959999,3.1193333 C4.9679999,3.1193333 4.9920001,3.1913338 5.0279999,3.3233337 C5.0565,3.4178338 5.0960622,3.5425212 5.1439219,3.6898727 C5.191781,3.8372245 5.2479377,4.0072398 5.3096251,4.1923962 C5.4330001,4.5627089 5.5784998,4.9935837 5.724,5.4248338 C5.8695002,5.8560839 6.0149999,6.2877088 6.1383748,6.6595211 C6.2000623,6.8454275 6.2562189,7.0163803 6.3040781,7.1648569 C6.3519378,7.3133335 6.3915,7.4393334 6.4200001,7.5353336 C6.4890003,7.7693338 6.5895,8.0843334 6.7040625,8.4302711 C6.818625,8.7762089 6.9472499,9.1530838 7.0724998,9.5108337 C7.1977501,9.8685837 7.3196249,10.207209 7.4206877,10.476646 C7.4712186,10.611364 7.5165467,10.728786 7.554492,10.822654 C7.5924377,10.916521 7.6230001,10.986834 7.6440001,11.027333 C7.7460003,11.225333 7.875,11.360333 8.0010004,11.445833 C8.1269999,11.531333 8.25,11.567333 8.3400002,11.567333 L8.7480001,11.567333 C8.8199997,11.567333 8.8319998,11.615334 8.8319998,11.675334 L8.8319998,11.903334 C8.8319998,11.975333 8.8199997,12.059334 8.724,12.059334 C8.6669998,12.059334 8.6085005,12.057084 8.5288124,12.053709 C8.4491253,12.050334 8.3482504,12.045834 8.2065001,12.041333 C8.0647507,12.036834 7.8821254,12.032333 7.638938,12.028958 C7.39575,12.025583 7.092,12.023334 6.7080002,12.023334 C6.4590001,12.023334 6.2460003,12.025583 6.0628123,12.028958 C5.8796248,12.032333 5.7262497,12.036834 5.5964999,12.041333 C5.4667501,12.045834 5.3606248,12.050334 5.2719374,12.053709 C5.18325,12.057084 5.112,12.059334 5.052,12.059334 C4.9920001,12.059334 4.9590001,12.041334 4.941,12.012834 C4.9230003,11.984333 4.9200001,11.945333 4.9200001,11.903334 L4.9200001,11.675334 C4.9200001,11.615334 4.9320002,11.567333 4.9920001,11.567333 L5.3280001,11.567333 C5.4899998,11.567333 5.598,11.537333 5.6565003,11.468333 C5.7150002,11.399334 5.724,11.291334 5.6880002,11.135334 C5.6610003,11.027334 5.6115003,10.850334 5.5501876,10.638834 C5.4888749,10.427334 5.41575,10.181334 5.3414998,9.9353342 C5.2672501,9.6893339 5.191875,9.4433336 5.1260624,9.2318335 C5.0602498,9.0203333 5.0039997,8.8433332 4.9679999,8.7353334 L2.3399999,8.7353334 C2.316,8.7983332 2.26125,8.9483337 2.1926248,9.1438961 C2.1240001,9.3394585 2.0415001,9.5805836 1.962,9.8258333 C1.8824999,10.071083 1.806,10.320458 1.749375,10.53252 C1.69275,10.744583 1.656,10.919333 1.656,11.015333 C1.656,11.147333 1.6830001,11.285334 1.755,11.390333 C1.827,11.495333 1.944,11.567333 2.1240001,11.567333 L2.5439999,11.567333 C2.6040001,11.567333 2.6370001,11.579333 2.655,11.597333 C2.6730001,11.615334 2.6760001,11.639334 2.6760001,11.663334 L2.6760001,11.927334 C2.6760001,12.023334 2.664,12.059334 2.5680001,12.059334 C2.529,12.059334 2.4690001,12.057084 2.3855624,12.053709 C2.302125,12.050334 2.19525,12.045834 2.0625,12.041333 C1.92975,12.036834 1.771125,12.032333 1.5841875,12.028958 C1.3972499,12.025583 1.1819999,12.023334 0.93599993,12.023334 C0.71700001,12.023334 0.53625,12.025583 0.3856875,12.028958 C0.23512499,12.032333 0.11475,12.036834 0.016499937,12.041333 C-0.18000001,12.050334 -0.28799999,12.059334 -0.37199995,12.059334 C-0.44400001,12.059334 -0.456,11.987333 -0.456,11.903334 L-0.456,11.675334 C-0.456,11.603333 -0.44400001,11.567333 -0.37199995,11.567333 L-0.059999958,11.567333 C0.083999999,11.567333 0.228,11.525333 0.36600009,11.438334 C0.50400001,11.351334 0.63599998,11.219334 0.75599998,11.039333 C0.77700001,11.007833 0.80868751,10.947646 0.84883589,10.864372 C0.88898438,10.781099 0.93759376,10.67474 0.99243748,10.550896 C1.102125,10.303208 1.23675,9.9855833 1.3785,9.6428337 C1.52025,9.3000832 1.669125,8.9322081 1.8073125,8.5840206 C1.9455,8.2358332 2.073,7.9073334 2.1719999,7.6433334 C2.184,7.6133337 2.2096875,7.546771 2.2456639,7.4526224 C2.2816405,7.3584743 2.3279061,7.2367396 2.3810623,7.096396 C2.487375,6.8157086 2.6212499,6.4605837 2.7554998,6.1028337 C2.88975,5.7450838 3.024375,5.3847084 3.1321876,5.0935211 C3.1860938,4.9479275 3.2332969,4.8196306 3.2703984,4.717607 C3.3075001,4.6155834 3.3345001,4.5398335 3.348,4.4993334 C3.3660002,4.4393334 3.3900001,4.3703337 3.3990002,4.2998333 C3.408,4.2293334 3.402,4.1573334 3.3599999,4.0913334 C3.3239999,4.0433335 3.276,3.9833336 3.276,3.9353333 C3.276,3.899334 3.3,3.8513336 3.3959999,3.8273335 C3.4919999,3.8063335 3.6127501,3.7710836 3.7426875,3.7268338 C3.8726249,3.6825836 4.0117497,3.6293337 4.1444998,3.5723338 C4.2772498,3.5153337 4.403625,3.4545836 4.5080624,3.3953338 C4.6124997,3.3360839 4.6949997,3.2783339 4.7399998,3.227334 C4.8000002,3.1673336 4.836,3.1193333 4.8959999,3.1193333 z" 
                                    Width="9.91" Margin="-2 3 0 0" Height="9.537"
                                <Path.RenderTransform> 
                                    <ScaleTransform ScaleX="1" ScaleY="1" /> 
                                </Path.RenderTransform> 
                            </Path> 
                            <Rectangle Width="16" Margin="-2 0 0 0" 
                                    Fill="{TemplateBinding Background}" Height="4.232" Grid.Row="1" 
                                    VerticalAlignment="Top" /> 
                        </Grid> 
 
                    </Grid> 
                    <ControlTemplate.Triggers> 
                        <Trigger Property="IsMouseOver" Value="True" /> 
                        <Trigger Property="IsFocused" Value="True" /> 
                        <Trigger Property="IsPressed" Value="True" /> 
                    </ControlTemplate.Triggers> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
        <Setter Property="Background" Value="Black" /> 
    </Style> 
 
    <Style x:Key="ToggleButtonIconStyle" TargetType="ToggleButton"
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="ToggleButton"
                    <Grid Height="25" Width="11"
                        <telerikChromes:ButtonChrome RenderNormal="False" 
                                telerik:StyleManager.Theme="{StaticResource Theme}" 
                                RenderPressed="{TemplateBinding IsPressed}" 
                                RenderHighlighted="{TemplateBinding IsMouseOver}" 
                                CornerRadius="{StaticResource ColorPicker_ButtonOuterBorder_RightCornerRadius}" /> 
 
                        <Border x:Name="BackgroundChecked" BorderThickness="1" Height="25" 
                                Width="11" Visibility="Collapsed" 
                                CornerRadius="{StaticResource ColorPicker_ButtonOuterBorder_RightCornerRadius}" 
                                BorderBrush="{StaticResource ControlOuterBorder_Pressed}" 
                                Background="{StaticResource ControlBackground_Pressed}"
                            <Border BorderThickness="1" 
                                    BorderBrush="{StaticResource ControlInnerBorder_Pressed}" /> 
                        </Border> 
 
                        <Path x:Name="Arrow" Fill="{StaticResource ControlElement_Normal}" 
                                Stretch="Fill" Stroke="{x:Null}" 
                                Data="M0,0 L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0 z" 
                                Width="5" Height="3" /> 
 
                    </Grid> 
                    <ControlTemplate.Triggers> 
                        <Trigger Property="IsMouseOver" Value="True" /> 
                        <Trigger Property="IsFocused" Value="True" /> 
                        <Trigger Property="IsPressed" Value="True" /> 
                        <Trigger Property="IsChecked" Value="True"
                            <Setter Property="Visibility" TargetName="BackgroundChecked" 
                                    Value="Visible" /> 
                        </Trigger> 
                    </ControlTemplate.Triggers> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
    </Style> 
 
 
    <Style TargetType="telerikInput:RadColorPaletteViewItem" x:Key="{telerik:ThemeResourceKey ThemeType=customTheme:BlackTheme, ElementType=telerikInput:RadColorPaletteViewItem}"
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="telerikInput:RadColorPaletteViewItem"
                    <Grid x:Name="RootElement" Margin="0"  
                        SnapsToDevicePixels="True"
                        <Rectangle x:Name="color" MinHeight="11" MinWidth="11" Stretch="Fill" 
                                Margin="2 0" ToolTipService.ToolTip="{Binding }" 
                                Fill="{TemplateBinding Content}" /> 
                        <Border MinHeight="13" MinWidth="13" 
                                BorderBrush="{StaticResource ColorPaletteViewItem_Border}" 
                                Margin="2 0" x:Name="borderContent" VerticalAlignment="Stretch" 
                                BorderThickness="1"
                            <Border BorderThickness="1" x:Name="InnerborderContent" /> 
                        </Border> 
 
                        <Border MinHeight="13" MinWidth="13" 
                                BorderBrush="{StaticResource ColorPaletteViewItem_OuterBorder_MouseOver}" 
                                Margin="2 0" x:Name="border" VerticalAlignment="Stretch" 
                                BorderThickness="1" Visibility="Collapsed"
                            <Border BorderThickness="1" x:Name="Innerborder" 
                                    BorderBrush="{StaticResource ColorPaletteViewItem_InnerBorder_MouseOver}" /> 
                        </Border> 
                    </Grid> 
                    <ControlTemplate.Triggers> 
                         
                        <MultiTrigger> 
                            <MultiTrigger.Conditions> 
                                <Condition Property="IsSelected" Value="false" /> 
                                <Condition Property="IsMouseOver" Value="true" /> 
                            </MultiTrigger.Conditions> 
                            <Setter Property="Visibility" TargetName="border" Value="Visible" /> 
                            <Setter Property="BorderBrush" TargetName="border" 
                                    Value="{StaticResource ColorPaletteViewItem_OuterBorder_MouseOver}" /> 
                            <Setter Property="BorderBrush" TargetName="Innerborder" 
                                    Value="{StaticResource ColorPaletteViewItem_InnerBorder_MouseOver}" /> 
                        </MultiTrigger> 
                        <Trigger Property="IsSelected" Value="True"
                            <Trigger.EnterActions> 
                                <BeginStoryboard> 
                                    <Storyboard> 
                                        <ObjectAnimationUsingKeyFrames 
                                                Storyboard.TargetProperty="Visibility" 
                                                Storyboard.TargetName="border"
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                <DiscreteObjectKeyFrame.Value> 
                                                    <Visibility>Visible</Visibility> 
                                                </DiscreteObjectKeyFrame.Value> 
                                            </DiscreteObjectKeyFrame> 
                                        </ObjectAnimationUsingKeyFrames> 
                                    </Storyboard> 
                                </BeginStoryboard> 
                            </Trigger.EnterActions> 
                            <Trigger.ExitActions> 
                                <BeginStoryboard> 
                                    <Storyboard> 
                                        <ObjectAnimationUsingKeyFrames 
                                                Storyboard.TargetProperty="Visibility" 
                                                Storyboard.TargetName="border"
                                            <DiscreteObjectKeyFrame KeyTime="0"
                                                <DiscreteObjectKeyFrame.Value> 
                                                    <Visibility>Collapsed</Visibility> 
                                                </DiscreteObjectKeyFrame.Value> 
                                            </DiscreteObjectKeyFrame> 
                                        </ObjectAnimationUsingKeyFrames> 
                                    </Storyboard> 
                                </BeginStoryboard> 
                            </Trigger.ExitActions> 
 
                            <Setter Property="BorderBrush" TargetName="border" 
                                    Value="{StaticResource ColorPaletteViewItem_OuterBorder_Selected}" /> 
                            <Setter Property="BorderBrush" TargetName="Innerborder" 
                                    Value="{StaticResource ColorPaletteViewItem_InnerBorder_Selected}" /> 
                        </Trigger> 
                        <Trigger Property="IsMouseOver" Value="True"
                            <Setter Property="Visibility" TargetName="border"
                                <Setter.Value> 
                                    <Visibility>Visible</Visibility> 
                                </Setter.Value> 
                            </Setter> 
                        </Trigger> 
                        <Trigger Property="IsMouseOver" Value="false"
                            <Setter Property="Visibility" TargetName="border"
                                <Setter.Value> 
                                    <Visibility>Collapsed</Visibility> 
                                </Setter.Value> 
                            </Setter> 
                        </Trigger> 
                    </ControlTemplate.Triggers> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
        <Setter Property="Content" Value="Color" /> 
        <Setter Property="Color" Value="Green" /> 
    </Style> 
 
    <Style TargetType="telerikInput:RadColorPaletteView" 
        x:Key="{telerik:ThemeResourceKey ThemeType=customTheme:BlackTheme, ElementType=telerikInput:RadColorPaletteView}"
        <Setter Property="Background" Value="{StaticResource ColorPicker_Background}" /> 
        <Setter Property="BorderBrush" Value="{StaticResource ColorPicker_OuterBorder}" /> 
        <Setter Property="BorderThickness" Value="1" /> 
        <Setter Property="ItemContainerStyle" Value="{StaticResource DefaultStyle}" /> 
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="telerikInput:RadColorPaletteView"
                    <Border BorderBrush="{TemplateBinding BorderBrush}" 
                            Background="{TemplateBinding Background}" 
                            BorderThickness="{TemplateBinding BorderThickness}"
                        <ItemsPresenter x:Name="ItemsPresenter" Margin="0,2,0,2" /> 
                    </Border> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
        <Setter Property="ItemsPanel"
            <Setter.Value> 
                <ItemsPanelTemplate> 
                    <primitives:RadUniformGrid x:Name="uniformGrid" HorizontalAlignment="Stretch" 
                            ChildrenFlow="Vertical" VerticalAlignment="Stretch" Columns="10"
                    </primitives:RadUniformGrid> 
                </ItemsPanelTemplate> 
            </Setter.Value> 
        </Setter> 
        <Setter Property="Margin" Value="0" /> 
    </Style> 
 
    <Style TargetType="telerikInput:RadColorSelector" 
        x:Key="{telerik:ThemeResourceKey ThemeType=customTheme:BlackTheme, ElementType=telerikInput:RadColorSelector}"
        <Setter Property="Background" Value="{StaticResource ColorPicker_Background}" /> 
        <Setter Property="BorderBrush" Value="{StaticResource ColorPicker_OuterBorder}" /> 
        <Setter Property="BorderThickness" Value="1" /> 
        <Setter Property="Foreground" Value="{StaticResource ColorPicker_Foreground}" /> 
        <Setter Property="FontWeight" Value="Bold" /> 
        <Setter Property="FontStyle" Value="Normal" /> 
        <Setter Property="MainPaletteItemsStyle" Value="{StaticResource DefaultStyle}" /> 
        <Setter Property="Template"
            <Setter.Value> 
                <ControlTemplate TargetType="telerikInput:RadColorSelector"
                    <Border BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="2" 
                            BorderThickness="{TemplateBinding BorderThickness}"
                        <Border BorderBrush="{StaticResource ColorPicker_InnerBorder}" 
                                BorderThickness="1" CornerRadius="1"
                            <Grid x:Name="RootElement" Margin="0" 
                                    Background="{TemplateBinding Background}"
                                <Grid.RowDefinitions> 
                                    <RowDefinition Height="Auto" /> 
                                    <RowDefinition Height="Auto" /> 
                                    <RowDefinition Height="Auto" /> 
                                    <RowDefinition Height="*" /> 
                                    <RowDefinition Height="Auto" /> 
                                    <RowDefinition Height="Auto" /> 
                                </Grid.RowDefinitions> 
                                <Button Content="{TemplateBinding NoColorText}" 
                                        x:Name="PaletteHeader" Grid.Row="0" 
                                        Background="{TemplateBinding Background}" 
                                        Style="{StaticResource RadColorPicker_HeaderButtonStyle}" /> 
                                <Border Margin="0 0 0 3" Grid.Row="1" 
                                        Background="{StaticResource ColorPicker_TitleBackground}" 
                                        BorderBrush="{StaticResource ColorPicker_TitleBorder}" 
                                        BorderThickness="0 0 0 1"
                                    <TextBlock Margin="10,2,2,2" x:Name="mainPaletteHeader" 
                                            FontStyle="{TemplateBinding FontStyle}" 
                                            FontWeight="{TemplateBinding FontWeight}" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            Text="{TemplateBinding MainPaletteHeaderText}" /> 
                                </Border> 
                                <telerikInput:RadColorPaletteView 
                                        Background="{TemplateBinding Background}" Grid.Row="2" 
                                        Margin="0,0,0,-3" VerticalAlignment="Center" 
                                        x:Name="HeaderPalette" BorderBrush="Transparent" 
                                        BorderThickness="0"
                                    <telerikInput:RadColorPaletteView.ItemsPanel> 
                                        <ItemsPanelTemplate> 
                                            <primitives:RadUniformGrid Background="Transparent" 
                                                    Columns="10"
                                            </primitives:RadUniformGrid> 
                                        </ItemsPanelTemplate> 
                                    </telerikInput:RadColorPaletteView.ItemsPanel> 
                                </telerikInput:RadColorPaletteView> 
                                <telerikInput:RadColorPaletteView Grid.Row="3" Margin="0 5 0 2" 
                                        x:Name="MainPalette" 
                                        ItemContainerStyle="{TemplateBinding MainPaletteItemsStyle}" 
                                        BorderBrush="Transparent" BorderThickness="0" 
                                        Background="{TemplateBinding Background}" /> 
                                <Border Margin="0 2 0 3" x:Name="StandardPaletteBorder" Grid.Row="4" 
                                        Background="{StaticResource ColorPicker_TitleBackground}" 
                                        BorderBrush="{StaticResource ColorPicker_TitleBorder}" 
                                        BorderThickness="0 0 0 1"
                                    <TextBlock Margin="10,2,2,2" x:Name="standardPaletteHeader" 
                                            FontWeight="{TemplateBinding FontWeight}" 
                                            Foreground="{TemplateBinding Foreground}" 
                                            Text="{TemplateBinding StandardPaletteHeaderText}" /> 
                                </Border> 
                                <telerikInput:RadColorPaletteView x:Name="StandartPalette" 
                                        Margin="0 0 0 1" VerticalAlignment="Center" Grid.Row="5" 
                                        BorderBrush="Transparent" BorderThickness="0" 
                                        Background="{TemplateBinding Background}"
                                    <telerikInput:RadColorPaletteView.ItemsPanel> 
                                        <ItemsPanelTemplate> 
                                            <primitives:RadUniformGrid Background="Transparent" 
                                                    Columns="10"
                                            </primitives:RadUniformGrid> 
                                        </ItemsPanelTemplate> 
                                    </telerikInput:RadColorPaletteView.ItemsPanel> 
                                </telerikInput:RadColorPaletteView> 
                            </Grid> 
                        </Border> 
                    </Border> 
                </ControlTemplate> 
            </Setter.Value> 
        </Setter> 
    </Style> 
 
    <Style TargetType="telerikInput:RadColorPicker" 
        x:Key="{telerik:ThemeResourceKey ThemeType=customTheme:BlackTheme, ElementType=telerikInput:RadColorPicker}"
        <Style.Setters> 
            <Setter Property="Template"
                <Setter.Value> 
                    <ControlTemplate TargetType="telerikInput:RadColorPicker"
                        <Grid x:Name="Root" 
                                HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
                                VerticalAlignment="{TemplateBinding VerticalAlignment}"
                            <Grid x:Name="Placement" Width="34"
                                <Grid.ColumnDefinitions> 
                                    <ColumnDefinition Width="23" /> 
                                    <ColumnDefinition Width="Auto" /> 
                                </Grid.ColumnDefinitions> 
 
                                <Border x:Name="Over_back" Opacity="0" Height="25" CornerRadius="1" 
                                        Background="{StaticResource ColorPicker_ButtonBackground_MouseOver}" 
                                        BorderBrush="{StaticResource ColorPicker_ButtonBorder_MouseOver}" 
                                        BorderThickness="1" Width="34" Grid.ColumnSpan="2"
                                    <Border CornerRadius="0" BorderThickness="1" 
                                            BorderBrush="{StaticResource ColorPicker_ButtonInnerBorder_MouseOver}" /> 
                                </Border> 
 
                                <Button x:Name="LeftButton" 
                                        Style="{TemplateBinding ColorButtonStyle}" 
                                        HorizontalContentAlignment="Center" /> 
 
                                <ToggleButton Grid.Column="1" x:Name="ToggleButtonElement" 
                                    IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" 
                                    Style="{TemplateBinding ExpanderButtonStyle}" Cursor="Hand" /> 
                            </Grid> 
 
                            <Popup x:Name="PART_Popup" 
                                AllowsTransparency="True" StaysOpen="False" 
                                IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" 
                                PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
                                <Grid> 
                                    <Border x:Name="DropDownBorder"
                                        <telerikInput:RadColorSelector x:Name="ColorSelector" 
                                                MainPaletteItemsStyle="{TemplateBinding MainPaletteItemsStyle}" 
                                                MainPaletteColumnsCount="{TemplateBinding MainPaletteColumnsCount}" 
                                                MainPaletteOrientation="{TemplateBinding MainPaletteOrientation}" 
                                                MainPaletteHeaderText="{TemplateBinding MainPaletteHeaderText}" 
                                                MainPalette="{TemplateBinding MainPalette}" 
                                                HeaderPalette="{TemplateBinding HeaderPalette}" 
                                                HeaderPaletteVisibility="{TemplateBinding HeaderPaletteVisibility}" 
                                                StandardPalette="{TemplateBinding StandardPalette}" 
                                                StandardPaletteVisibility="{TemplateBinding StandardPaletteVisibility}" 
                                                StandardPaletteHeaderText="{TemplateBinding StandardPaletteHeaderText}" 
                                                NoColorText="{TemplateBinding NoColorText}" 
                                                BorderBrush="{TemplateBinding BorderBrush}" 
                                                BorderThickness="{TemplateBinding BorderThickness}" 
                                                NoColorVisibility="{TemplateBinding NoColorVisibility}" 
                                                SelectedColor="{TemplateBinding SelectedColor}" 
                                                Background="{TemplateBinding Background}" 
                                                FontWeight="{TemplateBinding FontWeight}" 
                                                FontStyle="{TemplateBinding FontStyle}" 
                                                Foreground="{TemplateBinding Foreground}" /> 
 
                                    </Border> 
                                </Grid> 
                            </Popup> 
 
                        </Grid> 
                        <ControlTemplate.Triggers> 
                            <Trigger Property="IsMouseOver" Value="True"
                                <Setter Property="Opacity" TargetName="Over_back" Value="1" /> 
                            </Trigger> 
                            <Trigger Property="IsChecked" Value="True" 
                                    SourceName="ToggleButtonElement"
                                <Setter Property="Opacity" TargetName="Over_back" Value="1" /> 
                            </Trigger> 
                            <Trigger Property="IsFocused" Value="True" /> 
                        </ControlTemplate.Triggers> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
            <Setter Property="MainPaletteColumnsCount" Value="10" /> 
            <Setter Property="MainPaletteOrientation" Value="Vertical" /> 
            <Setter Property="MainPalette" Value="Office" /> 
            <Setter Property="HeaderPaletteVisibility" Value="Visible" /> 
            <Setter Property="StandardPaletteVisibility" Value="Visible" /> 
            <Setter Property="NoColorVisibility" Value="Visible" /> 
            <Setter Property="SelectedColor" Value="Black" /> 
            <Setter Property="StandardPalette" Value="Standard" /> 
            <Setter Property="HeaderPalette" Value="Office" /> 
            <Setter Property="MainPaletteItemsStyle" Value="{StaticResource DefaultStyle}" /> 
            <Setter Property="ColorButtonStyle" Value="{StaticResource ColorButtonDefaultStyle}" /> 
            <Setter Property="ExpanderButtonStyle" Value="{StaticResource ToggleButtonIconStyle}" /> 
            <Setter Property="HorizontalAlignment" Value="Left" /> 
            <Setter Property="VerticalAlignment" Value="Top" /> 
            <Setter Property="Background" Value="{StaticResource ColorPicker_Background}" /> 
            <Setter Property="BorderBrush" Value="{StaticResource ColorPicker_OuterBorder}" /> 
            <Setter Property="BorderThickness" Value="1" /> 
            <Setter Property="FontStyle" Value="Normal" /> 
            <Setter Property="FontWeight" Value="Bold" /> 
            <Setter Property="Foreground" Value="{StaticResource ColorPicker_Foreground}" /> 
        </Style.Setters> 
    </Style> 
</ResourceDictionary> 
 


Vanya Pavlova
Telerik team
 answered on 29 Aug 2012
1 answer
157 views
Hi,

I am trying to add a programmtically Telerik TreeView in Combo Box just like you showed it in your tutorial for combo box application scenarios (http://blogs.telerik.com/xamlteam/posts/09-08-27/treeview-in-combobox-take-3-silverlight-3-wpf-and-radcontrols.aspx )

Could you give me an example how to achieve this programmatically?



Regards
Alberto
Vladi
Telerik team
 answered on 28 Aug 2012
2 answers
218 views
Hi,

I  want to auto size the every column by its content text automatically.because when the radtreelistview have a long content the column take all time this size even if I loaded with other data.

i tryed to put=
column.Width = GridViewLength.SizeToCells;
but it dosen't work.









Fatima
Top achievements
Rank 1
 answered on 28 Aug 2012
5 answers
91 views

Hi,

I am using "Telerik UI controls for WPF" (v2012.2.725.40).

I am writing code in my assemblies which have their assembly attribute "System.CLSCompliant" set to True. Those assemblies can be redistributed to other teams using other programming languages (I used C#).
I wanted to expose some public members with return values and/or parameters such as 'RadDocument' or 'Telerik.Windows.Controls.DocumentViewManager'.

There was a compile warning which in my case was transform as error (because we use "treat warning as error" in our projects).

I have got 2 choices (if you know other ways, please let me know):
1) Look at the inheritance (implementation or interface) and try to find a CLS-compliant type. If not, then use 'object' for the return type or paramter.
2) I can set the attribute "System.CLSCompliant" to false at the method or property which raised the warning, but then I am preventing the users of my assemblies to have access to those methods.
 

# What is the main reason why Telerik assemblies for WPF (I do not know about the other products) are not compiled with "System.CLSCompliant(True)"?

# Is there a plan to mark your Telerik assemblies for WPF with the CLS-compliant?

I had a look and search on the web for this issue, but could not find a good answer.

Thank you,
Joao

Joao
Top achievements
Rank 1
 answered on 28 Aug 2012
1 answer
104 views
Hi I have a RadDataForm which I fill data from Grid. My problem is unabled add button when my collection is empty.Colection is below. Is there any way to solve this?


private
ObservableCollection<IGridItemViewModel> items;
        public ObservableCollection<IGridItemViewModel> Items
        {
            get
            {
                return items;
            }
 
            set
            {
                if (items != value)
                {
                    items = value;
                    items.CollectionChanged += items_CollectionChanged;
                }
            }
        }

Thak you for helping me
Ondrej
Yoan
Telerik team
 answered on 28 Aug 2012
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?