Jump to content
Software FX Community

mgamage

Members
  • Posts

    6
  • Joined

  • Last visited

mgamage's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. 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
  2. Hello, My company has purchased GridFX and is using it in several locations in our web application. I'm currently developing a new module that requires in place editing of rows in the grid. I have followed the instructions in the Programmers Guide and implemented the 'onitemupdating' event as follows : protected void GridNotesAttachments_ItemUpdating(object sender, GridItemUpdatedEventArgs e) { if (GridNotesAttachments.Items.Count > 0) { if (!e.OldValues["attachment_desc"].ToString().Equals(e.NewValues["attachment_desc"].ToString())) { EntNoteAttachment attachment = new EntNoteAttachment(); attachment.NoteId = (int)e.OldValues["note_id"]; attachment.AttachmentId = (int?)e.Keys["attachment_id"]; attachment.Description = e.NewValues["attachment_desc"].ToString(); attachment.FileName = e.OldValues["attachment_name"].ToString(); attachment.FilePath = e.OldValues["attachment_loc"].ToString(); DataView dvAttachments = new DataView(); dvAttachments = (DataView)Session["attachments_collection"]; dvAttachments.Sort = "attachment_id"; int rowIndex = 0; rowIndex = dvAttachments.Find(attachment.AttachmentId); dvAttachments.Delete(rowIndex); DataRowView newRow = dvAttachments.AddNew(); newRow["note_id"] = NoteId; newRow["attachment_id"] = attachment.AttachmentId; newRow["attachment_desc"] = attachment.Description; newRow["attachment_name"] = attachment.FileName; newRow["attachment_loc"] = attachment.FilePath; newRow.EndEdit(); GridNotesAttachments.DataSource = dvAttachments; Session["attachments_collection"] = GridNotesAttachments.DataSource; e.KeepInEditMode = false; } else { e.ErrorMessage = "No changes made."; } } } When I try to edit a row in place, and click on the ok symbol on the edit widget , I get the following error message : " There was a problem while processing your request. The specific error message was: There was an error in the callback." Can you please provide some guidance as to why its doing this and what I might be doing wrong. ThanksMadusha
×
×
  • Create New...