display of the page(not insert the database), then click the "save" button outside
of the RadGrid ,then all the temporary display of data saved to the database?
Do you have example like this?or talk about it Detailed?
Thank you !!
3 Answers, 1 is accepted
One suggestion would be to store the Data from the Database to a Session and bind the Grid from the Session. So once you do Insert/Update/Delete operation only the session will be affected and not the database. And in the click event of the save button update the DB from the session, clear the session and Rebind the Grid.
I understand, Insert sucessful, but when I delete the provisional data accrossing your meaning, I have a mistake,"Table not have primary key", in fact , I set the dataKeyNames in the Front_code, This my behind_code below:
protected void rgTemplate_DeleteCommand(object source, GridCommandEventArgs e)
string customsCode = (e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CUSTOMS_CODE"].ToString();
DataTable templateTable = this.TemplateTable.Tables["TEMPLATE_TABLE"];
if (templateTable.Rows.Find(customsCode) != null) //this is a mistake,"table not have a primary key"
Where I have a mistake??Thank you!