Telerik Forums
UI for WPF Forum
8 answers
1.9K+ views
How can I apply a data-driven style to show a strikethrough (or strikeout) style to an entire row?

Depending on a column value, I can succesfully apply font styling such as italic and colour (both font styles) but how to do strikethrough which is a text decoration?
Dilyan Traykov
Telerik team
 answered on 23 May 2017
3 answers
180 views

I have a grid bound to a list of a view model class I will call "A". Class A implements INotifyDataErrorInfo. As each property of A is set, the value of the changed property is validated, the set of errors is updated, and the ErrorChanged event is fired for that property--this is a pretty typical class that implements INotifyDataErrorInfo.

When the user clicks the New Item Row, I set some initial property values in the AddingNewDataItem event. Then when the new data row displays before the user has begun to type in the first field, a few fields are already highlighted with errors. After adding some logging, I found that the data grid is making a copy of the object I create in the AddingNewDataItem handler. Each property in this copy is set which causes validation to fire off, and some fields show errors when initially shown to the user. I don't want this. I only want to show errors after the user edits the field or attempts to commit a row with errors.

I also noticed the grid control calls HasErrors() on the original source object made in the event handler, not the copy it makes, which seems odd to me.

Is this the expected behavior? I want to display a newly inserted row with no errors and some custom initial values, but that copy the grid makes sorta ruins the process. How do I work around this?

Below is my log. It begins with the hash code of the ViewModel

// NOTE: All this occurs on insert, no user edits
// These first validation calls are in the AddingNewDataItem event when I initialize some properties.
57073170: ValidateProperty JobId, 0 errors.
57073170: ValidateProperty Quantity, 0 errors.
57073170: ValidateProperty State, 0 errors.
57073170: ValidateProperty Part, 0 errors.
57073170: ValidateProperty PartId, 1 errors.
57073170: ClearErrors() //clear errors so that the fields don't indicate errors until the user sets them or the row is validated
// Done with AddingNewDataItem event handler in my code
 
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: GetErrors(State) returned empty list
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: GetErrors(State) returned empty list
57073170: GetErrors(PartNumber) returned empty list
57073170: GetErrors(Quantity) returned empty list
57073170: GetErrors(Length) returned empty list
57073170: GetErrors(ComponentType) returned empty list
57073170: GetErrors(Label) returned empty list
57073170: GetErrors(ElevationId) returned empty list
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
 
//NOTE: looks like new object is now created by RadGridView after this point?
13218022: ValidateProperty PartId, 1 errors.
13218022: ValidateProperty PartNumber, 0 errors.
13218022: ValidateProperty Description, 0 errors.
13218022: ValidateProperty Quantity, 0 errors.
13218022: ValidateProperty ComponentType, 0 errors.
13218022: ValidateProperty Label, 1 errors. // This error shows in the UI clicking Add Item Row
13218022: ValidateProperty ElevationId, 1 errors. // This error shows in the UI after clicking Add Item Row
13218022: ValidateProperty JobId, 0 errors.
13218022: ValidateProperty KeepAlways, 0 errors.
13218022: ValidateProperty Length, 0 errors.
13218022: ValidateProperty Part, 0 errors.
13218022: ValidateProperty PartId, 1 errors.
13218022: ValidateProperty Id, 0 errors.
13218022: ValidateProperty State, 0 errors.
 
// HasErrors is called on the original and not the new object...
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: GetErrors(PartNumber) returned empty list
57073170: HasErrors() returned False
57073170: HasErrors() returned False
57073170: GetErrors(PartNumber) returned empty list
57073170: GetErrors(PartNumber) returned empty list
57073170: GetErrors(PartNumber) returned empty list

 

Stefan
Telerik team
 answered on 23 May 2017
5 answers
949 views
An input control will 'dim' it's background color when IsReadOnly is set to true. This, unfortunately, have the undesired side effect of turning some lighter colors gray. Is there a means of setting the 'read-only' background color without it being altered by the control when the control is read only?
Dinko | Tech Support Engineer
Telerik team
 answered on 23 May 2017
1 answer
239 views
Hi,

I would like to know if i will receive the full sources for all exemples (specially TableShape Diagram demo) if i buy telerik's WPF component ?

Thanks for your answer ?



Nicolas
Martin Ivanov
Telerik team
 answered on 23 May 2017
1 answer
97 views

Hi,

On Release R1.2017 you said that the search panel was added on Treelist for Green and Office2016 themes.

Search panel is present in the template for Green and Office2016 themes.

 

I couldn't find it on OfficeBlack theme. Is it not implemented yet?

 

Thank you

Dilyan Traykov
Telerik team
 answered on 23 May 2017
18 answers
380 views
Hi there,

Since the (very) recent release of Office 2013, will Telerik be rolling out an Office 2013 theme for WPF Controls?

What would be the timeline?

Thanks in advance.

Pieter
Ibrahim
Top achievements
Rank 1
 answered on 22 May 2017
4 answers
380 views

Hi all,

     I am a new in WPF. And, I haven't found the answer after searching the forum.

How can I find the child windows because only get WpfApplication.MainWindow and WpfApplication.Windows.Count=1 sometimes?

Then, I try to call  some refresh  or update functions as follows

wpfApplication.MainWindow.VisualTree.Refresh();

wpfApplication.MainWindow.VisualTree.Root.Refresh();

wpfApplication.MainWindow.UpdateInterHostLinks();                

wpfApplication.MainWindow.ContentWindow.RefreshChildren();              

wpfApplication.MainWindow.RefreshVisualTrees();              

wpfApplication.MainWindow.ContentWindow.Update();            

wpfApplication.MainWindow.Find.RefreshRoot();

However, it doesn't work. How can I get the child window every time? Many thanks
yu
Top achievements
Rank 1
 answered on 22 May 2017
2 answers
115 views

Hi There,

I have problem with Auto sorting and filtering.

The situation is,

When I copy and paste the data to grid. 

the data is automatically sorted (or filtered) with other data that was already sorting or filtering.

I'd like the grid does not sort (or filter) the data that was copied and pasted.

 

do you have any solutions?

Please answer it.

 

Thank you!

Martin Ivanov
Telerik team
 answered on 22 May 2017
1 answer
171 views

Hi,

I notice that on grid with ColumnSelctionButton the loading background is not expaded at 100%, as shown on the attachment, and the external area is active.

There is a way to expand the loading at 100%

 

Thank you

Dilyan Traykov
Telerik team
 answered on 22 May 2017
2 answers
279 views

Hello,

I try to customize Label for Cartesian grid line annotation.
In the context of ChartAnnotationsProvider the ChartAnnotationLabelDefinition  seams ignored...

For instance, neither the label is red, neither the offsets are applied.

<telerik:RadCartesianChart  x:Name="Chart">
             <telerik:RadCartesianChart.HorizontalAxis>
               <telerik:LinearAxis  Minimum="{Binding MinX}" Maximum="{Binding MaxX}" TickOrigin="0" x:Name="HorizAxis"/>
           </telerik:RadCartesianChart.HorizontalAxis>
           <telerik:RadCartesianChart.VerticalAxis >
               <telerik:LinearAxis Minimum="{Binding MinY}" Maximum="{Binding MaxY}" LabelFormat="n1" />
           </telerik:RadCartesianChart.VerticalAxis>
                           <telerik:RadCartesianChart.Series>
               <!-- ... -->
           </telerik:RadCartesianChart.Series>
           <telerik:RadCartesianChart.AnnotationsProvider>
               <telerik:ChartAnnotationsProvider Source="{Binding ListeAnnotations}">
                   <telerik:ChartAnnotationDescriptor>
                       <telerik:ChartAnnotationDescriptor.Style>
                           <Style TargetType="telerik:CartesianGridLineAnnotation" BasedOn="{StaticResource CartesianGridLineAnnotationStyle}">
                               <Setter Property="Axis" Value="{Binding ElementName=HorizAxis}" />
                               <Setter Property="Value" Value="{Binding Item1}" />
                               <Setter Property="Label" Value="{Binding Item2}" />
                               <Setter Property="LabelDefinition">
                                   <Setter.Value>
                                       <telerik:ChartAnnotationLabelDefinition Location="Inside" VerticalAlignment="Top" HorizontalOffset="-50"  VerticalOffset="-150">
                                           <telerik:ChartAnnotationLabelDefinition.DefaultVisualStyle>
                                               <Style TargetType="TextBlock" BasedOn="{StaticResource TextBoxStyle}">
                                                   <Setter Property="Foreground" Value="Red"></Setter>
                                               </Style>
                                           </telerik:ChartAnnotationLabelDefinition.DefaultVisualStyle>
                                       </telerik:ChartAnnotationLabelDefinition>
                                   </Setter.Value>
                               </Setter>
                               <Setter Property="StrokeThickness" Value="0.3"/>
                               <Setter Property="DashArray" Value="24 8"/>
                               <Setter Property="Stroke" Value="Green"/>
                           </Style>
                       </telerik:ChartAnnotationDescriptor.Style>
                   </telerik:ChartAnnotationDescriptor>
               </telerik:ChartAnnotationsProvider>
 
           </telerik:RadCartesianChart.AnnotationsProvider>
 
       </telerik:RadCartesianChart>
Dinko | Tech Support Engineer
Telerik team
 answered on 22 May 2017
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?