Click here to Skip to main content
Sign Up to vote bad
good
Hello, I am new in C# development. i am going through a problem of gridview. i want to edit a particular cell of a row and insert that row into sql server and refresh gridview with red color for previous value and green color for changed value. and i also want to update a log table for every transaction happened in my application. so how can i get which row and column of datagrid modified so i can update log table with that column name.
Posted 5 Aug '12 - 20:46


1 solution

Assumung you datagrid is called dataGrid1 your code would be
int row = dataGrid1.CurrentCell.RowNumber;
int column = dataGrid1.CurrentCell.ColumnNumber;
you can add this to the onchanged or onselectionchanged event on the datagrid. you can also find out rowNumber and ColumnNumber with the eventargs btw.
  Permalink  
Comments
Member 8172875 - 6 Aug '12 - 3:46
but i want code. how to add a new row of edited cell in database. on refresh i want both the data with different color on modified cell
Member 8172875 - 6 Aug '12 - 6:25
i didnt find RowNumber.. i think its RowIndex rather than RowNumber

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 514
1 CPallini 245
2 Mahesh Bailwal 244
3 Maciej Los 240
4 Aarti Meswania 213
0 Sergey Alexandrovich Kryukov 9,162
1 OriginalGriff 7,179
2 CPallini 3,913
3 Rohan Leuva 3,176
4 Maciej Los 2,588


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 6 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid