Results 1 to 3 of 3

Thread: combining table fields in a DataGrid & HeadClick event

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    1. Is there a way to combine datafields in a DataGrid? I am opening a new recordset, setting the DataGrid datasource to the recordset.

    In my tables I have firstname field and a last name field. I would like to leave the tables the way they are, but combine the names in "last, first" format in the DataGrid.

    I suppose the issue is, can you create new fields for the recordset on the fly, or are you stuck with the fields in the base tables?

    2. I am using the HeadClick event to sort the DataGrid by the column clicked. But - after the click, the WHOLE column is selected. How do you turn the column selection off (and just select one of the cells?)

  2. #2
    Lively Member
    Join Date
    Apr 1999
    Location
    India
    Posts
    73

    Post

    hi,
    to bind a recordset with a grid at runtime u need to use column collection of the grid. set field name for each column using datafield property.

    I don't think there is any way to create fields using recordset object. u need to update base table separately and save the table structure before u can use any new field added to the base table.

    reg the selected column u can place the following statement in the headclick event of the grid
    dbgrid.SelStartCol = -1

    Thanx Manish

  3. #3

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290

    Post

    Thanks Manish. I already am binding the recordset to the DataGrid, and that works fine. What I will try next is opening my Dynaset, and creating a new recordset from it that combines two of the fields.

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