The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Guys, I am doing something stupid, I am sure, but maybe someone can give me a pointer. I am using MVC 3 and latest Syncfusion 3.0
I have a view comprising: - a partial view displaying a server-mode grid, - an Ajax async form.
The idea is to submit the form to update the grid, adding a new row, without refreshing the whole page.
The whole page displays OK from the URL, but when I do the Ajax submit, the grid 'disappears'. The source of the page contains the updated HTML, with the newly added row, but is doesn't display - like the grid is hidden. The Browser debug tools show the grid rows to have a height and width, but nothing shows. It is the same on both Chrome and IE 9.
Any ideas? Thanks mark
Main View +++++++++
@Using (Ajax.BeginForm("MeetingsAddItem", New AjaxOptions With {.UpdateTargetId = "divMeetingsList"})) @Html.ValidationSummary(True) @
End Using
@Code Html.RenderPartial("MeetingListPartialView", Model.Meetings) End code
Controller extract: +++++++++++++++++++ _ Public Function MeetingsAddItem(oViewModel As ManageMeetingsViewModel) As ActionResult m_oManageMeetings.AddNewItem("Yes!!!!") Return PartialView("MeetingListPartialView", m_oManageMeetings.Meetings) End Function
A bit more info, the grid is invisible because of a dynamic style:
Mark
SNSridhar N Syncfusion Team August 19, 2011 12:29 PM UTC
Hi Mark,
Thanks for your interest in Syncfusion products.
Query #1 "the grid is invisible"
We have analyzed your code snippet and found that you have used Ajax.BeginForm, We suggest you to use Ajax.BeginFormExt. If the issue is reproduced still. Could you please check the conditions available in the document which can be downloaded from the below link.
Please get back to us with a sample reproducing the issue,if the issue retains after checking the conditions.So that we could sort out the issue and provide you with solution.The information provided would be of great help in resolving the issue.
Please let us know your concerns.
Regards, Sridhar N
MTMark TreveilAugust 19, 2011 05:09 PM UTC
Yes, the BeginFormExt fixes it! Thanks mark
MTMark TreveilAugust 21, 2011 08:55 PM UTC
Sorry, but there are still problems after a partial render.
If you run my sample attached (VS2010 MVC 3) and immediately start sorting the Title column up and down by clicking the header, all is fine.
If you press Partial Render, to do a PartialRender of the grid, then start sorting the Title again, it hangs the second time you clikc the title column header. I have stripped down the example - there is not much to it now, and used the mysterious BeginFormExt.
If you debug the client-side script, you can see it throwing errors such as:
"Unable to set value of the property 'id': object is null or undefined"
SNSridhar N Syncfusion Team August 24, 2011 06:43 AM UTC
Hi Mark,
Thanks for your update.
Query #1 "If you press Partial Render, to do a PartialRender of the grid, then start sorting the Title again, it hangs the second time you clikc the title column header"
We have analysed your sample and found that you have returned the partial view in grid sorting action. We suggest you to return the grid action to avoid this issue.Please refer the below code snippet.
[Controller] _ Public Function MeetingsAddItem(ByVal args As PagingParams, ByVal oViewModel As ManageMeetingsViewModel) As ActionResult Dim data As IEnumerable If (args.RequestType > 0) Then m_oManageMeetings.AddNewItem("This is a new row") data = CType(m_oManageMeetings.Meetings, IEnumerable) Return data.GridActions(Of Object)() Else m_oManageMeetings.AddNewItem("This is a new row") Return PartialView("MeetingListPartialView", m_oManageMeetings.Meetings) End If End Function
For your convenience, we have created sample and the same can be downloaded from the following link.
Please let me know if you have any other questions or concerns.
Regards, Sridhar.N
MTMark TreveilAugust 25, 2011 06:23 PM UTC
Sridhar.N
Thanks. Fascinating. Is what I was doing 'wrong' in MVC terms, or this a current limitation of the grid logic? My approach matches that in the general blogs on MVC async partial rendering. I was using your approach for the sorting callback, but only because I blindly copied your example code.
I don't really understand the difference between
PartialView(mgObjList) and mgObjList.GridActions()
Indeed, what is ienumerable.GridActions()? The class reference says "Used to Generate Grid in Callbacks.", which is not giving much away.
I have to say that your grid deserves some much more comprehensive documentation and better online samples. MVC 3, async partial rendering, resizing, and interaction is pretty important to people like myself, the this stuff really isn't really covered. The current client-side example is of no use all. None of the examples even select a row on main render.
The class reference is pretty much a useless, auto-generated interface listing. While I appreciate all the help I am getting, some proper explanations and samples would save most of this.
I also don't understand why you guys persist with MVC 2 / APSX examples. The big take up this environment going to be from now onwards and in Razor. It is VB2 versus VB3 all over again.
You've got some good controls, but even I was starting to look around an wonder if it might be easier to make progress with another toolkit, like Telerik, with some better documentation.
Thanks Mark
SNSridhar N Syncfusion Team September 1, 2011 04:25 PM UTC
Hi Mark,
Thanks for your update.
Query #1 "The class reference says "Used to Generate Grid in Callbacks.", which is not giving much away."
The class reference for GridAction is correct. Since we use asynchronous partial rendering we need GridAction to return the actionresult.
Query #2 "Don't understand why you guys persist with MVC 2 / APSX examples."
We have samples in ASPX and razor having support for both MVC2 and MVC3. We have switching support for MVC2 and MVC3 for our samples.