Checking the GridView Telerik Editable String

I use Telerik RadGridView in a WPF application that has two editable columns - quantity and cost. I created a model to display this data in a grid.

eg ::

[HasSelfValidation] class Item { public int Quantity{get;set;} public decimal Cost{get;set;} [SelfValidation] public void ValidateQuanity_Cost(...) { // if Quanity>0, Cost should also be greater than 0. } } public ObservableCollection<Item> Items{get;set;} <telerik:RadGridView ItemSource={Binding Items}.../> 

I bind the ObservableCollection of the type element to the telerik GridView. Although the check works fine, I want to highlight a line that generates an error and also displays a tooltip. Can anyone help to achieve this?

+4
source share
2 answers

You can make the Item attribute BackgroundColor (of type Color ) and ToolTipText (of type string ), which you can bind in your data template.

0
source

Make the Item object an IsValid object, then use a custom type converter to convert it to a background color. Similarly for a tooltip, but this may require the ErrorType property, which is an enumeration.

+1
source

Source: https://habr.com/ru/post/1300454/


All Articles