This is a migrated thread and some comments may be shown as answers.

Problems adding dollar sign to GridTemplateColumn

1 Answer 133 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Match
Top achievements
Rank 1
Mark Match asked on 10 May 2010, 09:43 PM
I am trying to add the dollar sign or currency sign to each of these.  Also replacing the itemtemplate with just the value and not a text box would be nice too.  I need the format to be like $5,000.00.  Right now it does show both as 5,000.00.  
 
<telerik:GridTemplateColumn HeaderText="Approval Amount" SortExpression="ApprovalAmount"
                                                        UniqueName="ApprovalAmount" EditFormColumnIndex="1">
                                                        <ItemTemplate>              
                                                        <telerik:RadNumericTextBox runat="server" DataFormatString="${0:c}" ID="tbApprovalAmount" Type="Number"
                                                        MinValue="0" Enabled="false" DbValue='<%# Bind("ApprovalAmount") %>'>
                                                       </telerik:RadNumericTextBox>                                        
                                                          </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <telerik:RadNumericTextBox runat="server" ID="tbApprovalAmount" DataFormatString="{0:C}" Type="Number" DataType="System.Int"
                                                                MinValue="0" DbValue='<%# Bind("ApprovalAmount") %>'>
                                                            </telerik:RadNumericTextBox>
                                                        </EditItemTemplate>
                                                    </telerik:GridTemplateColumn>

1 Answer, 1 is accepted

Sort by
0
Mark Match
Top achievements
Rank 1
answered on 11 May 2010, 01:10 AM
I found out how to do this.

Just change the type to currency.  Remove DataFormatString and DataType. 
Tags
Grid
Asked by
Mark Match
Top achievements
Rank 1
Answers by
Mark Match
Top achievements
Rank 1
Share this question
or