
David McCloskey
Top achievements
Rank 1
David McCloskey
asked on 14 Oct 2009, 08:24 PM
I am attempting to use the CellValidating event. I am encountering two problems. First e.RowIndex is coming back as a -1 on the a new first row. The row has been added using data binding. Question, how can I find what row I am working with. Second, I attempt to update the value (e.Row.Cells(1).value = "99213" in a cell to the default, and the data does not show in e.Value.
Respectfully,
Dave
Respectfully,
Dave
7 Answers, 1 is accepted
0
Hi David McCloskey,
Thank you for writing.
You can check if you are validating add new row by using e.Row argument of CellValidating event:
Unfortunately, CellValidating event does not support changing the validated cell value. We will consider to improve this behavior in some of the feature releases.
Do not hesitate to contact me again if you have other questions.
Best wishes,
Martin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Thank you for writing.
You can check if you are validating add new row by using e.Row argument of CellValidating event:
void
radGridView1_CellValidating(
object
sender, CellValidatingEventArgs e)
{
if
(e.Row
is
GridViewNewRowInfo)
{
//do something
}
}
Unfortunately, CellValidating event does not support changing the validated cell value. We will consider to improve this behavior in some of the feature releases.
Do not hesitate to contact me again if you have other questions.
Best wishes,
Martin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0

Iftakhar
Top achievements
Rank 1
answered on 12 May 2011, 04:20 PM
Hi,
I am using the Q1 2011 release. I want to change the value in cellvalidating event. Is this feature added in the release? If yes then can you please let me know how to do it.
Thanks
I am using the Q1 2011 release. I want to change the value in cellvalidating event. Is this feature added in the release? If yes then can you please let me know how to do it.
Thanks
0
Hi David McCloskey,
Thank you for writing.
You can change the cell value when handling the CellValidating event by using the CurrentCell property. Please consider the following code as example:
Let me know if you have any other questions.
Greetings,
Martin Vasilev
the Telerik team
Thank you for writing.
You can change the cell value when handling the CellValidating event by using the CurrentCell property. Please consider the following code as example:
void
radGridView1_CellValidating(
object
sender, CellValidatingEventArgs e)
{
if
(MyCondition)
{
this
.radGridView1.CurrentCell.Value =
"Validated Value"
;
}
}
Let me know if you have any other questions.
Greetings,
Martin Vasilev
the Telerik team
0

Iftakhar
Top achievements
Rank 1
answered on 17 May 2011, 03:29 PM
thank you very much.. it helped
0

David McCloskey
Top achievements
Rank 1
answered on 17 May 2011, 05:24 PM
Thank you for the assistance.
Be Well,
Dave
Be Well,
Dave
0

Blas
Top achievements
Rank 2
answered on 24 Jun 2011, 08:51 AM
Hi Martin,
The proposed solution works fine when the current cell has not value, but when the cell has value this assignment doesn't work and the old value remains unchanged. Is that possible?
Thank you
Blas
The proposed solution works fine when the current cell has not value, but when the cell has value this assignment doesn't work and the old value remains unchanged. Is that possible?
Thank you
Blas
0
Hi Roberto Andrade Olivie,
Thank you for contacting me.
Setting the value of the current cell should work regardless of whether the old value is null or not. Maybe there is something specific in your project, which causes the described undesired behaviour. Please open a new support ticket and send me a small sample project, which demonstrates your scenario. This will help me to investigative your case further and provide you an accurate assistance.
Best wishes,
Martin Vasilev
the Telerik team
Thank you for contacting me.
Setting the value of the current cell should work regardless of whether the old value is null or not. Maybe there is something specific in your project, which causes the described undesired behaviour. Please open a new support ticket and send me a small sample project, which demonstrates your scenario. This will help me to investigative your case further and provide you an accurate assistance.
Best wishes,
Martin Vasilev
the Telerik team