Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
289
Over riding DisplayPromptMessage for record deletion
posted

 I need to show the user which datarecord he has selected for deletion. For that I think I have to over ride the DisplayPromptMessage to add in some information of the selected record so that the user clearly sees which record is about to be deleted.

Thanks

amdalian 

 

Parents
No Data
Reply
  • 1635
    posted

    Hi there

    You can just add a handler to the grid's RecordsDeleting method and prompt yourself. In that case, don't forget to set the e.Cancel property to true, or the prompt will appear anyway:

     

         /// <summary>
        /// A grid event handler, which can be bound to the corresponding event
        /// of an editor grid in order to handle deletion on all selected items.
        /// </summary>
        protected virtual void OnRecordsDeleting(object sender, RecordsDeletingEventArgs e)
        {
          //delegate deletion

          List<ISynchronizableEntity> list = new List<ISynchronizableEntity>(e.Records.Count);
          foreach (DataRecord record in e.Records)
          {
            list.Add((ISynchronizableEntity) record.DataItem);
          }

          MyDeletionHandler(list);
          e.Cancel = true;
        }

     

    hth,

    Philipp 

Children
No Data