negative currency in gridview

My positive amounts are displaying like this    $75.00
My negative amounts are displaying like this    ($75.00)

I need my positive to stay the same and my negative to  display   -$75.00

                          <asp:BoundField DataField="unit_price1" DataFormatString="{0:c}"
                    HeaderText="Price" HtmlEncode="False" SortExpression="unit_price1"
                    ItemStyle-HorizontalAlign="center" ControlStyle-CssClass="titleboldprice" ItemStyle-CssClass="titleboldprice">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
LVL 1
gianitooAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David RobitailleAnalyst ProgrammerCommented:
it s a format and "culture" question
DataFormatString="{0:c}"
is where your problem is

http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
 
 
 

; 
 Section separator 
 The ';' character is used to separate sections for positive, negative, and zero numbers in the format string. If there are two sections in the custom format string, the leftmost section defines the formatting of positive and zero numbers, while the rightmost section defines the formatting of negative numbers. If there are three sections, the leftmost section defines the formatting of positive numbers, the middle section defines the formatting of negative numbers, and the rightmost section defines the formatting of zero numbers. 
 
The following example uses the format specifier for the section separator to format positive, negative, and zero numbers differently. 
 
Visual Basic Copy Code 
Dim posValue As Double = 1234
Dim negValue As Double = -1234
Dim fmt As String = "##;(##)"
Console.WriteLine(posValue.ToString(fmt))    ' Displays 1234
Console.WriteLine(negValue.ToString(fmt))    ' Displays (1234)
 
 
 

Open in new window

0
gianitooAuthor Commented:
So how do i apply that in my gridview??  gridview below
field for price is  unit_price1

<asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False"
                                        DataKeyNames="rowpointer" DataSourceID="SqlDataSource4"  GridLines="None"
                                        EmptyDataText="No Options"
                                        OnRowDataBound="GridView4_RowDataBound"  ShowHeader="False">
                                        <RowStyle BackColor="White" ForeColor="#003399" />
                                        <Columns>
                                       
                                            <asp:BoundField DataField="itemdescription" HeaderText="Items"
                                               HtmlEncode="True"/>
                                                     <asp:BoundField DataField="unit_price1" DataFormatString="{0:c}"
                    HeaderText="Price" HtmlEncode="False" SortExpression="unit_price1"
                    ItemStyle-HorizontalAlign="center" ControlStyle-CssClass="titleboldprice" ItemStyle-CssClass="titleboldprice">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                                                <asp:TemplateField><ItemTemplate>
                                                 <asp:HyperLink ID="deleteme" runat="server" >Remove</asp:HyperLink>
                                                </ItemTemplate></asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price">
                                           
                                                <FooterTemplate>
                                                    <asp:Label ID="lblSummary" Runat="server" />
                                                </FooterTemplate>
                                         
                                            </asp:TemplateField>
                                        </Columns>
                                       
                                    </asp:GridView>
0
prairiedogCommented:
DataFormatString="{0:$ #,#.00}"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.