473,834 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4210
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******** ******@TK2MSFTN GP03.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******** ******@TK2MSFTN GP05.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******** ******@TK2MSFTN GP03.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
3280
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 use the F2 key to enter edit mode and then hit TAB or ESCAPE without actually editing the value, dotnet crashes with a null reference error.
1
2318
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 and Currency format, all others are strings. I'd like to build one datagrid to handle this datagrid dynamically. I have it working now, all except the formatting of the 5th (Date) and 6th (Currency) columns. Since the headers for those...
6
3847
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 first two columns are pretty much text column, but subsequent columns 1-12 are numerical. I'm trying to get the thousand separator to work. Any ideas?
4
3098
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"> <Columns> <asp:TemplateColumn HeaderText="Name"> <ItemTemplate> <asp:Label id="fname" Text=<%# Container.DataItem("FirstName") %> runat="server"/> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn HeaderText="Address" DataField="Address"...
1
2840
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 as this format: $30,000.00, because I put it this format {0:C}. I need to re-format as only this value (example: 30.000 - without currency, without decimal & using dot for thousand separator). But how to re-format my
2
11713
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: I found there: How can I change the font used in a Gridcell on a cell by cell or row by row basis. Wih this code I am able to change the Font/Background/... based on the position of the field (column and row). The problem is: it only changes...
0
808
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 shown instead of my data. Can someone tell me what i'm doing wrong?
2
2947
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 disk to a text file for future reference. I now have over 60 huge text files and would like to place the information into either a database or an excel document. I would like to read in from a text file and output the text file to an excel .cvs...
2
1249
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 order to add <thead> and <tbody> elements) so far so good I've placed this code into another project called CustomControls with a
0
9800
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9651
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10556
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10225
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9339
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5629
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3085
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.