Data Presentation in Dridview

Last post 06-08-2009 1:47 AM by Samu Zhang - MSFT. 4 replies.

Sort Posts:

  • Data Presentation in Dridview

    06-03-2009, 6:10 AM
    • Member
      70 point Member
    • nandu_2322310
    • Member since 02-25-2009, 6:50 AM
    • New Delhi, India
    • Posts 77

    Hello Eevey One

    I have a new problem in my DridView, I got a field in data base Price (money) as 100.0000, Show i want change in my grid view like $100, 100 EURO and  100 Rs Depend on Define Fromat.

     Can any body know how to change it

    N_Rawat

    Plz Mark AS Answer if Any Help
  • Re: Data Presentation in Dridview

    06-03-2009, 7:31 AM
    • Star
      10,310 point Star
    • chintanpshah
    • Member since 11-19-2008, 5:39 AM
    • Ahmedabad
    • Posts 1,843

    Change text of your cells on RowDataBound as:

    e.Cells(2).Text = Convert.ToDecimal(e.Cells(2).Text).ToString("c")

    You need to change the Money symbol for each language same as you want to show in page.

    Hope this helps...

    Don't forget to mark as answer, if it helps
  • Re: Data Presentation in Dridview

    06-03-2009, 7:42 AM
    • Member
      70 point Member
    • nandu_2322310
    • Member since 02-25-2009, 6:50 AM
    • New Delhi, India
    • Posts 77

     U r right, it will work but i want change it like $100.00, and dollor setting come from my database

    N_Rawat

    Plz Mark AS Answer if Any Help
  • Re: Data Presentation in Dridview

    06-03-2009, 7:59 AM
    • Member
      110 point Member
    • kkprakashmsc
    • Member since 01-06-2009, 8:27 AM
    • Bangalore
    • Posts 82

    Hi

    For that u want to have one more table in ur database as currency value corresponding value for eg:- for us$ : according to todays value u want to show ,

    whether like this r some other u are asking about

  • Re: Data Presentation in Dridview

    06-08-2009, 1:47 AM
    Answer

    Hi kkprakashmsc ,

    double price = 4.56;
    lblPrice.Text = String.Format("{0:c}", price);

    The output for the above Web page would be:

     $4.56


    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (5 items)