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

I've been working hard, with the help of telerik support, trying to extend the features of RadDocument. Please find my latest code sample download link here.

It took me quite some time to learn and make these features so this should help speed things up for you.

I have mainly be building up a library of custom annotation features, but there are also other additions.

Here are my methods:
  • GetSelectedAnnotationsRangeStarts()
  • GetPreviousAnnotationRangeStart()
  • GetNextAnnotationRangeStart()
  • GetNextAnnotationRangeStartAtPosition()
  • GetSameLineNextAnnotationRangeStart()
  • GetPreviousSameLineAnnotationRangeStart()
  • IsCaretAtLineEnd()
  • IsCaretAtLineStart()
  • DeletedNonSelectedSpanTextAtCaret()
  • DeleteOnlySelectedAnnotations()
  • GetNextAnnotationMarker()
  • GetPreviousAnnotationMarker()
  • GetLastSelectedAnnotationMarker()
  • GetPreviousAnnotationMarkerEndAndStartRanges()
  • DeleteReadOnlyRanges()
  • ToggleHighlightReadOnlyRangesOn()
  • ToggleHighlightReadOnlyRangesOff()
  • MakeReadOnlyRangesEditable()
  • DeleteCurrentParagraph()
  • IsCaretOnFirstLineInParagraph()
  • IsPositionOnFirstLineInParagraph()

 

Feel free to let me know if you find any errors or more efficient ways to achieve the above.
Please upload your code if you extend the features of this code sample. Every little helps.

Rob

Robert
Top achievements
Rank 1
 answered on 21 Aug 2012
4 answers
130 views
Greetings,

   I have used rad datagrid and it is working fine. But I have basically 1 problems that I felt very hard to implement.

1.  Using Custom Layout like in the blog
http://blogs.telerik.com/blogs/posts/09-02-03/how_to_use_custom_row_layouts_in_radgridview_for_wpf.aspx
but to start with I have strange error like
The property 'ColumnName' was not found in type 'GridViewCell'.
so I could not start to edit the example in the blog.  Can we edit the Values of rows that is inside the Custom row layout and also save it to the database also? Can the Custom layout hold other edit templetes like Combobox or masked text box in columns like Sex where there are only two option like male or female or in Phone number. Saving the edit on database also should be on focus. Because
dataContext.SubmitChanges();
was working fine on other project but under exactly same condition it is not working now.

If you want to go through my project here is a link of it.
http://www.quickfilepost.com/download.do?get=2637bc0276d4b31e8d85d32823873e75
Vic
Top achievements
Rank 1
Iron
 answered on 21 Aug 2012
4 answers
131 views
Hi,

I'm using the RadMap to display KML data exported from Google Earth.  I've found that pushpins appear really large by default (about 64x64) and that it is the top left corner of the image that points to the location, and not the pin.  This looks ok when zoomed in, but it doesn't appear to point to the right location at all after you zoom out a little.

I'm loading in the elements using KmlReader.Read(Stream) and adding them to an InformationLayer.  Is this a known problem with either Google Earth or RadMap?

Thanks,

Kyle
Kyle
Top achievements
Rank 1
 answered on 21 Aug 2012
3 answers
157 views
Hi Team,
 I am using RadBook for showing the PDF files. But when I am loading big PDF file ,PDFFormateProvider throw Out of memory exception error.
Please help me to find out the solution.

Thanks,
MAndeep
Kammen
Telerik team
 answered on 21 Aug 2012
2 answers
83 views

Hi,

I've notcied that when I try to print a document but push the cancel button the document is still sent to the printer.
Has anyone else noticed this?

I'm using libraries 2012.2.725.40.

Here's my print method:

private void btnPrint_Click(object sender, RoutedEventArgs e)
{
this.radRichTextBox.Print("TAS2 Spec", PrintMode.Native);
}

Thanks for your time,

Rob

Vasil
Telerik team
 answered on 21 Aug 2012
1 answer
137 views
I am trying to apply the telerik metro theme to the WPF controls. While most controls looks OK, the PasswordBox somehow received a strange double border (see attached image). This issue seem to only affect the Metro Theme, other themes such as the Windows7 Theme looks ok.

<Window x:Class="RadControlsWpfApp3.InputsWindow"
        Title="InputsWindow" Height="400" Width="300">
    <Window.Resources>
 
        <telerik:MetroTheme x:Key="Theme" />
 
        <Style TargetType="ScrollViewer">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="TextBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="CheckBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="RadioButton">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="ListBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
        <Style TargetType="PasswordBox">
            <Setter Property="telerik:StyleManager.Theme" Value="{StaticResource Theme}" />
        </Style>
    </Window.Resources>
    <Grid>
        <StackPanel Margin="5">
            <Label Content="Username" />
            <TextBox />
            <Label Content="Password" />
            <PasswordBox />
            <Label Content="Gender" />
            <StackPanel Orientation="Horizontal">
                <RadioButton Content="Male" />
                <RadioButton Content="Female" />
            </StackPanel>
            <Label Content="list" />
            <ListBox>
                <ListBoxItem>test1</ListBoxItem>
                <ListBoxItem>test2</ListBoxItem>
                <ListBoxItem>test3</ListBoxItem>
            </ListBox>
            <CheckBox Content="Agree" />
            <Button Content="Submit" />
        </StackPanel>
    </Grid>
</Window>
Yoan
Telerik team
 answered on 21 Aug 2012
8 answers
131 views
Hi


Is it possible to apply and use transition effects when the selected pane in a pane group changes? How can this be done?

Tom Davies
Yana
Telerik team
 answered on 21 Aug 2012
1 answer
97 views
Hello,

In a RadPaneGroup with a RadGridView we are showing some detials of a SQL search. In the background is a ViewModel and one of the property contains the resultrecords as array. Each new search request will create a new array of records and through a binding it changes the ItemsSource property of RadGridView. 


new Version 2012.2.725.40: the focus will jump into the RadGridView when RadPaneGroup is floating
old Version 2012.1.215.40: its all ok, the Fosuce stay in e.g. TextBox

a SampleApp below

<Window x:Class="RadGridViewFocusStealing.MainWindow"
        xmlns:RadGridViewFocusStealing="clr-namespace:RadGridViewFocusStealing" Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="29" />
            <RowDefinition Height="259*" />
        </Grid.RowDefinitions>
        <Grid.DataContext>
            <RadGridViewFocusStealing:GridDataContextViewModel/>
        </Grid.DataContext>
        <TextBlock  Grid.Row="0" Text="Make the RadPaneGroup as floating. Select a record inside of the grid, than add some new records while typing in the TextBox below. You will see the focus will lost. If the RadPaneGroup is docked its all fine." TextWrapping="Wrap" />
        <telerik:RadWatermarkTextBox  Grid.Row="1" Text="{Binding Path=DoSomethingOnChange, UpdateSourceTrigger=Explicit}" KeyUp="TextBox_KeyUp" Margin="2" >
            <telerik:RadWatermarkTextBox.WatermarkContent>
                <TextBlock Text="Just type any text and press ↵ Enter to apply" Foreground="Gray"/>
            </telerik:RadWatermarkTextBox.WatermarkContent>
        </telerik:RadWatermarkTextBox>
        <telerik:RadDocking  Grid.Row="2">
            <telerik:RadDocking.Items>
                <telerik:RadSplitContainer x:Name="radSplitContainer" >
                    <telerik:RadSplitContainer.Items>
 
                        <telerik:RadPaneGroup >
                            <telerik:RadPaneGroup.Items>
                                <telerik:RadPane>
                                    <telerik:RadGridView
                                                 AutoGenerateColumns="False"
                                                 ItemsSource="{Binding Path=DataItems}" ShowGroupPanel="False">
                                        <telerik:RadGridView.Columns>
                                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Property1}"/>
                                        </telerik:RadGridView.Columns>
                                    </telerik:RadGridView>
                                </telerik:RadPane>
                            </telerik:RadPaneGroup.Items>
                        </telerik:RadPaneGroup>
 
                    </telerik:RadSplitContainer.Items>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.Items>
        </telerik:RadDocking>
    </Grid>
</Window>



using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Telerik.Windows.Controls.Docking;
 
namespace RadGridViewFocusStealing
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            radSplitContainer.InitialPosition = DockState.FloatingDockable;
        }
 
        private void TextBox_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter && e.KeyboardDevice.Modifiers == ModifierKeys.None)
            {
                var b = ((TextBox)sender).GetBindingExpression(TextBox.TextProperty);
                if (b != null)
                    b.UpdateSource();
            }
        }
    }
 
    public class GridDataContextViewModel : INotifyPropertyChanged
    {
        private IEnumerable<GridDataItem> _dataItems;
 
        public GridDataContextViewModel()
        {
            _dataItems = new GridDataItem[] { new GridDataItem() { Property1 = "Foo" }, new GridDataItem() { Property1 = "Baa" } };
        }
 
        private string _doSomethingOnChange;
 
        public string DoSomethingOnChange
        {
            get { return _doSomethingOnChange; }
            set
            {
                _doSomethingOnChange = value;
                OnNotifyPropertyChanged("DoSomethingOnChange");
 
                // As simulation, creating a new data array (e.g. a result of a SQLQuery as array) for GridView.ItemsSource
                DataItems = _dataItems.Union(new GridDataItem[] { new GridDataItem { Property1 = value } }).ToArray();
            }
        }
 
        public IEnumerable<GridDataItem> DataItems
        {
            get { return _dataItems; }
            private set
            {
                if (_dataItems != value)
                {
                    _dataItems = value;
                    OnNotifyPropertyChanged("DataItems");
                }
            }
        }
 
        private void OnNotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
    }
 
    public class GridDataItem
    {
        public string Property1 { get; set; }
    }
}


Ulrich
Top achievements
Rank 1
 answered on 21 Aug 2012
1 answer
107 views
All of a sudden I can't run any app with telerik WPF.  I upgraded to Q2 2012 and it crashed visual studio without completing.  Now I can't run existing projects or start new ones using WPF.  I tried uninstalling and reinstalling but no difference. 
Chavdar Dimitrov
Telerik team
 answered on 21 Aug 2012
0 answers
217 views
Hi,

in scheduleview I am do following:
- every time the visible range is changed I set the AppointmentsSource = null. After that I add some new Appointments (which fit into the visible range). After that I call UpdateLayout().

            scheduleView.BeginInit();
            scheduleView.AppointmentsSource = null;
            scheduleView.AppointmentsSource = observableAppointments;
            scheduleView.EndInit();
            scheduleView.UpdateLayout();

This is ok, when I click the back and forward buttons on schedule view. But when I change from Week View into Day View, I get an exception. I debugged schedule view and got the exception in AppointmentsPanel.cs in

private void UpdateMaxDesiredSize(GroupHeader header, bool isHorizontal)
        {
            header.Measure(infinity);

            int level = header.Level;
            Size desiredSize = header.DesiredSize;
            int adjustLevel = level - 1;

            double levelMaxDesiredLength = this.GetMaxDesiredLength(adjustLevel);

            double length;
            if (isHorizontal)
            {
                length = header.DesiredSize.Width - header.BorderThickness.Right;
            }
            else
            {
                length = header.DesiredSize.Height - header.BorderThickness.Bottom;
            }
            levelMaxDesiredLength = Math.Max(levelMaxDesiredLength, length);
            this.headerMaxLengthLevels[adjustLevel] = levelMaxDesiredLength;  Here headerMaxLengthLevels has zero entries.
        }


What's the reason for this?

Regards,
Ronald
Ronald
Top achievements
Rank 1
 asked on 21 Aug 2012
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?