1
Haga clic en " Inicio", " Microsoft Visual Studio ".
2 Haga clic en " Archivo", " Abrir". Haga doble clic en el archivo. NET programa en el que desea dar formato a los objetos DataGrid BoundField .
3
Agregue el código siguiente después de la "forma < id =" line para formatear el " ProductID ", "Nombre" y " ProductNumber " objetos BoundField en la " venta " de base de datos :
< asp : SqlDataSource ID = " SqlDataSource1 " runat = "server"
ConnectionString = " < % $
ConnectionStrings : AWLTConnectionString %> "
SelectCommand = " SELECT ProductID , Name,
ProductNumber ,
DE Sales.Product " >
< /asp: SqlDataSource >
< asp: GridView ID = " DataGrid1 " DataField = " ProductID "
HeaderText = " ProductID "
InsertVisible ReadOnly = "False" = "True"
SortExpression = " ProductID "
DataFormatString = "{ 0 : D6 }" />
< asp: BoundField DataField = "Nombre"
HeaderText = "Nombre"
SortExpression = "nombre "
DataFormatString = "{ 0 }" />
< asp: BoundField "# { 0 }" />
< /asp: DataGrid >
4 Haga clic en " Archivo", " Guardar "para aplicar el formato a la cuadrícula de datos en el programa.