Datagridview Cellvalidating vs Datagridview CellParsing in C#.Net

Posted by Naraayanan under C# on 3/21/2012 | Points: 10 | Views : 6311 | Status : [Member] | Replies : 4
Hi friends,
What is the Difference between Datagridview Cellvalidating vs Datagridview CellParsing in C#.Net? How to use in the Application ?

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/



Responses

Posted by: Rajni.Shekhar on: 3/21/2012 [Member] Bronze | Points: 25

Up
0
Down
cellParsing and CellValidating are events of gridview for windows application.

CellParsing: It occurs when the user leaves edit mode, regardless of whether the value of the current cell has been modified.

CellValidating: it occurs after the cell has finished validating.

Thanks,
Rajni Shekhar

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 3/21/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
Thanks . Which is best for my query?
Query
I fill the information in the Datagridview from Folder, Folder contains File Name,File Size,File Path.User select a row and edit the First Column,First Column Contains File Name. so File name should be rename in the Input folder.


Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 3/22/2012 [Member] Bronze | Points: 25

Up
0
Down
CellValidating is used when you want to validate any value like value must be integer. and CellParsing occures when you want
CellParsing event is used to provide custom value conversion to the required type

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellparsing.aspx
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvalidating.aspx

do you have a button to update records in your form, if so you can write code on button click to update folder name by using directory class.

Thanks,
Rajni Shekhar

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 3/22/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

you should use CellValidating for your query as it validate the cell.

R D Patel

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response