Display Negative numbers in DataGrid

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gidi

    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
  • Michael Nemtsev

    #2
    Re: Display Negative numbers in DataGrid

    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


    Comment

    • Gidi

      #3
      Re: Display Negative numbers in DataGrid

      Hi Michael,

      I'm not familier with this, what i have is
      this.dataGridTe xtBoxColumn1.Fo rmat = "";

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

      Thanks,
      Gidi.

      "Michael Nemtsev" wrote:
      [color=blue]
      > 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
      >
      >
      >[/color]

      Comment

      • Gidi

        #4
        Re: Display Negative numbers in DataGrid

        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:
        [color=blue]
        > 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
        >
        >
        >[/color]

        Comment

        • Michael Nemtsev

          #5
          Re: Display Negative numbers in DataGrid

          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>[color=blue][color=green]
          >> 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
          >>[/color][/color]
          ---
          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


          Comment

          • Gidi

            #6
            Re: Display Negative numbers in DataGrid

            Hi Michael,

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

            thanks,


            "Michael Nemtsev" wrote:
            [color=blue]
            > 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>[color=green][color=darkred]
            > >> 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
            > >>[/color][/color]
            > ---
            > 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
            >
            >
            >[/color]

            Comment

            Working...