entering hex format into datagrid backed by int

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
 
D

Dave Sexton

Hi Steve,

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

sklett

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top