Minh

Minh

  • NA
  • 47
  • 133.7k

Datagridviewcell value in c#

Jun 6 2010 10:40 AM
Hi friends ,
I have a datgridaview named _gridview for data input . But when the value of cell[x,y]  is set to null i can not write : _gridview.rows[x].cell[y].value.tostring(); then system give me an error : not set to an instance of any object .
So , what should i do for that because user can make the cell null at anytime they want . Can I use my code like below and if yes , what override event should i put my code in :
if(_gridview.currentcell.tostring()==sysem.dbNull.value.tostring())
    _gridview.currentcell.value="";
THANKS .

Answers (2)