Telerik Forums
UI for WPF Forum
2 answers
471 views
i set two way binding then on ok is working fine,cancel is not
and if i set one way binding cancel is working fine ok button is not

i am calling expression editor on a button click dynamically that code is:
  Private Sub btnRiskFactorFormular_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        Dim window As New ExpressionEditorWindow()
        window.DataContext = DirectCast(sender, System.Windows.Controls.Button).DataContext
        Dim bindFormular As System.Windows.Data.Binding = New System.Windows.Data.Binding("ewrf_formula")
        ' bindFormular.Mode = BindingMode.OneWay
        window.ExpressionEditor.SetBinding(RadExpressionEditor.ExpressionTextProperty, bindFormular)
        Dim objRiskFactors As New WellnessIncentiveMethods
        Dim test As List(Of EERiskFactorFields) = objRiskFactors.fnGetRiskFactorNames()
        window.ExpressionEditor.Item = test(0)
        AddHandler window.Closed, AddressOf Me.OnExpressionWindowClosed
        window.ShowDialog()


    End Sub
Dimitrina
Telerik team
 answered on 18 Apr 2014
3 answers
137 views

I have created dynamic validation on scheme editing. But I encountered with few problems.
1) How to get active connection correctly? I use method described below:

01.private RadDiagramConnection GetActiveConnection()
02.{
03.    var toolService = ServiceLocator.GetService<IToolService>();
04.    if (toolService == null || toolService.ActiveTool == null) return null;
05. 
06.    var toolType = toolService.ActiveTool.GetType();
07.    var fieldInfo = toolType.GetField("activeConnection", BindingFlags.Instance | BindingFlags.NonPublic);
08.    if (fieldInfo == null) return null;
09.    return fieldInfo.GetValue(toolService.ActiveTool) as RadDiagramConnection;
10.}
2) Please, make tool interfaces from Telerik.Windows.Diagrams.Core public.
3) Please, make RadDiagramShapeBase.UpdateVisualStates() non internal.
Zarko
Telerik team
 answered on 18 Apr 2014
2 answers
171 views
Table across multiple pages,if you merge cells in the first page,table can adjust the row height(first.jpg),but if you merge cells in the second page,table can not(second.jpg).
hao
Top achievements
Rank 1
 answered on 18 Apr 2014
1 answer
1.3K+ views
Apologies in advance for what probably is a stupid question. I'm trying to style the GridView and having a difficult time with it. It seems like a lot of the documentation on the website is outdated. For example, this page shows a whole bunch of properties which I do not see in Blend when I follow the exact steps that it outlines.

To my question: I'm trying to override the default styles and it seems like you have to individually override the style for each component of the gridview, right? I'm currently trying to change the mouse over color. I have the following XAML in my App.xaml:

       <Style x:Key="RadGridViewRowStyle" TargetType="{x:Type telerik:GridViewRow}">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Background" Value="White"/>
            <Setter Property="BorderBrush" Value="#FFCBCBCB"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="AllowDrop" Value="True"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{StaticResource MouseOverBrush}"/>
                    <Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="Black"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{StaticResource SelectedRowBrush}"/>
                    <Setter Property="BorderThickness" Value="5"/>
                    <Setter Property="BorderBrush" Value="Black"/>
                </Trigger>
            </Style.Triggers>
        </Style>

The border changes (which are just for testing) show up, but the background color remains that of the out-of-the-box theme. Any help is appreciated.
Ivan Ivanov
Telerik team
 answered on 18 Apr 2014
1 answer
287 views
We are using Radgridview in our wpf application which is autogenerated using Class Models. When the number of columns are quite huge(more than 35-40 columns), the performance of the horizontal scrollbar is quite poor and even worst when the data on the Grid is huge. Infact the experience it gives while scrolling seems as if the scrollbar is continuously growing. I have tried the following settings on the RadGridView in the xaml but there is no significant improvement in the performance:

EnableColumnVirtualization="True" EnableRowVirtualization="True" VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" ScrollViewer.CanContentScroll="False" ScrollMode="Deferred"
Ivan Ivanov
Telerik team
 answered on 18 Apr 2014
6 answers
287 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
106 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
128 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
122 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
209 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
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?