Telerik UI for WinForms
Overview
Demos
Roadmap
What's New
Roadmap
Release History
Docs & Support
Pricing
Search
Shopping cart
Login
Contact Us
Try now
close mobile menu
Telerik Forums
/
UI for WinForms
This is a migrated thread and some comments may be shown as answers.
Changing value of inserted row
1 Answer
52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
timtom
Top achievements
Rank 1
timtom
asked on
19 Aug 2008,
12:40 PM
Hi :o)
How do I change the value of a column/field that has been inserted using the automatic add new row functionality of the grid?
Many thanks
Tim
Add a comment
Submit comment
Cancel
1 Answer
, 1 is accepted
Sort by
Score
Date
0
Julian Benkov
Telerik team
answered on
21 Aug 2008,
12:27 PM
Hello Tim,
You can use the
CellEndEdit
event of
RadGridView
for implementing this behavior:
void
radGridView1_CellEndEdit(
object
sender, GridViewCellEventArgs e)
{
if
(
this
.radGridView1.CurrentRow
is
GridViewNewRowInfo && (e.ColumnIndex == 3 || e.ColumnIndex == 4))
{
GridViewNewRowInfo newRowInfo = (GridViewNewRowInfo)
this
.radGridView1.CurrentRow;
newRowInfo.DataRowInfo.Cells[
"Total"
].Value = newRowInfo.DataRowInfo.Cells[
"Num"
].Value * newRowInfo.DataRowInfo.Cells[
"Price"
].Value;
}
}
Don't hesitate to contact us if you have other questions.
Greetings,
Julian Benkov
the Telerik team
Check out
Telerik Trainer
, the state of the art learning tool for Telerik products.
Add a comment
Submit comment
Cancel
Answer this question
Drag and drop files here or
browse
to attach...
Browse
for files to attach...
Supported file types: PNG, JPG, JPEG, ZIP, RAR, TXT. Max total file size - 20MB.
Submit answer
Cancel
Tags
GridView
Asked by
timtom
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or
Copy link