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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unbound Column Editing with a dialog

Thread ID:

Created:

Updated:

Platform:

Replies:

106603 Jan 17,2013 07:32 PM UTC Jan 24,2013 11:01 AM UTC ASP.NET MVC (Classic) 3
loading
Tags: Grid
Chris McNear
Asked On January 17, 2013 07:32 PM UTC

    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?

Bala Murugan A.S [Syncfusion]
Replied On 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


Chris McNear
Replied On 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....


Bala Murugan A.S [Syncfusion]
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;