entering hex format into datagrid backed by int

  • Thread starter Thread starter sklett
  • Start date Start date
S

sklett

I have the need to enter a hex value IE: 0xffff into a datagrid column that
is backed by an int property for a custom object.

in other words, I have a class like this:
class MyEntity
{
private int _start = 0;

public int Start
{
get{ return _start; }
set{ _start = value; }
}
}

in the DataGridView if I enter 0xffff I get format exceptions.

Anyone have some tips or ideas how I can get this to work? Where I should
look?

Thanks for any help!

-Steve
 
Hi Steve,

Try using the DataGridView's custom display formatting and input parsing events, CellFormatting and CellParsing, respectively.
 
Dave, worked perfect!

Thank you,
Steve

Dave Sexton said:
Hi Steve,

Try using the DataGridView's custom display formatting and input parsing
events, CellFormatting and CellParsing, respectively.
 
Back
Top