D
David
Hello,
I have a datagrid populated with rows from a view. Because they are from a
view, the rows are not actual database records, and therefore lack unique
identifiers.
So I have a command button for each row. When the button is pressed, I want
to go to another page with all the information in that selected row.
Normally I would do this (if the rows are actual records, that is)
//take the datakey value
string selected_id = dgMyDataGrid.DataKeys[e.Item.ItemIndex]
//and do this before tranfering to another page.
Context.Items.Add("uniquekey", selected_id);
Then on the second page, I would take the selected_id and retreive the
record from the database (I've always wondered if that trip to the database
server would be necessary).
But I can't even do this with rows from a view because there is no unique
identifier. But I still want to take the row from the view and give it to
the destination page.
I have a datagrid populated with rows from a view. Because they are from a
view, the rows are not actual database records, and therefore lack unique
identifiers.
So I have a command button for each row. When the button is pressed, I want
to go to another page with all the information in that selected row.
Normally I would do this (if the rows are actual records, that is)
//take the datakey value
string selected_id = dgMyDataGrid.DataKeys[e.Item.ItemIndex]
//and do this before tranfering to another page.
Context.Items.Add("uniquekey", selected_id);
Then on the second page, I would take the selected_id and retreive the
record from the database (I've always wondered if that trip to the database
server would be necessary).
But I can't even do this with rows from a view because there is no unique
identifier. But I still want to take the row from the view and give it to
the destination page.