in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Allowing 4 Decimal points

Last post 11-07-2007 11:00 AM by ravimaran. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-02-2007 2:56 PM

    Allowing 4 Decimal points

     Hi All,

    I am really new to using C1TrueDbGrid.  I have Widows form that display a list of clients and I am able to change their rating with no problem.  Right now I am getting the number as 0.1000000000, 0.2000000000 and so on.  I did change the NumberFormat property to 0.0000 which displays only 4 digits after the decimal point.  Now is there any way that I can allow only 4 digits after the decimal point when modifying or adding new record.  Is there any event can be called to check the entering value? or is there any property that I can change so it restricts the entry.  Please advise me on this.  Thank you. 

  • 11-02-2007 5:23 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 527

    Re: Allowing 4 Decimal points

    Hi, you can use the EditMask (or InputMask in designer) to handle this

     C1TrueDBGrid1.Columns(1).EditMask = "0.0000"

    Hope that helps,
    Greg L

     

    ComponentOne Technical Engagement
    Filed under: ,
  • 11-02-2007 11:58 PM In reply to

    Re: Allowing 4 Decimal points

    Hi, thanks for the reply.  I have tried that earlier.  Used the InputMask to "0.0000" what happens is that when I enter 0.2000  it displays as 2000.0000.  Is there any event handler that can check if there are 4 decimal points exist or not?  Like TextChanged?  I have tried few methods like Change but I am not able to retrieve the the value or column index.  Is there anyother alternative ways to overcome this issue?  Thank you.

  • 11-06-2007 10:54 AM In reply to

    Re: Allowing 4 Decimal points

     I guess it is tough to make this happen with the C1TrueDbGrid.  Hopefully someone can help me with it.

     

     

  • 11-07-2007 11:00 AM In reply to

    Re: Allowing 4 Decimal points

     I have played around with the Component and I have made it work.  All I did was changed the Number Format to "Edit Mask" and EditMask to 0.0000 and UpdateEditMask to True. 

    works like a charm. 

Page 1 of 1 (5 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.