Results 1 to 2 of 2

Thread: Formatting a datagrid

  1. #1

    Thread Starter
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52

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

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    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.
    ~Ryan





    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width