Telerik Forums
UI for WPF Forum
5 answers
545 views

I stumbled upon a adding a content to the DropDownContent property of the RadDropDownButton. Particularly I have a problem binding a dependency property of the content element to a property up the logical tree hierarchy. I managed to reproduce the issue in small piece of XAML. It contains a window with a local value “Test” set to its Tag property. There is a TextBlock inside the DropDown button with its property Text bound to the Tag property of the window. When I run the sample I get the following error:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Window', AncestorLevel='1''. BindingExpression:Path=Tag; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

Another identical TextBlock is placed outside of the DropDown button and its Binding works fine.

I guess that the RadDropDownButton control fails to preserve the logical tree inheritance by not calling
FrameworkElement.
AddLogicalChild method on the DropDownContent element (provided that the content inherits from FrameworkElement). Here is the XAML code:

 

<Window x:Class="WpfApplication14.MainWindow" Title="MainWindow" SizeToContent="WidthAndHeight" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"   
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
        Tag="Test" > 
      
    <Grid Width="200" Height="200">  
        <StackPanel HorizontalAlignment="Left">  
            <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Tag}" Height="22"/>  
            <telerik:RadDropDownButton Content="Drop Down" Height="22" Width="200" DropDownWidth="200">  
                <telerik:RadDropDownButton.DropDownContent> 
                    <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Tag}"/>  
                </telerik:RadDropDownButton.DropDownContent> 
            </telerik:RadDropDownButton> 
        </StackPanel> 
    </Grid> 
</Window> 
 
Allen
Top achievements
Rank 2
Iron
Veteran
 answered on 17 Jun 2011
1 answer
91 views
I am trying to style the background color of the TreeListView items in WPF.
I would like each level to have a darker shade of the previous. I attached a link to ta picture of what I am trying to achieve with this control.

http://i167.photobucket.com/albums/u141/jessica_78610/TreeViewList.png


Is something like this possible with this control, and if so could you help with this, I have been trying to do this using Expression Blend but have been unsuccessful.


Vanya Pavlova
Telerik team
 answered on 17 Jun 2011
2 answers
64 views
Hello Telerik Team,

I am using a Telerik Hierarchical rad grid.
On the expand changing event of a row in the parent grid, how can I get the instance of the child grid ?

Please suggest.

Regards,
Mausami

Mausami
Top achievements
Rank 1
 answered on 17 Jun 2011
3 answers
488 views
Hi Folks,

I need to be able to get the actual cursor position of the cursor in the text of the DataTimePicker - the SelectionStart and SelectionLength properties that are on the TextBox are not on the RadDatePicker. So, any ideas on how to achieve this?

Thanks
Kendrew
Konstantina
Telerik team
 answered on 17 Jun 2011
3 answers
683 views
Hi,

I need to provide a tooltip on the datgrid coulmn.

Data in the Grid column is in Image format.

ToolTip should change on the basis of Image.

if Image1 , toolTip=A 
Image2 , toolTip=B
Image3 , toolTip=C

Tooltip is in string format.

Please help on this.

Maya
Telerik team
 answered on 17 Jun 2011
1 answer
93 views
Hi,

I have a data pager and I want to make my data pager should support multi language. I am able to implement culture on data pager except page and of string.
I tried with some sample application but I am not able to implement other culture ( French or other) on page and of string.

Can you please resolve my issue as soon as possible.

Regards,
Ravindra
Maya
Telerik team
 answered on 17 Jun 2011
2 answers
246 views
I have a datagrid with an image column. On click of that image i want to show a pop up.
Can you please help in implementing this using MVVM pattern?
Vlad
Telerik team
 answered on 17 Jun 2011
1 answer
187 views
HI,

how can i change the color of the "black" arrow of an telerik:RadDropDownButton ?

Thanks
Rene
Tina Stancheva
Telerik team
 answered on 17 Jun 2011
2 answers
160 views
Hi Telerik,

When the RadNumericUpDown is in focus, I'd like to update the source in VM. I created a simple method to grab the focused element from the keyboard and update the source. The problem is the Keyboard.FocusedElement returned a type called PickerTextBox instead of RadNumericUpDown and thus the highlighted codes won't be fired. My question is how I can UpdateSource to NumericUpDown properly? The original problem is when the RadNumericUpDown is in focus and user saves the app, the RadNumericUpDown source won't be updated.

        private void UpdateFocusedTextBox()

        {

            //There is an issue when textbox is in focus, it won't update the source.

            //This workaround will try to find the currently focusedTextBox and update the source.

            object focusedTextBox = Keyboard.FocusedElement;

 

            if (focusedTextBox is RadNumericUpDown)

            {

                RadNumericUpDown rad = focusedTextBox as RadNumericUpDown;

                ((RadNumericUpDown)focusedTextBox).GetBindingExpression(RadNumericUpDown.ValueProperty).UpdateSource();

            }           

            else if(focusedTextBox is TextBox)

                ((TextBox)focusedTextBox).GetBindingExpression(TextBox.TextProperty).UpdateSource();        

        }

Cheau-Long
Top achievements
Rank 1
 answered on 16 Jun 2011
2 answers
101 views
Hello,

I'm trying to use a RadColorPaletteView with my own list of custom colors, in this way:

<TInputControls:RadColorPaletteView Height="18" SelectionChanged="RadColorPaletteView_SelectionChanged" >
<TInputControls:RadColorPaletteViewItem Color="Red" />
<TInputControls:RadColorPaletteViewItem Color="Orange"/>
<TInputControls:RadColorPaletteViewItem Color="Yellow" />
<TInputControls:RadColorPaletteViewItem Color="Green" />
<TInputControls:RadColorPaletteViewItem Color="Blue" />
<TInputControls:RadColorPaletteViewItem Color="Purple" />
<TInputControls:RadColorPaletteViewItem Color="White" />
<TInputControls:RadColorPaletteViewItem Color="Black" />
</TInputControls:RadColorPaletteView>

In my app, the black doesn't show up.  Instead, I get a square that seems to have a transparent background.  If I hover close to the border of that square, sometimes it allows me to select it, but most of the time I can't select the square.

I've tried moving the black to other positions in the list, and tried the hex value instead of the name, and it seems to have the same problem.  Additionally, if I wrap the RadColorPaletteViewItems in a plain ListBox instead of the RadColorPaletteView, the "black" one still has the same problem.

Is there something I need to do differently?
Chad
Top achievements
Rank 1
 answered on 16 Jun 2011
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?