Telerik Forums
UI for WPF Forum
1 answer
564 views
Hello,

Is there a way to get all the text from a RichTextBox without having to select all the text first and then call GetSelectedText() on the document selection?


PS: Also, is it possible to get parts of text without having to select it first? For example, if I want to get the text on a line, i currently do this:
// Get line text range.
startPosition.MoveToCurrentLineStart();
endPosition.MoveToCurrentLineEnd();
 
// Clear the previous selection.
richFolderList.Document.Selection.Clear();
// Select line text.
richFolderList.Document.Selection.AddSelectionStart(startPosition);
richFolderList.Document.Selection.AddSelectionEnd(endPosition);
 
var currentLine = richFolderList.Document.Selection.GetSelectedText();

Petya
Telerik team
 answered on 02 Oct 2012
2 answers
152 views
Hello,

is there any way to achieve WPF .NET 4 drag and drop between grids with different data, for example on the left grid (drag source) you have products and on the right grid (drop target) we have Orders, Orders has Name and Date plus collection of Products, Order
grid can be grouped with expand collapse by Products list (we can hide or show all Products within an Order), and finally we can drag Product from left grid to particular Order in the right grid?

Orders grid looks like this (it has expandable childtemplate with Products):
<telerikGrid:RadGridView x:Name="TelerikOrdersGrid" AutoGenerateColumns="False" ShowGroupPanel="False" Grid.Column="0">
           <telerikGrid:RadGridView.Columns>
               <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Name}" Width="100" />
           </telerikGrid:RadGridView.Columns>
           <telerikGrid:RadGridView.ChildTableDefinitions>
               <telerikGrid:GridViewTableDefinition />
           </telerikGrid:RadGridView.ChildTableDefinitions>
           <telerikGrid:RadGridView.HierarchyChildTemplate>
               <DataTemplate>
                   <telerikGrid:RadGridView x:Name="TelerikProductsGrid" telerikDragDrop:RadDragAndDropManager.AllowDrop="True" AutoGenerateColumns="False" ShowGroupPanel="False" ItemsSource="{Binding Products}">
                       <telerikGrid:RadGridView.Columns>
                           <telerikGrid:GridViewDataColumn DataMemberBinding="{Binding ProductName}" Width="100" />
                       </telerikGrid:RadGridView.Columns>
                   </telerikGrid:RadGridView>
               </DataTemplate>
           </telerikGrid:RadGridView.HierarchyChildTemplate>
       </telerikGrid:RadGridView>

How exactly I register RadDragAndDropManager.AddDropQueryHandler for TelerikDetailGrid?

When I try in code behind:

RadDragAndDropManager.AddDropQueryHandler(TelerikDetailGrid, RadGridView_OnDropQuery);


I have got error:

Error    1    The name 'TelerikDetailGrid' does not exist in the current context    C:\test\MainWindow.xaml.cs    35    55



In other words to add Product to Order by drag and drop? If possible by using multi-select - slecting one or more Product?

thank you

Valko
Top achievements
Rank 1
 answered on 01 Oct 2012
8 answers
884 views

The following XAML shows that I want to create ColumnGroups at run time same as like XAML code (which is following) based on business requirement which is not constant. How to do that in code behind I am unable to add. Please send me the code snippet.
=====================================================================================================

<Tele:RadGridView Name="RgvViewWorkforcePlan" GridLinesVisibility="Both" IsReadOnly="True" AutoGenerateColumns="False" VerticalAlignment="Stretch"
                              CanUserFreezeColumns="False" ShowGroupPanel="true" RowIndicatorVisibility="Collapsed" Width="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="auto"  ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="auto" SnapsToDevicePixels="False" VerticalContentAlignment="Top"
                              ItemsSource="{Binding TempGridData,Mode=OneWay}" CanUserResizeColumns="False"   SelectionMode="Single" SelectionUnit="FullRow" SelectedItem="{Binding SelectedGridItem,Mode=TwoWay}"
                              Background="#EAF3FC" >
                <!--It creates a column group in which we can merge column headers as needed-->
                <!--1st group Header for the 1st month -->
                    <Tele:RadGridView.ColumnGroups>
                        <Tele:GridViewColumnGroup Name="MonthName1"  >
                            <Tele:GridViewColumnGroup.HeaderTemplate>
                                <DataTemplate>
                                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#EAF3FC" Name="grdcolumnHeader1"  >
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="23"></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"></ColumnDefinition>
                                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                                        </Grid.ColumnDefinitions>
                                        <Label  Name="lblMonthName1"  Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalAlignment="Stretch"  Padding="0" Margin="0,2,0,0" FontWeight="DemiBold"
                                              Content="{Binding  Path=DataContext.MonthName1,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Tele:GridViewDataControl}}}" ></Label>
                                         <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="Auto" Name="sPanel1"
                                                     Visibility="{Binding Path=DataContext.SPanel1,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Tele:GridViewDataControl}}}">
                                            <Button Name="btnFirst" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&lt;&lt;"/>
                                            <Button Name="btnPrevious" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&lt;"/>
                                            <Button Name="btnNext" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&gt;" Click="btnNext_Click"/>
                                            <Button Name="btnLast" HorizontalAlignment="Center" VerticalAlignment="Center" Content="&gt;&gt;"/>
                                        </StackPanel>
                                    </Grid>
                                </DataTemplate>
                            </Tele:GridViewColumnGroup.HeaderTemplate>
                        </Tele:GridViewColumnGroup>
                         </Tele:RadGridView.ColumnGroups>

Thanks

Laxman.
Rosen Vladimirov
Telerik team
 answered on 01 Oct 2012
1 answer
160 views
Hi!
I already read this post about how to fix the blurry images problem using the UseLayoutRounding property. However it seems that this property is not available when using RadRichTextBoxRibbonUI.
Is this true? Anything I can do?
Petya
Telerik team
 answered on 01 Oct 2012
12 answers
1.0K+ views

Hello,
can anyone tell me where I can find a (very) simple example application with a RadGridView with select, insert, update and delete with the Entity Framework and maybe in an MVVM Environment.


Greetings Uwe
Rossen Hristov
Telerik team
 answered on 01 Oct 2012
5 answers
270 views
We are looking for the following customization -
1. Removing the toolbar but extending the functionalities through command binding to buttons elsewhere in the application.
2. Change the UI look of the scroll bar used for the viewer.
3. Touch support for zooming/panning.

How much the existing control supports the above customization? I have learnt that you provide source code. Will it be possible to do them ourselves by modifying the code?
Kammen
Telerik team
 answered on 01 Oct 2012
1 answer
172 views
Hi!
I have a richtextbox on which I set DocumentInheritsDefaultStyleSettings ="true" so that the font of the text is uniform with the rest of my application, unless the users changes it using the editor.
However I see that the bold and italics functionality (using ribbon) do not work when this flag is set to true.
Why is that? How can I fix this?
Underline, changing font family or size work fine.
Iva Toteva
Telerik team
 answered on 01 Oct 2012
3 answers
256 views
Hi,
is there a way to select a slot of ScheduleView on mouse double click instead of mouse right click?

How can i implement it?

Thanks,
Rob

Yana
Telerik team
 answered on 01 Oct 2012
5 answers
470 views
Hello,

I have a RadPieChart which not displaying the slices correctly when one slice is 100% and the other is 0%.  No color is being applied to the 100%. I am using a converter to color each slice a specific color but the converter is not getting called.

Note -- it works fine for all other variations of values.
<chart:RadPieChart Palette="{Binding Palette}" Height="{Binding Path=PieChartHeight}" Width="{Binding Path=PieChartWidth}"
                   >
     
    <chart:RadPieChart.Behaviors>
        <chartView:ChartTooltipBehavior Placement="Mouse"  HorizontalOffset="0" VerticalOffset="-1" />
    </chart:RadPieChart.Behaviors>
     
    <chart:RadPieChart.TooltipTemplate>
        <DataTemplate>
            <Grid>
                <Path Data="M-1236,-441 L-1180,-441 -1180,-424 -1228,-424 -1236,-424 z"
                  Stretch="Fill" Fill="White" Stroke="Gray" StrokeThickness="1" />
                <StackPanel Margin="4,3,4,9" >
                    <TextBlock Text="{Binding Value}"  FontFamily="Segoe UI" />
                </StackPanel>
            </Grid>
        </DataTemplate>                       
    </chart:RadPieChart.TooltipTemplate>
 
 
    <chartView:PieSeries ValueBinding="Value" ItemsSource="{Binding DataPoints}"
                         RadiusFactor="0.77"
                         >
 
        <chartView:PieSeries.LabelDefinitions>
            <chartView:ChartSeriesLabelDefinition Margin="-30,0,0,0" />
        </chartView:PieSeries.LabelDefinitions>
         
        <chartView:PieSeries.AngleRange>
            <charting:AngleRange StartAngle="10" SweepAngle="360" />
        </chartView:PieSeries.AngleRange>
         
        <chartView:PieSeries.SliceStyles>
             
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=0}"/>
            </Style>
 
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=1}"/>
            </Style>
 
            <Style TargetType="Path">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="Fill" Value="{Binding Converter={StaticResource pieChartSliceToColorConverter}, ConverterParameter=2}"/>
            </Style>
 
            
        </chartView:PieSeries.SliceStyles>
 
    </chartView:PieSeries>
 
</chart:RadPieChart>

Any help would be apprecieated.

Thanks,

Tracy Jenkins
Nikolay
Telerik team
 answered on 01 Oct 2012
0 answers
109 views
Hallo,

I got problems with the GridView performance.

I have a simple WPF Application with one GridView and one refresh button. The GridView has 4 columns and 100 rows. The ItemsSource of the GridView is an Observable Collection of the type RowViewModel. RowViewModel has 4 properties (1 DateTime and 3 strings). When I push the refresh button, the ItemsSource is cleared and filled again with different objects. On my machine thit takes about 800 to 1000 ms. Here is the XAML code:

<Grid>
    <telerik:RadGridView
        HorizontalAlignment="Left"
        Name="radGridView1"
        VerticalAlignment="Top"
       
Height="561" Width="546">
    </telerik:RadGridView>
    <telerik:RadButton Content="Refresh" Height="23" HorizontalAlignment="Left" Margin="646,152,0,0" Name="radButton1" VerticalAlignment="Top" Width="75" Click="radButton1_Click" />
</Grid>

And here is the code behind:

private const int RowCount = 100;
private int _counter = 0;
private readonly string[] _codes = new [] {"Code Blue", "Code Orange", "Code Yellow", "Code Cyan"};
 
public MainWindow()
{
    InitializeComponent();
 
    CreateRowViewModels();
}
 
public ObservableCollection<RowViewModel> Rows { get; set; }
 
private void CreateRowViewModels()
{
    if (Rows == null)
    {
        Rows = new ObservableCollection<RowViewModel>();
        radGridView1.ItemsSource = Rows;
    }
 
    DateTime d;
    string name;
 
    if (_counter % 2 == 0)
    {
        d = new DateTime(2012, 1, 1);
        name = "Mr. Black";
    }
    else
    {
        d = new DateTime(2012, 6, 1);
        name = "Mr. White";
    }
 
    Rows.Clear();
 
    for (var i = 0; i < RowCount; i++)
    {
        var row = new RowViewModel
        {
            Name = name + " " + (i + 1),
            Date = d,
            Code = _codes[i % 4],
            Error = ""
        };
        Rows.Add(row);
    }
 
    _counter++;
}
 
private void radButton1_Click(object sender, RoutedEventArgs e)
{
    CreateRowViewModels();
}

Nothing special here, why does it take about 1 second to refresh the ItemsSource collection?

Thank you for the help,

Eugen
Eugen Wiens
Top achievements
Rank 1
 asked on 30 Sep 2012
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?