How to show monetary values in a DataGrid

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to show monetary values in a DataGrid

    Hello folks. I have a DataGrid in a Web Form. I´d like to show numeric
    columns in Money format US$ 10,000.98. However, when I fill the DataGrid
    from a SqlCommand, it fill in the DataGrid like this: 1000098. How do I do
    that?

    Thanks


    Henrique Berenguel Guest

  2. Similar Questions and Discussions

    1. can I show only unique values in a List?
      I'm using XMLConnector, DataSet and list. Is there a way to show only unique values from a certain XML node from my XML? I have a "<phase>" node...
    2. can I show only unique values in a dataGrid?
      I'm using XMLConnector, DataSet and list. Is there a way to show only unique values from a certain XML node from my XML? I have a "<phase>" node...
    3. Datagrid don't show all values from query
      Hi, I have a Remote Object which execute a query from Contacts table, the table structure is id_contact, name, etc,,,,, When execute this...
    4. read row values from datagrid and populate in new datagrid values from connected
      Hello, i am new in asp.net and i am having a question: I am having a datagrid_1 in which i am showing the context of PatientDetails table....
    5. Show only sum values that exceed a certain total
      I am trying to produce a report where I have a sum for a collective amount (number field) and that will print only when greater that a certain...
  3. #2

    Default Re: How to show monetary values in a DataGrid

    FormatNumber()

    "Henrique Berenguel" <hberenguel@coimex.com.br> wrote in message
    news:%23rh$4fAQDHA.704@tk2msftngp13.phx.gbl...
    > Hello folks. I have a DataGrid in a Web Form. I´d like to show numeric
    > columns in Money format US$ 10,000.98. However, when I fill the DataGrid
    > from a SqlCommand, it fill in the DataGrid like this: 1000098. How do I do
    > that?
    >
    > Thanks
    >
    >

    Vaibhav Guest

  4. #3

    Default Re: How to show monetary values in a DataGrid

    But do you have a sample to show to me?


    "Vaibhav" <consultvaibhav@yahoo.com> escreveu na mensagem
    news:OduVp6BQDHA.2676@TK2MSFTNGP10.phx.gbl...
    > FormatNumber()
    >
    > "Henrique Berenguel" <hberenguel@coimex.com.br> wrote in message
    > news:%23rh$4fAQDHA.704@tk2msftngp13.phx.gbl...
    > > Hello folks. I have a DataGrid in a Web Form. I´d like to show numeric
    > > columns in Money format US$ 10,000.98. However, when I fill the DataGrid
    > > from a SqlCommand, it fill in the DataGrid like this: 1000098. How do I
    do
    > > that?
    > >
    > > Thanks
    > >
    > >
    >
    >

    Henrique Berenguel Guest

  5. #4

    Default Re: How to show monetary values in a DataGrid

    Specify the DataFormatString for your bound column..

    <asp:BoundColumn HeaderText="MoneyMoney" DataField="Price" DataFormatString
    = {0:c} />

    --
    Naveen K Kohli
    [url]http://www.netomatix.com[/url]
    "Henrique Berenguel" <hberenguel@coimex.com.br> wrote in message
    news:%23rh$4fAQDHA.704@tk2msftngp13.phx.gbl...
    > Hello folks. I have a DataGrid in a Web Form. I´d like to show numeric
    > columns in Money format US$ 10,000.98. However, when I fill the DataGrid
    > from a SqlCommand, it fill in the DataGrid like this: 1000098. How do I do
    > that?
    >
    > Thanks
    >
    >

    Naveen K Kohli Guest

  6. #5

    Default Re: How to show monetary values in a DataGrid

    The problem is that I´m using the option:

    'Create columns automatically at run time' in the Property Builder of my
    DataGrid.

    Then I don´t have bound columns in the html, that´s the problem...

    Look the code:

    <asp:datagrid id="DataGrid1" runat="server" BackColor="White"
    Width="692px" BorderColor="#999999" PageSize="3" AllowPaging="True"
    BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical"
    Height="94px">
    <SelectedItemStyle Font-Bold="True" ForeColor="White"
    BackColor="#008A8C"></SelectedItemStyle>
    <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    <ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="White"
    BackColor="#000084"></HeaderStyle>
    <FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
    <Columns><asp:ButtonColumn Text="Selecionar"
    CommandName="Select"></asp:ButtonColumn></Columns>
    <PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999"
    Mode="NumericPages"></PagerStyle>
    </asp:datagrid>

    Is there an other way to do that?

    Or will I have to reprogram everything to recreate the browser with bounds
    columns?

    Thanks in advance



    "Henrique Berenguel" <hberenguel@coimex.com.br> escreveu na mensagem
    news:uzn7FICQDHA.1584@TK2MSFTNGP11.phx.gbl...
    > But do you have a sample to show to me?
    >
    >
    > "Vaibhav" <consultvaibhav@yahoo.com> escreveu na mensagem
    > news:OduVp6BQDHA.2676@TK2MSFTNGP10.phx.gbl...
    > > FormatNumber()
    > >
    > > "Henrique Berenguel" <hberenguel@coimex.com.br> wrote in message
    > > news:%23rh$4fAQDHA.704@tk2msftngp13.phx.gbl...
    > > > Hello folks. I have a DataGrid in a Web Form. I´d like to show numeric
    > > > columns in Money format US$ 10,000.98. However, when I fill the
    DataGrid
    > > > from a SqlCommand, it fill in the DataGrid like this: 1000098. How do
    I
    > do
    > > > that?
    > > >
    > > > Thanks
    > > >
    > > >
    > >
    > >
    >
    >

    Henrique Berenguel Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139