|
-
Dec 16th, 2002, 10:19 AM
#1
Thread Starter
Member
Formatting a datagrid
I am creating a datagrid on the fly like this:
myQuery = "SELECT * FROM [tbl * F002 > 4 J] WHERE _
MUFLID2 =" & Chr(39) & ddlWho.SelectedItem.Text _
& Chr(39) & "ORDER BY STEPGAP DESC"
OleDbConnection1.Open()
Dim cmd As New OleDb.OleDbCommand()
cmd.Connection = OleDbConnection1
cmd.CommandText = myQuery
Dim datareader As OleDb.OleDbDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
dgF002.DataSource = datareader
dgF002.AutoGenerateColumns = True
dgF002.DataBind()
Apparently I cannot format individual columns using the property builder (such as a column I wish to format into currency). How can I format the grid via code? Is there a relatively simple way to do this?
Thanks in advance...
-
Dec 16th, 2002, 10:56 AM
#2
Addicted Member
You use the propery builder...
I believe under the Column option on the side bar menu is a way to for you to create the colums to your liking
There is a check box at the top that says something to the affect of "automatically generate columns" or something simliar, anyway you want to uncheck that. Then you can create bound columns and fill in the database fields and such. You can also specify a format you want it to look as well.
I don't know that what I described is exact because I don't have the program on this computer, but it is relatively close.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|