G
Gary Frank
Is is possible to create an ASP.NET datagrid that mixes bound data
pulled from a database table with an unbound column created by the
program?
I would like to display several columns from an SQL Server database
table (table 1) in an ASP.NET datagrid control. I would also like to
display an additional column in the datagrid. The value for the
additional column would be generated by plugging values from a couple
of columns in the row in table 1 into an SQL SELECT query that selects
rows from a different table (table 2), and then performs a calculation
that produces the value for the additional column. (The value for the
additional column in each row is based on values in other columns in
that row that came from table 1.) I want the user to be able to use
the edit, update and delete buttons in the datagrid to process the
columns that came from table 1, but not table 2.
Is this possible? Can you add an unbound column to a table that is
bound to a database table? And if you do so, can you use the edit,
update, delete buttons in the datagrid to update the datasource (the
database table) for the columns that came from table 1?
What would be the best way to go about this? Would it be best to
generate a dataset from a data adapter, then add a column to the
datatable in the dataset? I think you have to do this programatically.
Would you then bind the dataset/datatable to the datagrid?
Or can you bind a datatable to a datagrid, then add an additional
column to the datagrid? If you did this, could you do a SELECT on
table 2 in order to create the value for the additional column?
pulled from a database table with an unbound column created by the
program?
I would like to display several columns from an SQL Server database
table (table 1) in an ASP.NET datagrid control. I would also like to
display an additional column in the datagrid. The value for the
additional column would be generated by plugging values from a couple
of columns in the row in table 1 into an SQL SELECT query that selects
rows from a different table (table 2), and then performs a calculation
that produces the value for the additional column. (The value for the
additional column in each row is based on values in other columns in
that row that came from table 1.) I want the user to be able to use
the edit, update and delete buttons in the datagrid to process the
columns that came from table 1, but not table 2.
Is this possible? Can you add an unbound column to a table that is
bound to a database table? And if you do so, can you use the edit,
update, delete buttons in the datagrid to update the datasource (the
database table) for the columns that came from table 1?
What would be the best way to go about this? Would it be best to
generate a dataset from a data adapter, then add a column to the
datatable in the dataset? I think you have to do this programatically.
Would you then bind the dataset/datatable to the datagrid?
Or can you bind a datatable to a datagrid, then add an additional
column to the datagrid? If you did this, could you do a SELECT on
table 2 in order to create the value for the additional column?