This is a migrated thread and some comments may be shown as answers.

data entry error reporting in Grid view.

3 Answers 107 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 17 Oct 2007, 09:42 PM
Hey Guys,

I'm using a RadGridView bound via bindingSource to a List of custom objects. I want to be able to alert the user if they have entered invalid data when editing. (fails min/max or other such business rules)

in radGridView_CellFormatting() event I test for invalid data and if invalid, I want to set the Fore and Back color of the cell. (using ConditionalFormattingObject wasn't robust enough as I need to set tool tip with error details)

e.CellElement.ForeColor works no problem, but e.CellElement.BackColor will not set.  (I set it to Color.Red, but still shows as white.)
Any ideas? (I'm using the default theme.)

Alternatively, is there any way to set an errorProvider for that cell? Or show an error icon in the cell? (setting image doesn't work because it can only be centered.... not left/right aligned)

OR is there a better way to go about alerting the user they've entered erroneous data? (and draw attention to the cell. )

Any and all help appreciated!!
Thanks.

3 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 18 Oct 2007, 05:33 PM
Well, I've found that I can get the background color of the cell to change, but I had to modify the Style in the Visual Style Builder and set DrawFill to true. nice.

Problem now is the Style Builder is crash-tastic.

Also trying to get the NewRowElement to disappear completely is not possible yet  (any hints?)

I'm finding that basic tasks that are easy to do with the default .net grid are rather difficult and counter intuitive with the telerik grid. (like preventing user from adding new rows, and using error icons.) And the Style Builder crashing doesn't help much either :)



0
Georgi
Telerik team
answered on 19 Oct 2007, 05:27 PM

Hello Mike,

Unfortunately, handling errors using an error provider or setting error icon in the cell are currently missing features in our grid. We have these in out TODO list and they will be available in one of the future releases. To prevent entering erroneous data, you could possibly use RadGridView.ValueChanging or RadGridView.Validating events.

As to the new row in the grid, use GridVIewTemplate.AllowAddNewRow property (use RadGridView.MasterGridViewTemplate.AllowAddNewRow for the first data level).

 
Regards,

Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mike
Top achievements
Rank 1
answered on 19 Oct 2007, 10:31 PM
Thanks Georgi,
Setting the property had the desired effect.
I'll take a look at the valueChanging  and Validating events.
m.
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or