Telerik Forums
UI for WPF Forum
0 answers
53 views

Hello

I have a gridview with text search activated.

How could i limit the number of characters that can be entered in TextSearch?

 

<telerik:RadGridView Name="rgvExplorador"                                         
                      GridLinesVisibility="Both"                                            
                      GroupPanelBackground="LightGray"
                      GroupPanelForeground="Black"                                
                      ShowSearchPanel="True"
                      ShowGroupPanel="False"                                     
                      d:LayoutOverrides="Height"
                      Grid.Row="1"
                      FontSize="10.667"
                      CanUserResizeColumns="False"
                      CanUserFreezeColumns="False"
                      AutoGenerateColumns="False"
                      SelectionMode="Single"
                      ItemsSource="{Binding}"
                      RowIndicatorVisibility="Collapsed"
                      GroupRenderMode="Flat"
                      GroupRowIsExpandedChanged="rgvExplorador_GroupRowIsExpandedChanged">
alejandro
Top achievements
Rank 1
 asked on 06 Sep 2018
5 answers
348 views
Is there a working sample WPF project that uses the Fluent Theme for our reference? We are having some difficulties integrating the theme into our application.
Martin Ivanov
Telerik team
 answered on 06 Sep 2018
1 answer
513 views

Hello there,

 

This topic isn't a question or looking for help, I just wanted to share my experience with one thing that costed me weeks of work and could've been avoided easly. 

 

So, in my WPF application I have 1 quite big page - 12k+ lines of code behind + xaml. Having so big class in application causes, ofc, problems, but what I've had to deal with was memory leaks. Page, mentioned above, is an Order page, consists many elements and data, but what is important is 1 RadGridView - Order Lines GridView. Now, my client expects application to have various styles and colors, so I have few CellStyleSelectors and 1, simple, RowStyle:

 

<Style TargetType="telerik:GridViewRow"
       x:Key="NormalStyle"
       BasedOn="{StaticResource GridViewRowStyle}">
    <Setter Property="Background"
            Value="{Binding Color}" />
    <Setter Property="Foreground"
            Value="Black" />
 
    <Setter Property="BorderThickness"
            Value="0 0 1 0" />
</Style>

 

It is used to get desired background color from database and set it to row. And here is where my problems have started.

If you don't set such style, color will be, naturally, bound to current application style (default - Office Black), but what will happen, when you declare, that you will provide hex color code and you don't?

I've had some misscomunication problems with my database dev, he had no idea, that he must to provide something in Color column (20-30% of returned rows were Null) and I wasn't aware of that. 

And it is a HUGE problem problem for application. Now, I want to share some of my experiences with that:

  • Rendering time:

    Before I've realized that this is a problem, I've tested some scenarios. My approach was to remove everything unnecessary from Order page, which lead me to have only my RadGridView. I've done some testing for 330 records, and rendering time was around 1 minute (54s - 74s). 

  • Virtualization solution:

    It is said in Telerik documentation, that Grid Virtualization is turned on and should be never turned off. Well, for this specific problem, turning it off increased first render of Page by 300%, but ALLOWED user to scroll through RadGridView. It was nearly impossible (in rational time) to scroll grid down from first item, to the last item. It is because every new visual element (row) needs to be rendered, and for this case, app was searching for correct color to set (unexpectly, it is very long process). 

  • Deferred Searching

    Here is the issue simillar to virtualization problem - with

    OrderLinesGrid.IsSearchingDeferred = false;

    set, it was nearly impossible to filter Order Lines Grid, using built-in search panel. 

  • Check box column issues

    The first place I've found problematic in the matter of performance, was mine checkbox column defined as below:

    <telerik:GridViewDataColumn.CellTemplate>
                               <DataTemplate>
                                   <CheckBox IsChecked="{Binding CzyMagWyprz, Mode=TwoWay}"
                                             HorizontalAlignment="Center"
                                             Checked="ToggleButton_OnChecked"
                                             Unchecked="ToggleButton_OnChecked" />
                               </DataTemplate>
                           </telerik:GridViewDataColumn.CellTemplate>
    Maybe I've implemented it somehow wrong, but such checkbox column causes increased render times for page, with and without virtualization. 


Lets compare above 4 points with current state of my application (after fixing problem - correclty returning color):

  • Rendering time:
    For 330 positions and virtualization turned OFF, opening new page is ~ 30.98 s long. The same page with virtualization turned ON opens in... ~ 2,35 s
  • Virtualization solution:
    Well, scrolling through 330 rows with some styling is a little too slow. I mean, it is not completly fluent (with virtualization turned on), but well, opening time makes it negligible.
  • Deferred searching:
    I let end user to choose if he want to use Deffered Searching, because it is not so fluent and fast, but still, it's speed now is comparable to gridview without row virtualization
  • Checkbox column:
    I've removed it. Here is some of my page opening measurements:


    With checkbox:
    1. 4.46 s
    2. 4.59 s
    3. 4.60 s
    4. 4.60 s
    5. 5.76 s
     
    ~ 4.80 s
     
    Without checkbox:
    1. 4.46 s
    2. 3.35 s
    3. 4.91 s
    4. 4.34 s
    5. 3.49 s
     
    ~ 4.11 s

    and it is not about those 0.7 s, it is more about scrolling and working on gridview. Removing custom checkbox column, makes impression of completly fluent work on it. What is interesting, regular checkbox column defined as 

    <telerik:GridViewSelectColumn Name="CheckBoxColumn"
                                                     EditTriggers="CellClick"
                                                     
                                                     >
     
                       </telerik:GridViewSelectColumn>

    doesn't really affect fluency or time but custom one does.

 

As a conclusion, I wanted to point out that XAML really doesn't like null data, when you declare that you will provide not-null data. Remember to be really carefull about it. 

 

Best regards, 

Mateusz

Dilyan Traykov
Telerik team
 answered on 05 Sep 2018
3 answers
94 views

Hello, I have a big problem with the RadTreeListView,when I set the ValidatesOnDataErrors to InViewMode. When there is error on the cell I only see the error indicator in the top right corner when I click the cell but if I lost focus on the cell then the error indicator in the corner disappear.

Svetoslav
Top achievements
Rank 1
 answered on 05 Sep 2018
7 answers
416 views
Hi,

Could you tell me how to stop the Carousel paging when I am holding down the left mouse button and moving my mouse cursor over the bottom of the control please?

Thanks,

Adam Smith
Elena
Telerik team
 answered on 05 Sep 2018
2 answers
202 views
Hi,

i have o problem whit the conversion of the content of a RadGridView in a RadDocument.

Inside of the RadGridView i have 5 columns with different width.
But the columns inside the RadDocument have all  the same width.

My source code worked correctly whith the Telerik-Controls version 2014.3.1202.45.
The columns inside the RadDocument inherit the widths from the columns inside the RadGridView.

But after the update to the version 2018.1.220.45 it does not work correctly anymore.
The columns inside the RadDocument have all the same width.

Please, can you help me to find a solution?


Best Regards,
Vincent Dinculescu


Here my source code:

XAML of  the RadGrisView:

    . . . . . .
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn x:Name="vg_letztaend" Header="Datum"
Width="120"
DataMemberBinding="{Binding VgLetztaend}"
IsReadOnly="True"
                                                        TabStopMode="Skip"
IsFilterable="False"
IsSortable="True" />
                    <telerik:GridViewDataColumn x:Name="vg_betreff" Header="Betreff"
 Width="270"
DataMemberBinding="{Binding VgBetreff}"
IsReadOnly="True"  
                                                        TabStopMode="Stop"
IsFilterable="False"
IsSortable="True"
TextWrapping="Wrap" />
                    <telerik:GridViewDataColumn x:Name="vg_text" Header="Text"
Width="300"
DataMemberBinding="{Binding VgText}"
IsReadOnly="True"  
                                                        TabStopMode="Stop"  
TextWrapping="Wrap"  
IsFilterable="False"
IsSortable="True" />
                    <telerik:GridViewDataColumn x:Name="bearbeiterName" Header="Bearbeiter"
Width="140"
DataMemberBinding="{Binding BearbeiterName}"
IsReadOnly="True"
                                                        TabStopMode="Skip"
IsFilterable="False"
IsSortable="True" />
                    <telerik:GridViewDataColumn x:Name="vg_bearbeiter" Header="Kennung"
Width="80"
DataMemberBinding="{Binding VgBearbeiter}"
IsReadOnly="True"
                                                        TabStopMode="Skip"
 IsFilterable="False"
IsSortable="True" />
                </telerik:RadGridView.Columns>
    . . . . . .


Source code for the conversion from a RadGridView in a RadDocument:

        public static void PrintPreview(this RadGridView grid)
        {
            Window owner = grid.GetVisualParent<Window>();
            var rtb = CreateRadRichTextBox(grid);
            PrintCommand = new DelegateCommand<object[]>(PrintData, CanExecutePrintCommand);
            ExitCommand = new DelegateCommand<object>(Exit, CanExecuteExitCommand);
            var window = CreatePreviewWindow(rtb, owner, settings);
            window.ShowDialog();
        }

        private static RadRichTextBox CreateRadRichTextBox(RadGridView grid)
        {
            return new RadRichTextBox
            {
                IsReadOnly = true,
                LayoutMode = DocumentLayoutMode.Paged,
                IsSelectionEnabled = false,
                IsSpellCheckingEnabled = false,
                Document = CreateDocument(grid),
                Padding = new Thickness(15, 10, 10, 10),
                DocumentInheritsDefaultStyleSettings = true,
                FontFamily = new FontFamily("Arial"),
                FontSize = 12,
            };
        }

        private static RadDocument CreateDocument(RadGridView grid)
        {
            RadDocument document;

            using (var stream = new MemoryStream())
            {
                grid.Export(stream,
                new GridViewExportOptions
                {
                    Format = ExportFormat.Html,
                    ShowColumnFooters = grid.ShowColumnFooters,
                    ShowColumnHeaders = grid.ShowColumnHeaders,
                    ShowGroupFooters = grid.ShowGroupFooters
                });


                stream.Position = 0;

                HtmlFormatProvider provider = new HtmlFormatProvider();
                provider.ImportSettings = new HtmlImportSettings();
                provider.ImportSettings.UseDefaultStylesheetForFontProperties = false;

                document = provider.Import(stream);
                document.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding(30);
                document.SectionDefaultPageOrientation = PageOrientation.Landscape;

            }

            return document;
        }





Vincent
Top achievements
Rank 1
 answered on 05 Sep 2018
1 answer
102 views
Good day, I have this autocompletebox on my context menu, but after searching, I couldn't to get any SelectedItem, any idea to do it ?
Jerry
Top achievements
Rank 1
 answered on 05 Sep 2018
1 answer
225 views

How to change the Tooltip width in appointment and make text not wrapping?

Thanks,

-Jacky

 

Vladimir Stoyanov
Telerik team
 answered on 04 Sep 2018
2 answers
79 views

Hello Telerik,

I am getting following exception message: "the calling thread cannot access this object because a different thread owns it".

I have RadDesktopAlertManager inside a separate thread and this error shows up only when DesktopAlert closes itself.

Any idea how to solve it?

Best regards

kourosh

Martin Ivanov
Telerik team
 answered on 04 Sep 2018
7 answers
667 views

My diagram shape have  DropShadowEffect  which is setted by style 

<Style x:Key="SquidShapeStyle"
           TargetType="telerik:RadDiagramShape">     
        <Setter Property="IsResizingEnabled"
                Value="True" />
        <Setter Property="IsManipulationAdornerVisible"
                Value="True" />
  <Setter Property="Focusable"
                Value="True" />
        <Setter Property="MinHeight"
                Value="60" />
        <Setter Property="MinWidth"
                Value="60" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />   
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect Color="#595757"
                                  Opacity="0.6"></DropShadowEffect>
            </Setter.Value>
        </Setter>
    </Style>

When operate as follows

1 select several shapes 2 Zoom in the selection bound , 3 unselect the shapes,

sometimes some shape's  DropShadowEffect  is not display,it seems the DropShadowEffect  is covered by the shape

what is the reason for this? thanks

 

 

 

 

 

 

Martin Ivanov
Telerik team
 answered on 03 Sep 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?