Telerik Forums
UI for WPF Forum
6 answers
303 views
 Hi,

I'm trying to add a button to the TitleTemplate of RadPanes (beside the Pin), handle the click event on this button and display a message specific to the targeted RadPanel.
So far, I've applied the solution presented here: http://blogs.telerik.com/xamlteam/posts/09-08-19/customizing-the-header-of-radpane-control-and-adding-behavior-to-it.aspx

My DataTemplate (in Resources):

<Window.Resources>
        <DataTemplate x:Key="PaneHelpHeaderTemplate">
                <StackPanel Orientation="Horizontal">
                    <ContentPresenter Content="{Binding}"
                          Margin="0,0,0,0" />
                <telerik:RadButton   Content="Help" view:HelpButton.IsHelp="True" />
                </StackPanel>
        </DataTemplate>
</Window.Resources>

Applied to:
<telerik:RadPane Name="radPaneTOC" IsPinned="True" CanUserClose="False" CanDockInDocumentHost="False" CanUserPin="False" TitleTemplate="{StaticResource PaneHelpHeaderTemplate}">

And my custom property definition (which is basically a Copy-Paste of the reference above) :   
public static class HelpButton
{
    public static readonly DependencyProperty IsHelp = DependencyProperty.RegisterAttached("IsHelp", typeof(bool), typeof(Telerik.Windows.Controls.RadButton), new PropertyMetadata(OnIsHelpButtonChanged));
 
 
    public static bool GetIsHelp(DependencyObject obj)
    {
        return (bool)obj.GetValue(IsHelp);
    }
 
    public static void SetIsHelp(DependencyObject obj, bool value)
    {
        obj.SetValue(IsHelp, value);
    }
 
    private static void OnIsHelpButtonChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
        bool oldValue = (bool)e.OldValue;
        bool newValue = (bool)e.NewValue;
        var button = d as ButtonBase;
 
        if (button != null && oldValue != newValue)
        {
            if (!oldValue && newValue)
            {
                button.Click += OnCloseButtonClick;
            }
            else
            {
                button.Click -= OnCloseButtonClick;
            }
        }
    }
 
 
    private static void OnCloseButtonClick(object sender, RoutedEventArgs args)
    {
         
 
        var button = sender as FrameworkElement;
 
        if (button != null)
        {
         // NONE OF THEM WORK
            var pane = button.ParentOfType<RadPane>();
          //  var pane = button.GetVisualParent<RadPane>();
          //  var pane = ((System.Windows.Controls.StackPanel)button.Parent).Parent;
            if (pane != null)
            {
                Console.WriteLine("Parent found");
            }
        }
    }
}


As mentioned in the comment, I can't access to the parent (always null), which would allow me to get its Help content (custom property) (or do anything else with it).

I'm not sure if that is the good approach, I heard and read a little about custom Commands (here), but I'm not very familiar with the process. 

As a side note, I would like to define the visibility and the content (text) of this button programmatically.

Thank you,

JL.




JL
Top achievements
Rank 1
 answered on 17 Apr 2014
2 answers
112 views
I have the following scenario:

3 RadCartesianCharts with line series live data. The Zoom property of all of them is bound to the same property in my .cs file.
Is there a way to bind only the X axis so all the charts could share the same zoom on the X axis, but still have individual zoom on the Y axis.
Yovko
Top achievements
Rank 1
 answered on 17 Apr 2014
4 answers
145 views
Hi, i have an external control which i have just downloaded and i want to put that control inside a documentpane which it works. But, when i try to run the application i get a null reference exception and if i remove the control from the docking control, it works fine.

Or is Telerik limited to only its controls and already defined wpf controls ?

<telerik:RadDocumentPane>
  <ModulusFE:StockChartX></ModulusFE:StockChartX>
</telerik:RadDocumentPane>


Note: The ModulusFE controls is referencing some dll file.






Konstantina
Telerik team
 answered on 17 Apr 2014
1 answer
134 views
Hello, I have been searching for how to do this for days now and coming up empty.  Finally I decided to make my own thread on the issue.  What I want to do it click and drag a Header from a RadGridView and drop the header into a RadListBox.  When the header is dropped, i want the Gridview to hide the column and add the column header text to the listbox.  Is this possible?
Nick
Telerik team
 answered on 17 Apr 2014
4 answers
230 views
I have a RadDocument that I am building up programatically. Within the document I have five Sections and in one of the section elements I have added a Footer and inserted a PageField to dynamically generate the page number during rendering of the document.

All of that is working and I am, so far, content. However...

I need the page numbers from that section for use in another section (building an index with key terms and references). I found the following code somewhere on the web but it isn't working properly for me...

For the first page when I make the call the ChildIndex is 3. I'm not sure if this is good or bad but it is most definitely not the solution since the first page of the document is only one page so I should be getting 1. I'm obviously doing *something* incorrectly but am not certain what that is.

Any insight is greatly appreciated!

rjsjr

            var box = mergedDocument.CaretPosition.GetCurrentInlineBox();

            if (box != null)
            {
                DocumentElement element = box.AssociatedDocumentElement;
                var page = GetPageNumberForDocumentElement(element);
            }

        private int GetPageNumberForDocumentElement(DocumentElement element)
        {
            var layoutBox = GetSectionLayoutBox(element);
            return layoutBox.ChildIndex + 1;
        }

        private LayoutBox GetSectionLayoutBox(DocumentElement element)
        {
            LayoutBox layoutBox = element.FirstLayoutBox;
            while (!(layoutBox is SectionLayoutBox))
            {
                layoutBox = layoutBox.Parent;
            }

            return layoutBox;
        }




Missing User
 answered on 17 Apr 2014
1 answer
520 views
Hi,
1. Is it possible to hide 'Add New Sheet' button in the Sheetselector?
2. How to disable the dialog with 'The cell you are trying to editing is on a protected sheet. To make changes, unprotect the sheet' message?
Boryana
Telerik team
 answered on 17 Apr 2014
1 answer
186 views
When the user tries to edit a protected cell in a protected sheet, it pops up a message that says "The cell you are trying to change is on a protected sheet.  To make changes, unprotect the sheet."

Is there a way to turn off the pop up message?

I just want it to do nothing when they try to type into a protected cell.

Thanks
Boryana
Telerik team
 answered on 17 Apr 2014
5 answers
178 views
Hi,

is it possible to use autocomplete without diacritics? For example when I have AutoCompleteBox.ItemsSource with ViewModels containing property Name (one contains Name == "Šířka" for example) and I would like to search item with entered word in antocompletebox sir/sirk/Širk/Šíř etc.

Thank you for your help.
Rosen Vladimirov
Telerik team
 answered on 17 Apr 2014
1 answer
237 views
Hi,

I am looking to control expanding and collapsing of the docked splitcontainer. This is the structure of my splitcontainer - 

<telerik:RadSplitContainer IsEnabled="True" Width="400" InitialPosition="DockedLeft">
                    <telerik:RadPaneGroup>
                        <telerik:RadPane IsActive="True" IsEnabled="True" IsSelected="True" CanUserClose="False" IsPinned="False" Content="{Binding}" telerikAnimation:AnimationManager.IsAnimationEnabled="False"/>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>

I want to keep the Pane IsPinned="False" and just control the functionality like hover on the splitcontainer from click of a button.

Appreciate your help. Thanks.
Kalin
Telerik team
 answered on 17 Apr 2014
1 answer
134 views
I have a WPF Grid, a Combo Box and check box fields as items of the combo box. Combobox items are the grid headers/columns. Currently, the ComboBox is binded to the columns of the Grid and Grid header is toggeled based on the toggling of the checkbox items of Combobox.Now, I have to change this behaviour so that only some fileds are visible on the grid and those which are not visible are availabe in the Combobox as non-selected items with the fields that are visible on the grid as selected items. Toggling the checkbox items in the combobox would toggle the grid header/column visibility. Please suggest.

Grid
-----
 
<local:XYZDataGrid x:Name="dataGrid" Visibility="Hidden" ShowGroupPanel="False" HorizontalAlignment="Left" VerticalAlignment="Top" SelectionMode="Extended" FontSize="10" SelectionUnit="Cell" Margin="0,40,0,0" AutoGeneratingColumn="dataGrid_AutoGeneratingColumn" CellEditEnded="dataGrid_CellEditEnded" RowEditEnded="dataGrid_RowEditEnded" PastingCellClipboardContent="dataGrid_PastingCellClipboardContent" Sorting="dataGrid_Sorting" BeginningEdit="dataGrid_BeginningEdit" CellValidating="dataGrid_CellValidating"
                                   ClipboardPasteMode="SkipHiddenColumns, Default, AllSelectedCells, OverwriteWithEmptyValues" Pasting="dataGrid_Pasting" CopyingCellClipboardContent="dataGrid_CopyingCellClipboardContent" PreviewKeyDown="dataGrid_PreviewKeyDown" ValidatesOnDataErrors="InEditMode" ElementExporting="dataGrid_ElementExporting">
                <telerik:RadGridView.LayoutTransform>
                    <ScaleTransform ScaleX="{Binding Path=Value, ElementName=zoom}" ScaleY="{Binding Path=Value, ElementName=zoom}" />
                </telerik:RadGridView.LayoutTransform>
                <telerik:RadGridView.SortDescriptors>
                    <telerik:SortDescriptor Member="InformationType" SortDirection="Ascending"/>
                    <telerik:SortDescriptor Member="MaterialInformationID" SortDirection="Ascending"/>
                </telerik:RadGridView.SortDescriptors>
            </local:XYZDataGrid>

ComboBox
---------
 
<telerik:RadComboBox EmptyText="Columns" ItemsSource="{Binding Columns, ElementName=dataGrid}" Text="Columns" Margin="750,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="100" Height="20" SelectionChanged="RadComboBox_SelectionChanged_1">
                <telerik:RadComboBox.ItemTemplate>                   
                    <DataTemplate>
                        <CheckBox Content="{Binding Header}"
                          IsChecked="{Binding IsVisible, Mode=TwoWay}" />
                    </DataTemplate>
                </telerik:RadComboBox.ItemTemplate>
            </telerik:RadComboBox>


Yana
Telerik team
 answered on 17 Apr 2014
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?