How to format gridview columns?

前端 未结 2 1875
萌比男神i
萌比男神i 2021-01-26 15:42

Below is my code:

var grid = new GridView();
grid.DataSource = myDataset;

grid.DataBind();

I want to format some of the columns of my grid to

2条回答
  •  心在旅途
    2021-01-26 16:34

    Google brought me here, so I thought I'd share my answer. Here's how I got to format one cell to currency in asp.net.

    With Me.ratesGridView
            .Rows(i).Cells(4).Text = FormatCurrency(.Rows(i).Cells(4).Text)
    End With
    

    Enjoy.

提交回复
热议问题