473,414 Members | 1,623 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,414 software developers and data experts.

Display Negative numbers in DataGrid

Hi,

I've DataGrid which the user can enter numbers, when it comes to possitive
numbers I have no problem, But when I enter negative numbers instead of
writing
-x it write x- (the minues sign is on the right side instead of the left),
how can i change it to be displayed the right way?

Thanks,
Gidi
Mar 12 '06 #1
5 5493
Hello Gidi,

Do u use String.Format for this?

G> I've DataGrid which the user can enter numbers, when it comes to
G> possitive numbers I have no problem, But when I enter negative
G> numbers instead of writing -x it write x- (the minues sign is on the
G> right side instead of the left), how can i change it to be displayed
G> the right way?
G>
G> Thanks,
G> Gidi
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 12 '06 #2
Hi Michael,

I'm not familier with this, what i have is
this.dataGridTextBoxColumn1.Format = "";

what should i put in the value so it will be dispalyed as it should?

Thanks,
Gidi.

"Michael Nemtsev" wrote:
Hello Gidi,

Do u use String.Format for this?

G> I've DataGrid which the user can enter numbers, when it comes to
G> possitive numbers I have no problem, But when I enter negative
G> numbers instead of writing -x it write x- (the minues sign is on the
G> right side instead of the left), how can i change it to be displayed
G> the right way?
G>
G> Thanks,
G> Gidi
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mar 12 '06 #3
Hi Michael,

I understood my problem, now I'm looking for a good solution,
I set my dataGrid's RightToLeft property to "Yes" (and i need it to be like
this), but i need that some coulmns will not be RightToLeft (just the coulmn
TextBox).

Can it be done?

Thanks,
Gidi

"Michael Nemtsev" wrote:
Hello Gidi,

Do u use String.Format for this?

G> I've DataGrid which the user can enter numbers, when it comes to
G> possitive numbers I have no problem, But when I enter negative
G> numbers instead of writing -x it write x- (the minues sign is on the
G> right side instead of the left), how can i change it to be displayed
G> the right way?
G>
G> Thanks,
G> Gidi
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mar 12 '06 #4
Hello Gidi,

The problem is that in edit mode your RTP property became depended (imho)
from the cultureInfo settings (i have no time to test it).
What do you need to do, is manually change format of edited cell. See info
abt it there http://www.syncfusion.com/FAQ/WindowsForms/Default.aspx

G> Hi Michael,
G>
G> I understood my problem, now I'm looking for a good solution,
G> I set my dataGrid's RightToLeft property to "Yes" (and i need it to
G> be like
G> this), but i need that some coulmns will not be RightToLeft (just the
G> coulmn
G> TextBox).
G> Can it be done?
G>
G> Thanks,
G> Gidi
G> "Michael Nemtsev" wrote:
G>
Hello Gidi,

Do u use String.Format for this?

G> I've DataGrid which the user can enter numbers, when it comes to
G> possitive numbers I have no problem, But when I enter negative
G> numbers instead of writing -x it write x- (the minues sign is on
the
G> right side instead of the left), how can i change it to be
displayed
G> the right way?
G>
G> Thanks,
G> Gidi
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 12 '06 #5
Hi Michael,

Sorry for bugging...
I tried to find it, and couldn't...

thanks,
"Michael Nemtsev" wrote:
Hello Gidi,

The problem is that in edit mode your RTP property became depended (imho)
from the cultureInfo settings (i have no time to test it).
What do you need to do, is manually change format of edited cell. See info
abt it there http://www.syncfusion.com/FAQ/WindowsForms/Default.aspx

G> Hi Michael,
G>
G> I understood my problem, now I'm looking for a good solution,
G> I set my dataGrid's RightToLeft property to "Yes" (and i need it to
G> be like
G> this), but i need that some coulmns will not be RightToLeft (just the
G> coulmn
G> TextBox).
G> Can it be done?
G>
G> Thanks,
G> Gidi
G> "Michael Nemtsev" wrote:
G>
Hello Gidi,

Do u use String.Format for this?

G> I've DataGrid which the user can enter numbers, when it comes to
G> possitive numbers I have no problem, But when I enter negative
G> numbers instead of writing -x it write x- (the minues sign is on
the
G> right side instead of the left), how can i change it to be
displayed
G> the right way?
G>
G> Thanks,
G> Gidi
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mar 15 '06 #6

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

Similar topics

19
by: Imbaud Pierre | last post by:
integer division and modulo gives different results in c and python, when negative numbers are involved. take gdb as a widely available c interpreter print -2 /3 0 for c, -1 for python. more...
7
by: pj | last post by:
Why does M$ Query Analyzer display all numbers as positive, no matter whether they are truly positive or negative ? I am having to cast each column to varchar to find out if there are any...
3
by: Phil | last post by:
Using C#, I am building my datagrid in my code behind due to the need to dynamically build the columns. In my Code I use an array to accomplish this and I also use an if statement to determine if...
5
by: Subrahmanyam Arya | last post by:
Hi Folks , I am trying to solve the problem of reading the numbers correctly from a serial line into an intel pentium processor machine . I am reading 1 byte and 2byte data both positive...
11
by: tlyczko | last post by:
Hello Rob B posted this wonderful code in another thread, http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/c84d8538025980dd/6ead9d5e61be85f0#6ead9d5e61be85f0 I could not...
15
by: jaks.maths | last post by:
How to convert negative integer to hexadecimal or octal number? Ex: -568 What is the equivalent hexadecimal and octal number??
11
by: drtimhill | last post by:
I'm just starting out on Python, and am stumped by what appears an oddity in the way negative indices are handled. For example, to get the last character in a string, I can enter "x". To get the...
39
by: Frederick Gotham | last post by:
I have a general idea about how negative number systems work, but I'd appreciate some clarification if anyone would be willing to help me. Let's assume we're working with an 8-Bit signed integer,...
20
by: Casey | last post by:
Is there an easy way to use getopt and still allow negative numbers as args? I can easily write a workaround (pre-process the tail end of the arguments, stripping off any non-options including...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
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
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,...

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.