Telerik Forums
UI for WPF Forum
2 answers
482 views
Hello!
I need a DropDownButton that looks the very similar with the Themes button from RadControls fo WPF demos
If use the same style from a regular button I somehow lose the drop down functionality

<!-- Style for Button --> 
            <Style TargetType="Controls:RadDropDownButton" x:Key="DefaultButtonStyle"
                <Setter Property="Background" Value="Transparent" /> 
                <Setter Property="Foreground" Value="#FFFFFFFF" /> 
                <Setter Property="Padding" Value="3" /> 
                <Setter Property="BorderThickness" Value="1" /> 
                <Setter Property="VerticalContentAlignment" Value="Center" /> 
                <Setter Property="HorizontalContentAlignment" Value="Center" /> 
                <Setter Property="BorderBrush" Value="Transparent" /> 
                <Setter Property="Cursor" Value="Hand" /> 
                <Setter Property="Template"
                    <Setter.Value> 
                        <ControlTemplate TargetType="Controls:RadDropDownButton"
                            <Grid Margin="0 0 0 5"
                                <Border x:Name="Background" BorderBrush="#FFBF97F2" 
                                BorderThickness="1,1,1,1" CornerRadius="4,4,4,4"
                                    <Border.Background> 
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                            <GradientStop Color="#FF3B2555" /> 
                                            <GradientStop Color="#FF2B1C3C" Offset="0.61699998378753662" /> 
                                            <GradientStop Color="#FF321F47" Offset="1" /> 
                                        </LinearGradientBrush> 
                                    </Border.Background> 
                                    <Path x:Name="Path" Height="Auto" Margin="0,0.082,0,8.859" Width="Auto" 
                                    Stretch="Fill" Stroke="{x:Null}" StrokeLineJoin="Round" 
                                    StrokeThickness="1" 
                                    Data="M0,3 C0,1.3431457 1.3431457,0 3,0 L129,0 C130.65686,0 132,1.3431457 132,3 L132,13.853975 C86.718803,0.055481441 26.160202,27.400364 0,11.585506 z"
                                        <Path.Fill> 
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                                <GradientStop Color="#005B3D7A" Offset="0.092" /> 
                                                <GradientStop Color="#FF5B3D7A" Offset="1" /> 
                                            </LinearGradientBrush> 
                                        </Path.Fill> 
                                    </Path> 
                                </Border> 
                                <ContentPresenter VerticalAlignment="Center" 
                                            HorizontalAlignment="Center" 
                                            Content="{TemplateBinding Content}" 
                                            ContentTemplate="{TemplateBinding ContentTemplate}"/> 
                            </Grid> 
                            <ControlTemplate.Triggers> 
                                <Trigger Property="IsMouseOver" Value="true"
                                    <Setter Property="BorderBrush" TargetName="Background" Value="#FFFFFFFF" /> 
                                    <Setter Property="Fill" TargetName="Path"
                                        <Setter.Value> 
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"
                                                <GradientStop Color="#005B3D7A" Offset="0.092" /> 
                                                <GradientStop Color="#FF6D4497" Offset="1" /> 
                                            </LinearGradientBrush> 
                                        </Setter.Value> 
                                    </Setter> 
                                </Trigger> 
                                <Trigger Property="IsPressed" Value="True" /> 
                                <Trigger Property="IsEnabled" Value="False" /> 
                                <Trigger Property="IsFocused" Value="False" /> 
                            </ControlTemplate.Triggers> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 

I might use instead a RadComboBox but I don't know exactly how to style it in the same maner ( the idea is that I don't want to use instead just a RadComboBox with QsfTheme because I need to change some colors & stuff and I don't have the code from QsfTheme )
Can you help me?

Thank you!
Roxana

RoxanaC
Top achievements
Rank 1
 answered on 15 Jan 2010
3 answers
121 views
Hello.

I've set the minimum value of my RadNumericUpDown to double.MinValue.  I am able to hit the "-" sign on the numeric keypad, but not on the keyboard itself (between the 0 and = buttons above the P key).  the RadNumericUpdown is filtering out this key.  This is apperant when using a laptop, as they don't have a numeric keypad, so the user has to hit the fn key in order to get the "-" sign.

I had a similar issue with the "." key not working, I'm assuming this is more of the same.  Here is a link to that thread


I really need an answer asap, and appreciate your help.

Thanks
Joshua

Hristo Borisov
Telerik team
 answered on 15 Jan 2010
3 answers
163 views
Here is the senario.

I have a ObservableCollection with let say 100 items.  I have clicked on and selected row # 60.  Then I delete row 50 to 100, and instantly add 50 new rows (I have now 100 items again. The grid "auto updates" as the type of collection, But I loose my selection.

I can get what row that was selected before my update, and select it agan. But now that row is at the top of the grid. I want the selection to be at the same place as before update.

How can I scroll the grid to that same position?

Vlad
Telerik team
 answered on 14 Jan 2010
8 answers
261 views

I’m using the rowdragdrop example inside of a viewbox. Theviewbox is set to stretch=”Fill”. The problem I’m having is that when the userresizes the window and moves a row the offset inside the viewbox isn’t changingwhich means the position of the row that I’m dragging isn’t under the mouse.

I was wondering if you had any ideas on how this could befixed?

Thanks

~Boots

Pavel Pavlov
Telerik team
 answered on 14 Jan 2010
4 answers
149 views
Hello,

I want to perform my own custom logic whenever an item is dragged/dropped. This procedure requires me to access the item's parent. I noticed that when I drag items and then drop them, in the RadTreeView.DragEnded event, the item's ParentItem property becomes null and the FullPath string property is also cleared.

Is this the correct event to handle for my custom logic (i.e. performing the "drop" in the business logic)? If so, how can I get the item's parent before it was dragged (i.e. its current parent).

Thank you.
Ziad
Top achievements
Rank 1
 answered on 14 Jan 2010
1 answer
124 views
Hi There
              We are shift to Q3 Controls but my MouseLeftButtonDown  on GridView doesn't fire. As i have seen the post where this event handle by mouse class of Telerik.Windows.Input namespace but we are not able to find this namespace, there may be version issue. We  use assemblies with  version [2009.3.1103.35]. Please reply me as soon as possible. and if possible submit a demo.
Milan
Telerik team
 answered on 14 Jan 2010
1 answer
287 views
Is it possible to hide the calendar toggle button of the RadDatePicker control?

Regards,
Michael
Konstantina
Telerik team
 answered on 14 Jan 2010
1 answer
344 views
Hello,

I'm using the GridView/HeaderContextMenu example for version 2009.3.1208.35. When i have more columns than displayed on the screen it seems to mix up the contextmenus. Also this line of code IEnumerable<GridViewHeaderCell> cells = row.Cells.OfType<GridViewHeaderCell>(); in the InitializeMenus method doesn't return all of the GridViewHeaderCells.

made a quick example,
<Window x:Class="WpfApplication1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerk="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:local="clr-namespace:WpfApplication1"
    <Grid> 
        <telerk:RadGridView x:Name="rgv" local:GridViewHeaderMenu.IsEnabled="True" /> 
    </Grid> 
</Window> 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
using System.Collections; 
 
namespace WpfApplication1 
    /// <summary> 
    /// Interaction logic for Window1.xaml 
    /// </summary> 
    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
 
            ArrayList List = new ArrayList(); 
            for (int i = 0; i < 100; i++) 
            { 
                List.Add(new Testing() 
                { 
                    Test1 = i.ToString(), 
                    Test2 = i, 
                    Test3 = i, 
                    Test4 = i.ToString(), 
                    Test5 = i, 
                    Test6 = i, 
                    Test7 = i.ToString(), 
                    Test8 = i, 
                    Test9 = i, 
                    Test10 = i.ToString(), 
                    Test11 = i, 
                    Test12 = i, 
                    Test13 = i.ToString(), 
                    Test14 = i, 
                    Test15 = i, 
                    Test16 = i.ToString(), 
                    Test17 = i, 
                    Test18 = i 
                }); 
            } 
 
            rgv.ItemsSource = List; 
        } 
    } 
 
    public class Testing 
    { 
        public String Test1 { getset; } 
        public int Test2 { getset; } 
        public Double Test3 { getset; } 
        public String Test4 { getset; } 
        public int Test5 { getset; } 
        public Double Test6 { getset; } 
        public String Test7 { getset; } 
        public int Test8 { getset; } 
        public Double Test9 { getset; } 
        public String Test10 { getset; } 
        public int Test11 { getset; } 
        public Double Test12 { getset; } 
        public String Test13 { getset; } 
        public int Test14 { getset; } 
        public Double Test15 { getset; } 
        public String Test16 { getset; } 
        public int Test17 { getset; } 
        public Double Test18 { getset; } 
    } 
 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.ComponentModel; 
using System.Text; 
using System.Windows; 
using System.Windows.Data; 
using Telerik.Windows; 
using Telerik.Windows.Controls; 
using Telerik.Windows.Controls.GridView; 
using Telerik.Windows.Data; 
 
namespace WpfApplication1 
    public class GridViewHeaderMenu 
    { 
        private RadGridView grid = null
 
        public GridViewHeaderMenu(RadGridView grid) 
        { 
            this.grid = grid; 
        } 
 
        public static readonly DependencyProperty IsEnabledProperty 
            = DependencyProperty.RegisterAttached("IsEnabled"typeof(bool), typeof(GridViewHeaderMenu), 
                new PropertyMetadata(new PropertyChangedCallback(OnIsEnabledPropertyChanged))); 
 
        public static void SetIsEnabled(DependencyObject dependencyObject, bool enabled) 
        { 
            dependencyObject.SetValue(IsEnabledProperty, enabled); 
        } 
 
        public static bool GetIsEnabled(DependencyObject dependencyObject) 
        { 
            return (bool)dependencyObject.GetValue(IsEnabledProperty); 
        } 
 
        private static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) 
        { 
            RadGridView grid = dependencyObject as RadGridView; 
            if (grid != null
            { 
                if ((bool)e.NewValue) 
                { 
                    // Create new GridViewHeaderMenu and attach RowLoaded event. 
                    GridViewHeaderMenu menu = new GridViewHeaderMenu(grid); 
                    menu.Attach(); 
                } 
            } 
        } 
 
        private void Attach() 
        { 
            if (grid != null
            { 
                this.grid.Loaded += new RoutedEventHandler(grid_Loaded); 
            } 
        } 
 
        void grid_Loaded(object sender, RoutedEventArgs e) 
        { 
            GridViewHeaderRow headerRow = grid.ChildrenOfType<GridViewHeaderRow>().FirstOrDefault(); 
            if (headerRow != null
            { 
                InitializeMenus(headerRow); 
            } 
        } 
 
        private void InitializeMenus(GridViewHeaderRow row) 
        { 
            IEnumerable<GridViewHeaderCell> cells = row.Cells.OfType<GridViewHeaderCell>(); 
 
            foreach (GridViewHeaderCell cell in cells) 
            { 
                // create menu 
                RadContextMenu contextMenu = new RadContextMenu(); 
                // set menu Theme 
                StyleManager.SetTheme(contextMenu, StyleManager.GetTheme(grid)); 
 
                RadMenuItem item = new RadMenuItem() { Header = String.Format(@"Sort Ascending by ""{0}""", cell.Column.Header) }; 
                contextMenu.Items.Add(item); 
 
                item = new RadMenuItem() { Header = String.Format(@"Sort Descending by ""{0}""", cell.Column.Header) }; 
                contextMenu.Items.Add(item); 
 
                item = new RadMenuItem() { Header = String.Format(@"Clear Sorting by ""{0}""", cell.Column.Header) }; 
                contextMenu.Items.Add(item); 
 
                item = new RadMenuItem() { Header = String.Format(@"Group by ""{0}""", cell.Column.Header) }; 
                contextMenu.Items.Add(item); 
 
                item = new RadMenuItem() { Header = String.Format(@"Ungroup ""{0}""", cell.Column.Header) }; 
                contextMenu.Items.Add(item); 
 
                item = new RadMenuItem() { Header = "Choose Columns:" }; 
                contextMenu.Items.Add(item); 
 
                // create menu items 
                foreach (GridViewColumn column in grid.Columns) 
                { 
                    RadMenuItem subMenu = new RadMenuItem() 
                    { 
                        Header = column.Header, 
                        IsCheckable = true
                        IsChecked = true 
                    }; 
 
                    // bind IsChecked menu item property to IsVisible column property 
                    subMenu.SetBinding(RadMenuItem.IsCheckedProperty, 
                        new Binding("IsVisible") { Mode = BindingMode.TwoWay, Source = column }); 
 
                    item.Items.Add(subMenu); 
                } 
 
                contextMenu.AddHandler(RadMenuItem.ClickEvent, new RoutedEventHandler(OnMenuItemClick)); 
 
                // attach menu 
                RadContextMenu.SetContextMenu(cell, contextMenu); 
            } 
        } 
 
        void OnMenuItemClick(object sender, RoutedEventArgs e) 
        { 
            RadContextMenu menu = (RadContextMenu)sender; 
            RadMenuItem clickedItem = ((RadRoutedEventArgs)e).OriginalSource as RadMenuItem; 
            GridViewColumn column = ((GridViewHeaderCell)menu.UIElement).Column; 
 
            if (clickedItem.Parent is RadMenuItem) 
                return
 
            string header = Convert.ToString(clickedItem.Header); 
 
            using (grid.DeferRefresh()) 
            { 
                Telerik.Windows.Data.SortDescriptor sd = (from d in grid.SortDescriptors 
                                                          where d.Member == column.UniqueName 
                                                          select d).FirstOrDefault(); 
 
                if (header.Contains("Sort Ascending")) 
                { 
                    if (sd != null
                    { 
                        grid.SortDescriptors.Remove(sd); 
                    } 
 
                    grid.SortDescriptors.Add(new Telerik.Windows.Data.SortDescriptor() 
                    { 
                        Member = column.UniqueName, 
                        SortDirection = ListSortDirection.Ascending 
                    }); 
                } 
                else if (header.Contains("Sort Descending")) 
                { 
                    if (sd != null
                    { 
                        grid.SortDescriptors.Remove(sd); 
                    } 
 
                    grid.SortDescriptors.Add(new Telerik.Windows.Data.SortDescriptor() 
                    { 
                        Member = column.UniqueName, 
                        SortDirection = ListSortDirection.Descending 
                    }); 
                } 
                else if (header.Contains("Clear Sorting")) 
                { 
                    if (sd != null
                    { 
                        grid.SortDescriptors.Remove(sd); 
                    } 
                } 
                else if (header.Contains("Group by")) 
                { 
                    Telerik.Windows.Data.GroupDescriptor gd = (from d in grid.GroupDescriptors 
                                                               where d.Member == column.UniqueName 
                                                               select d).FirstOrDefault(); 
 
                    if (gd == null
                    { 
                        grid.GroupDescriptors.Add(new Telerik.Windows.Data.GroupDescriptor() { Member = column.UniqueName, SortDirection = ListSortDirection.Ascending }); 
                    } 
                } 
                else if (header.Contains("Ungroup")) 
                { 
                    Telerik.Windows.Data.GroupDescriptor gd = (from d in grid.GroupDescriptors 
                                                               where d.Member == column.UniqueName 
                                                               select d).FirstOrDefault(); 
                    if (gd != null
                    { 
                        grid.GroupDescriptors.Remove(gd); 
                    } 
                } 
            } 
        } 
    } 
 

on my machine if you scroll to the right an open the contextmenu for column Test17 it opens up the contextmenu for Test3.

Any help would be great.
Thanks Again,
~Boots



Stefan Dobrev
Telerik team
 answered on 14 Jan 2010
2 answers
156 views
hi,
i want to perform some action when ever user selects the row header of the grid view,
now problem is that i don't know what is the event name for Telerik GridView.

please, tell me the event name of row header selection by mouse.
thanks
Jorge Gonzalez
Top achievements
Rank 1
 answered on 13 Jan 2010
3 answers
112 views
Hello,
   I am appending an entry to a grid that contains several hundred items. I use ScrollIntoView to scroll the grid to where the item was added but I have not figured out how to hi-light (select) the new entry. The example at this site on how to do this uses constructs that are no longer supported by the latest release. The grid has the SelectAll and UnSelectAll commands so there has to be some command that selects only one row.
Any help would be appreciated.
Thanks
Jorge Gonzalez
Top achievements
Rank 1
 answered on 13 Jan 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?