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.
Unfortunately, activation email could not send to your email. Please try again.

invisible grid on partialrender

Thread ID:

Created:

Updated:

Platform:

Replies:

100617 Aug 18,2011 10:28 AM Sep 1,2011 12:25 PM ASP.NET MVC (Classic) 7
loading
Tags: Grid
Mark Treveil
Asked On August 18, 2011 10:28 AM

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)
@

ManageMeetingsViewModel







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





Mark Treveil
Replied On August 18, 2011 11:08 AM

A bit more info, the grid is invisible because of a dynamic style:


Sridhar N [Syncfusion]
Replied On August 19, 2011 08:29 AM

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.

Steps to avoid Grid Invisiblity in MVC-565716953.zip


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


Mark Treveil
Replied On August 19, 2011 01:09 PM

Yes, the BeginFormExt fixes it!
Thanks
mark


Mark Treveil
Replied On August 21, 2011 04:55 PM

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"


Thoughts?

Thanks
Mark




GridHangOnSorting_475b8f2d.zip

Sridhar N [Syncfusion]
Replied On August 24, 2011 02:43 AM

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.

GridHangOnSorting-1116247719.zip

Please let me know if you have any other questions or concerns.

Regards,
Sridhar.N




Mark Treveil
Replied On August 25, 2011 02:23 PM

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


Sridhar N [Syncfusion]
Replied On September 1, 2011 12:25 PM

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.

Please refer the document in below link.

How to Switch between MVC2 to MVC3

Query #3 "I have to say that your grid deserves some much more comprehensive documentation and better online samples"

We are improving our UG documentation for each version and we will improve it in our upcoming release.

Please let us know your concerns.

Regards,
Sridhar N


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.

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.

;