how to format currency and Date in Datagrid and ListView control

I am doing a project in Vb.net . It is somewhat different for me as i am a vb programmer. some of the issues like formatting currency and date in Datagrid, Datalist and especially Listview control . can any one tell me how to do this format with a code sample. it will be very helpful for me.
rahamanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Bob LearnedCommented:
Here is a DataGrid example:

<asp:DataGrid id=DataGrid1 style="Z-INDEX: 101; LEFT: 44px; POSITION: absolute; TOP: 60px" runat="server" Width="492px" Height="192px" AutoGenerateColumns="False">
  <AlternatingItemStyle CssClass="alternatingstyle">
  </AlternatingItemStyle>
  <ItemStyle CssClass="itemstyle">
  </ItemStyle>
  <HeaderStyle CssClass="headerstyle">
  </HeaderStyle>
  <Columns>
    <asp:BoundColumn DataField="name" HeaderText="Name"></asp:BoundColumn>
    <asp:BoundColumn DataField="address" HeaderText="Address"></asp:BoundColumn>
    <asp:BoundColumn DataField="current_date" HeaderText="Current Date" DataFormatString="{0:dd MMM yyyy}"></asp:BoundColumn>
    <asp:BoundColumn DataField="amount_due" HeaderText="Amount Due" DataFormatString="{0:C}"></asp:BoundColumn>
  </Columns>
</asp:DataGrid>

Look at the BoundColumn declarations, and the DataFormatString formats:

Data Examples:
(1) {0:dd MMM yyyy} = 12 Apr 2006
(2) {0:C} = $1268.60

You can specify these values through the 'Property Builder' for the DataGrid.

Bob

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
Bob LearnedCommented:
:)
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.