We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Unbound Column Editing with a dialog

    I am attempting to do something that seems like it should be simple but for some reason is defeating me.

What I would like is to combine Unbound column editing with dialog editing.  (and I would like to throw in some custom commands as well.)

Example:
I have a grid with data in it, I want my very last column to be a commands column which has a button (for now one) that when clicked allows the user to edit the record (similar to the unbound column editing example) however I would like the edit form to be displayed in a dialog as opposed to inline (there is data displayed that I don't want edited and data that is editable that is not displayed....)

When I attempt to do this the grid never moves into edit mode it just refreshes the grid... (this is because my saveaction in the controller grabs the latest data and returns the grid action...
See my sample code below....
GRID
@(Html.Syncfusion().Grid<FlashHeadAssemblyConfiguration>("FlashHeadAssemblyResultsGrid")
      .Datasource((IEnumerable<FlashHeadAssemblyConfiguration>)Model)
      .Column(columns =>
                  {
                      columns.Add(model => model.SerialNumber).AllowSearching(true).AllowFilter(true);
                      columns.Add(model => model.RecordedBy).AllowSearching(true).AllowFilter(true);
                      columns.Add(model => model.RecordedOn).AllowSearching(true).AllowFilter(true);
                      columns.Add("Commands"column =>
                                                  {
                                                      column.Commands(commands =>
                                                                          {
                                                                              commands.Command(CommandTypes.Edit);
                                                                              commands.ItemOption(UnboundItemOptions.ImagePlusText);
                                                                              commands.ItemType(UnBoundItemTypes.Button);
                                                                              commands.Text("Edit");
                                                                          });
                                                      column.Commands(commands =>
                                                                          {
                                                                              commands.Command(CommandTypes.Custom);
                                                                              commands.ItemOption(UnboundItemOptions.ImagePlusText);
                                                                              commands.ItemType(UnBoundItemTypes.Button);
                                                                              commands.Text("Print Labels");
                                                                          });
                                                  })
                                                  .AllowEditing(false)
                                                  .AllowFilter(false);
                  })
      .Editing(editing =>
                   {
                       editing.AllowEdit(true);
                       editing.AllowDelete(false);
                       editing.AllowNew(false);
                       editing.CloseOnEscape(true);
                       editing.EditMode(GridEditMode.Dialog);
                       editing.PrimaryKey(key => key.Add(model => model.SerialNumber));
                       editing.SaveOnEnter(false);
                       editing.Dialog(dialog =>
                                          {
                                              dialog.Draggable(true);
                                              dialog.Position(DialogPositions.Center);
                                              dialog.Resizable(false);
 
                                          });
                   })
      .Filtering(filtering =>
                     {
                         filtering.AllowFiltering(true);
                         filtering.FilterBarMode(FilterBarMode.Immediate);
                         filtering.FilterDropDownType(FilterDropDownType.SimpleList);
                         filtering.FilterMode(FilterMode.Default);
                         filtering.ShowFilterStatusMessage(true);
 
                     })
                     .PageSettings(paging =>
                     {
                         paging.AllowPaging(true);
                         paging.PageSize(10);
                         paging.PagerPosition(Position.BottomLeft);
                         paging.PagerStyle(PagerStyle.DefaultAndAdvanced);
                     })
      .AllowSearching(true)
      .Mappers(mapper => mapper.SaveAction("UpdateRecord"))
)
CONTROLLER ACTIONS(some)
        public ActionResult FlashHeadResults()
        {
            var resultsForGrid = _dataRetrieval.RetrieveMostRecentRecords().ToList();
 
            return PartialView(resultsForGrid);
        }
 
        [HttpPost]
        public ActionResult FlashHeadResults(PagingParams args)
        {
            var resultsForGrid = _dataRetrieval.RetrieveMostRecentRecords().ToList();
 
            return resultsForGrid.GridActions<FlashHeadAssemblyConfiguration>();
        }
 
        [HttpPost]
        public ActionResult UpdateRecord(FlashHeadAssemblyConfiguration recordToUpdate)
        {
            var resultsForGrid = _dataRetrieval.RetrieveMostRecentRecords().ToList();
 
            return resultsForGrid.GridActions<FlashHeadAssemblyConfiguration>();
        }


I know that other companies (such as Telerik) support this sort of interaction. Am I doing something wrong?

3 Replies

BM Bala Murugan A.S Syncfusion Team January 21, 2013 10:18 AM UTC

Hi Chris McNear,

 

Thanks for using Syncfusion Products.

 

We regret for the inconvenience caused. We are unable to reproduce your reported issue in our end. We have prepared a simple sample to demonstrate the unbound column with dialog editing and the same can be downloaded from the below link.

 

Demo Sample: UnboundColumn_DialogEditing.zip

 

Could you please try to reproduce your issue in the above sample and send back to us so that we could able to sort out the cause of this issue and provide you a better solutions quickly?.

 

Please let us know if you have any concerns.

 

Regards,

Bala Murugan A.S



CM Chris McNear January 21, 2013 03:29 PM UTC

Turns out the issue is related to editing as a whole. I can't get editing to work at all with my project (even using the toolbar....)  I have a support ticket in and hopefully it will be resolved soon, my guess is it has something to do with the complex objects and entity framework that I am using....



BM Bala Murugan A.S Syncfusion Team January 24, 2013 11:01 AM UTC

Hi Chris McNear,

Thanks for the update.

We suggest you to followup the incident '#103345 - Editing Not Working' regarding your issue.

Please let us know if you have any concerns.

Regards,
Bala Murugan A.S

Loader.
Live Chat Icon For mobile
Up arrow icon