473,405 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

entering hex format into datagrid backed by int

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
Oct 10 '06 #1
2 4142
Hi Steve,

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

"sklett" <s@s.comwrote in message news:u3**************@TK2MSFTNGP03.phx.gbl...
>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

Oct 11 '06 #2
Dave, worked perfect!

Thank you,
Steve

"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:uU**************@TK2MSFTNGP05.phx.gbl...
Hi Steve,

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

"sklett" <s@s.comwrote in message
news:u3**************@TK2MSFTNGP03.phx.gbl...
>>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


Oct 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
4
by: Arpan | last post by:
How do I format only the Header text (column names) in a DataGrid? Consider the following code snippet: <asp:DataGrid id="myDataGrid" GridLines="both" AutoGenerateColumns="false" runat="server">...
1
by: Julius Fenata | last post by:
Dear all, I need help to change my item-template value format... Here is my case, I have a datagrid, with 'SubjectPrice' field, and when the grid displayed, my 'SubjectPrice' field displayed...
2
by: DraguVaso | last post by:
Hi, I'm looking for a nice way to format the cell of my datagrid according to some predefined 'rules'. I found a lot on the site of George shepherd, but it wasn't really what I was looking for:...
0
by: Charlie | last post by:
I'm trying to enter data into a datagrid column but when I select the next row the data i've entered in the previous row disappears. If I format the column (eg. with #0:00), the formatting code is...
2
by: Pat | last post by:
Here is my problem that I am having with a current project. I went and backed up all my hard drives to DVD's. After backing up the drives, I used a batch file to get all the file names from the...
2
by: CharlesA | last post by:
Hi folks, first off, I'm using Framework vs 1.1 with ASP.net and C# I'm trying to extend the System.Web.UI.Webcontrols.DataGrid, and the only thing I want to extend is the Render method (in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.