Telerik Forums
UI for WPF Forum
3 answers
99 views
Hi,

We are using Telerik controls (2012.3.1129.40) and use theme support. Everything is working fine - user can select theme to use and appearance of application will change, but there are 2 scenarios that cause us headache.

Usecase 1:
I've changed style of control, for example FilteringControl of the RadGridView. In fact I needed small change in layout, so I changed template for the control, but because layout and appearance options in themes are mixed colors are redefined to. Using 'StyleManager.Theme="{x:Static StyleManager.ApplicationTheme}"' trick I can make some parts of the control to look consistent (buttons, listboxes) with other application parts, but there are things like backgroung/border colors defined in the template, that should be changed according to the theme. So from now on, whenever theme is changed FilteringControls look is inconsistent. I could redefine template for all other themes (just to change 3-5 color properties), but how can I specify which template should be used for which theme?

Usecase 2:
We have custom controls, that should match in theme with the rest of application. I accept to 'copy-paste' whole template for another theme just to change 2-3 color properties, but again how can I tell to theme manager which template should be used according to the selected theme?

Thank you


Vanya Pavlova
Telerik team
 answered on 12 Mar 2014
2 answers
137 views
Hi,

I have drawn a MapEllipseGeometry on the Map at 100 km radius. If I then calculate the distance between the centre and the edge I am getting a result of 100.95 km. (I am determining the edge point latitude and longitude by dragging a pin to the edge to get the 2nd )

I am using a method suggested in these forums to calculate the distance between the 2 points.

public static double DistanceBetween(double lat1, double lng1, double lat2, double lng2)
{
    Location northEast = new Location(Math.Max(lat1, lat2), Math.Max(lng1, lng2));
    Location southWest = new Location(Math.Min(lat1, lat2), Math.Min(lng1, lng2));            
    
    LocationRect rect = new LocationRect(northEast, southWest);           
   
    rect.MapControl = new RadMap();           
   
    double distance = Math.Sqrt(rect.Width * rect.Width + rect.Height * rect.Height);           
   
    return distance;
}

This is a about a 1% error, any ideas why this could be the case?

Thanks
Anthony
Anthony
Top achievements
Rank 1
Iron
Veteran
 answered on 12 Mar 2014
1 answer
64 views
Is there a way to change the RadDiagramConnection line to be a broken-dashed line ? Something like this ( -------> )

Brett
Top achievements
Rank 1
 answered on 12 Mar 2014
1 answer
155 views
I'm looking though the documentation trying to figure out how far the Nudge command moves an item in a diagram.  I'm also interested in how you can perform a Nudge command programmatically.  Any help would be appreciated, thanks.
Tina Stancheva
Telerik team
 answered on 11 Mar 2014
1 answer
177 views
I wanted to know is there a way to bind to the header checkbox IsChecked property of the GridViewSelectColumn. I want to add logic that if a selection is made in the grid, change the header checkbox to null.
Yoan
Telerik team
 answered on 11 Mar 2014
1 answer
146 views
We have a control where a user can select multiple rows in a RadGridView and we store the selected items. No problem. However, if the user later returns to the control and pops up the grid to select more items, the previous selections are not automatically selected already despite the synchronization code (from another post here - keeps the SelectedItems and another collection synchronized).

So how does one programmatically toggle the IsSelcted for the rows based on the SelectedItems property? When the grid is loaded, the SelectedItems is synchronized with the collection of objects already synchronized, but the GridViewSelectColumn does not display the checkbox as selected so it looks like nothing is selected even though the collection is populated with objects.

I read one post which suggested using a style trigger but that only works if the rows are visible. These grids can have hundreds or thousands of records.

Steve
Dimitrina
Telerik team
 answered on 11 Mar 2014
3 answers
91 views
Hi, I am trying to drag drop a text file on the
RadGridView cells and I am having some issues. What I am trying to accomplish
is; when I drop the textfile (or any type of file) on a GridCell or
GridHeaderCell , I am going to open another screen for user to enter more
information. That screen will have that file's physical file path and some more
information from the cell which it was dropped on. 

So, regular GridCell is working fine but when I
drop the file on the GridHeaderCell, it does not allow me unless I put a
breakpoint on OnDropQuery method. Without the breakpoint headercells are
not available to drop the file on.



OnDropQuery method is
in MainWindow.xaml.cs. I have a sample project prepared but couldnt attach
it to the thread.



Please let me know, if you need any additional
information. 



Thanks in advance...
Nick
Telerik team
 answered on 11 Mar 2014
4 answers
101 views
Hi,

    After I upgraded to version 2013.3.1204.45, I am no longer able to drag and drop external files to the GridView on my XBAP application.

   Before the upgraded, I used the "RadDragAndDropManager.EnableNativeDrag = True " to allow drag and drop to my XBAP application and it worked very well. 

   With this new DragAndDropManager, what is the setting I have to set so I can have the drag and drop from extenernal program?
    
Thanks,
Chris
Yoan
Telerik team
 answered on 11 Mar 2014
1 answer
126 views
Then I click on a MaskedTextInput, it's all selected and in insert mode, so if I have '8888' in the value and press 1, everything is replaced by 1.

When I set the focus on the code behind, I press '1' and get '1888' then when I press 1 again I get '11888' .  It's very strange behavior.

I have some sample code below.  When you press the button I programmatically set the focus on the RadMaskedTextInput.  Compare this to when you selected it with a mouse, or tab to it:

<Window x:Class="FocusOnTextBox6.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.Resources>
            <Style x:Key="UpperCodes6Mask" TargetType="telerik:RadMaskedTextInput">
                <Setter Property="FontFamily" Value="Segoe UI" />
                <Setter Property="Margin" Value="0 0 0 0" />
                <Setter Property="Width" Value="60" />
                <Setter Property="Height" Value="20" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="Placeholder" Value=" " />
                <Setter Property="IsClearButtonVisible" Value="False" />
                <Setter Property="TextMode" Value="PlainText" />
                <Setter Property="SectionsNavigationMode" Value="None" />
                <Setter Property="IsLastPositionEditable" Value="False" />
                <Setter Property="InputBehavior" Value="Insert" />
                <Setter Property="SelectionOnFocus" Value="SelectAll" />
                <Setter Property="Mask" Value=">a6" />
            </Style>
        </Grid.Resources>
        <StackPanel Orientation="Horizontal">
            <telerik:RadMaskedTextInput Margin="3 0 0 0" Height="20" Padding="0"  Style="{StaticResource UpperCodes6Mask}"
                    Name="tbClid" />
 
            <TextBox Name="tbTest" Margin="10 0 0 0" Height="25"  Width="50"/>
            <Button Name="btnTest" Margin="20 0 0 0" Content="Test Focus" Height="25" Width="100" Click="btnTest_Click" />
 
            <Button Name="btnTestRegular" Margin="20 0 0 0" Content="Test Focus TextBox" Height="25" Width="100" Click="btnTestRegular_Click" />
 
        </StackPanel>
    </Grid>
</Window>


namespace FocusOnTextBox6
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            tbClid.Value = "8888";
            tbClid.Focus();
 
        }
 
        private void btnTestRegular_Click(object sender, RoutedEventArgs e)
        {
 
            tbTest.Text = "9999";
  
            tbTest.Focus();
            tbTest.SelectAll();
        }
    }
}

Peshito
Telerik team
 answered on 11 Mar 2014
1 answer
55 views
Hello,
when a column is defined as right aligned, and it is sorted, the sort indication is inside the header text in the Office2013 theme, as you can see in the attached screenshot.
Note that the same problem appears when the column is not large enough to display the header text completely.
Patrick
Yoan
Telerik team
 answered on 11 Mar 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?