Telerik Forums
UI for WPF Forum
0 answers
376 views

Hi,

I have many RadGridView columns with binding to a Double number with StringFormat: 0:N3.

I configured the grouping header text to show the value and the number of elements (Aggregate Function).

For example:

Frequency Column with the following rows:

123.123

123.123

The group header will be:

Frequency: 123.123 (2)

The problem is with larger numbers  For example:

123.1234

123.1235

On the cell, the user will see:

123.123

123.123

On the grouping headers, the user will see two groups:

Frequency: 123.123 (1)

Frequency: 123.123 (1)

On filtering, if the user selects equal to 123.123, the grid will display 0 rows.

Even if I update the Header Text to show N4 only when having 4 no zero decimals (using a converter), the filtering will not work as the user expects

I think that the easiest solution is to configure the grouping and filtering to apply the logic on the displayed value, how can I do that? (the display value is a string but the filtering operators shall be for number, it is an issue?)

Maybe another option is to write a custom filter/grouping where I can implement the operator logic on Math.Round 3 and then use it on the xaml?

I can't imagine any other simple solution but I am sure that you can :)

Please, I need a simpme solution that I can apply on the xaml styles to the whole application. I am not working with code behind at all to avoid copiying logic everywhere.

 

alex
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 16 Sep 2023
0 answers
332 views

Hello,

I have a NumericUpDown with the following configuration:

1. NumberDecimalDigits=3

2. Binding to Double property in ViewModel

3. Validation (IDataErrorInfo) between 20-3000.

4. Small change 0.001

5. Big change 0.1

When I write 123.1234, I can see 123.123 in the UI but in the view model, you don't remove the additional digits.

I have the following problems:

1. Sometimes when using arrows up/down or page up/down, the 4 digit is removed. I expected that the snall/large change takes effect without removing any digits because the NumberDecimalDigits shall affect the UI.

2. On grouping/filtering, I want to apply the logic on the UI value instead of the binding value.

For 1234.1234 and 1234.1235 will be created two different groups.

In case that I have a double with 4 digits, but in the UI is configured to N3, I don't want to see two groups with same value in the Header Text. The user will not understand why there are two groups.

How can I configure the RadNumericUpDown to show 3 digits but if there is an error and the number has 4 digits to show 4 digits? (with this solution the user will understand why there is an error if he types 19.9996.

For this value, it will be round 20.000 and mark as error when minimim value 20 is allowed. Showing 4 digits will solve it.

How can I configure the Grouping and Filtering of the RadGridView to consider some double value as N3?

alex
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 16 Sep 2023
1 answer
255 views

Our organization has an app that we're porting from .NET/WPF to React. We have several grids, that utilize this:

```

using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using Telerik.WinControls;
using System.Configuration;
using System.Data.SqlClient;
using Telerik.WinControls.UI;
using Telerik.WinControls.Data;
using System.Data.OleDb;
using System.Linq;
using System.Threading.Tasks;
using System.Web.UI.WebControls;

using System.ComponentModel;

```

Instead, I'd like to use KendoReact.

Before I rewrite the entire thing in NextJS/KendoReact, are there some tools and techniques that I could use to save time?

Martin Ivanov
Telerik team
 answered on 15 Sep 2023
1 answer
230 views

Hi Telerik support,

I have two questions about the gridview checkbox column for WPF, see the sample application.

Just like in WinForms Telerik gridview with .EndEdit,  I want to end the edit and push the value to the viewmodel and have no more edit mode or editor active in the UI. Is there a way to achieve this behaviour?

The other question, when trying to set the EditTriggers in a style (with the intent to implicitly target every GridViewCheckBoxColumn) it straight up ignores it but it works when setting the EditTriggers in the column (see sample). Is this intended?

 

Kind regards,

Querijn

Dimitar
Telerik team
 answered on 14 Sep 2023
1 answer
216 views

I have downloaded the Telerik provided example Telerik xaml-sdk\DataServiceDataSource to investigate using the Telerik RadGridView and its pagination behaviors against an OData webservice. For the most part this is working as I expected however I have one other requirement.

I have provided a screenshot of some functionality that allows a user to build their own custom subset of the information displayed by moving rows from the original source to another separate list however when a record is removed from the DataServiceSource the pagination is disabled as it detects that a change is present.

I need the DataServiceSource to be bound to the grid so that the filtering and paging works against the OData API as intended but this precludes me from getting the list building to work.

Is there a way we can disable this internal change tracking or is there some other components we could use?

 

Martin Ivanov
Telerik team
 answered on 13 Sep 2023
1 answer
186 views

Hello. 

I am using custom field extends on CodeBasedField. This field fetch some data form database or prompt window on request. Sometimes its simple string, some time its rft string. I face with problem on handling rft strings. Here is how its looks like in "Code" mode:

Here is how I handle result value of field:

protected override DocumentFragment GetResultFragment()
    {
        var text = "";
        /* 
        text = fetch string handle here
        */
        if (!text.StartsWith(@"{\rtf"))
        {
            var document = new RtfFormatProvider().Import(text);
            return new DocumentFragment(document);
        }
        return CreateFragmentFromText(text);
    }

And if 'text' is rtf the "Result" mode is this:

You can see that extra line breaking there.

I am sure that my rtf have no extra line breaking or paragraphs. As well as "SpacingAfter" parameter for paragraph is 0.

The reason of it is how code handle Paragraphs.

Here is some code from Telerik lib:

How fragment created from document:

How Fragment inserted in RadDocument:

The code inserts "line break" after Paragraph if its single in fragment and if "IsLastParagraphClosed" is true. I cant change value of "IsLastParagraphClosed" because its setter is internal. 

Same problem if my rtf has more then one Paragraph. In that case it use another flow in InsertFragmentInternal method but the result is same - extra line breaking after Field.

 

I found workaround to skip this line breaking, create fragment not from RadDocument but from Selection:

protected override DocumentFragment GetResultFragment()
    {
        var text = "";
        /* 
        text = fetch string handle here
        */
        if (!text.StartsWith(@"{\rtf"))
        {
            var document = new RtfFormatProvider().Import(text);
            document.Selection.SelectAll();
            return new DocumentFragment(document.Selection);
        }
        return CreateFragmentFromText(text);
    }

But in this case its not reproduce full text formatting (e.g. TextAlingment) for my rtf.

Please help me to find proper workaround or fix this issue.

Dimitar
Telerik team
 answered on 11 Sep 2023
1 answer
130 views

 radTabControl.SelectedItem = radTabItem;     // set tab as the active one
 radTabItem.Content = userControl;  

The code above runs but the contents of the previous RadTabItem remain on srceen.

The tab and visual indicator showing what tab the user is on show but all the contents are those that belong to the previous tab.
Is there a refresh command that I'm missing?

 

Dinko
Telerik team
 answered on 08 Sep 2023
0 answers
112 views

Sometimes when I paste a test intro en empty RadMaskedTextInput, the application crushes and the following error occurs:

 

FATAL Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

                at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteNoMask(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedTextInput.HandlePasteOverride(Object value, Object& returnString)

   at Telerik.Windows.Controls.RadMaskedInputBase.HandlePaste()

   at Telerik.Windows.Controls.RadMaskedInputBase.OnApplicationPaste(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)

   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)

   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)

   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)

   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)

   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)

   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   at System.Windows.Input.InputManager.ProcessStagingArea()

   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)

   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)

   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)

   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


1 answer
146 views

Hi, 

I am using the RadSpreadsheet user control in WPF.

I am using 2 instances of this control in 2 different windows, with the same underlying Workbook such that modifications to the workbook in one control should be propagated to the other one. The idea is that one control offers a small preview of the workbook, while the second one is used in a separate window with extra-ribbon, formula bar... for more confortable editing (i.e enlarged view).

The problem is that changes from one spreadsheet control are not automatically reflected in the other "untouched" spreadsheet control. Changes are only reflected once I play with the display of the "untouched" spreadsheet control, such as changing the zoom level (via the status bar control) or clicking to change the current active sheet back and forth.

I was wondering if there is a function to force refreshing the radspreadsheet control so the display matches the underlying workbook.

I dont need to have the changes being reflected in real time, it would be enough to use such function to refresh the control used for preview once the larger window with the second control is closing.

Thanks

Laurent
Top achievements
Rank 1
Iron
 answered on 07 Sep 2023
0 answers
184 views

I am trying to apply the same `Margin` style to a lot of `RadWatermarkTextBox` controls by defining the `Margin` as a Style resource:

<Window.Resources>
    <Style TargetType="{x:Type telerik:RadWatermarkTextBox}">
        <Setter Property="Margin">
            <Setter.Value>
                <Thickness Bottom="{x:Static controls:Measurements.UnrelatedDistance}" />
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources>

Using the Style above makes the control look different compared to explicitly setting the `Margin` property for each control like below:

<telerik:RadWatermarkTextBox Text="Hello world">
    <telerik:RadWatermarkTextBox.Margin>
        <Thickness Bottom="{x:Static controls:Measurements.UnrelatedDistance}" />
    </telerik:RadWatermarkTextBox.Margin>
</telerik:RadWatermarkTextBox>

I am wondering what's the reason for this difference and how to use a Style resource to the make the control look like the way it does when explicitly setting the `Margin` property within the control.

Thank you.

Wizard6650
Top achievements
Rank 1
Iron
Iron
 asked on 05 Sep 2023
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?