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

How to add Dataformatstring in GridTemplateColumn

1 Answer 274 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 04 Dec 2012, 09:18 AM
HI,
I have the rad grid column for which i want to set the U.S currency format. How to achieve this?
<telerik:GridTemplateColumn DataField="UnitPrice" HeaderText="Unit Price" UniqueName="UnitPrice" Visible="true">
                            <InsertItemTemplate>
                                 <telerik:RadTextBox ID="RadtxtUnitPrice" runat="server" Text='<%# Bind("UnitPrice") %>' >
                                </telerik:RadTextBox>
                            </InsertItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="RadtxtUnitPrice" runat="server" Text='<%# Eval("UnitPrice") %>' >
                                </telerik:RadTextBox>
                            </EditItemTemplate>
                             <ItemTemplate >
                            <telerik:RadTextBox ID="RadtxtUnitPrice" ReadOnly="true" runat="server" Text='<%# Eval("UnitPrice") %>' />
                            </ItemTemplate>  
                        </telerik:GridTemplateColumn>

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 04 Dec 2012, 09:32 AM
Hello,

Replace simple textbox with numerictextbox.

<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Type="Currency"></telerik:RadNumericTextBox>

you can also able to set your culture.

<telerik:RadNumericTextBox Culture="YourCulterName" ></telerik:RadNumericTextBox>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or