Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Data Grid help wanted

SallySally Member Posts: 5
Hello folks,

How do I add a column to a data grid that does not correspond to a column in my sql table. All the other columns in my data grid are from an sql table... I just want to bind a new column that contains text, and does not correspond to a column in my sql table.

I can't find anything in the books I am using.

Thanks in advance to anyone who responds.

Sally

Comments

  • raymcdraymcd Member Posts: 284
    : Hello folks,
    :
    : How do I add a column to a data grid that does not correspond to a column in my sql table. All the other columns in my data grid are from an sql table... I just want to bind a new column that contains text, and does not correspond to a column in my sql table.
    :
    : I can't find anything in the books I am using.
    :
    : Thanks in advance to anyone who responds.
    :
    : Sally
    :

    Two ways...

    First, add the column to the datatable in your dataset before binding the datagrid.

    or... Second, add a fake field to the sql like the following...

    select a, b, c, "" as FakeStringField from TableA

    This would create a field that is not in the table but will show up in the datagrid bound to the results.

    -Ray
Sign In or Register to comment.