Thank you for the quick response!
I'm still having the same issue after making the suggested changes. Any suggestions?
The code for the grid's DataBinding event is as follows:
protected void GridNotesAttachments_DataBinding(object sender, EventArgs e) { if (!IsPostBack) { try { EntNote note = (EntNote)Session["note"]; DataSet dsAttachments = new DataSet(); NotesBC bcNotes = new NotesBC(); dsAttachments = bcNotes.GetAttachmentsByNote(UserIdentity, (int)note.NoteId); DataView dvAttachments = dsAttachments.Tables[0].DefaultView; GridNotesAttachments.DataSource = dvAttachments; Session["attachments_collection"] = GridNotesAttachments.DataSource; } catch (Exception ex) { _vldSummary.AddException(ex); } } }
To briefly fill you in on why I'm doing things the way I am:
I'm using an unbound grid and is populating the grid using business object methods. In this part of the application when a user adds a row to the grid I do not wish to write that change immediately to the database, but want to save it in some temporary location (in this case I thought I would use the underlying grids dataview) and reflect the change visually on the grid. Only when the user explicitly clicks on a 'Save' button should the data changes be made to the database. I guess I'm doing this as I was unable to do any client side scripting on the grid, otherwise I could have just added the new row to the grid using JS (which leads me to another question, Is there going to be any client side API documentation for this grid?)
Also, the reason why I'm saving a copy of the grid's datasource DataView in Session is because I found that the grid doesnt retain its DataSource property on postbacks (is it supposed to?)
Thanks for your assistance.
Madusha