WebGrid Context-Menu won't work

1 reply. Last post: July 1, 2014 3:24 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Daniel JorgeMember

Good day,

     I'm trying to enable a custom ContextMenu on my WebGrid and it simply won't work. 

    Goal: context-menu to show an "edit" option, which will open an ajaxToolkit ModalPopup allowing me to edit the row (there is more info in this window than presentable in the grid, so editing the grid cells is not enough). Clicking "Ok" on the modalPopup will save the object and update the database. I'm using customObject, not ISDataSource or anything like that. 

     Here's what I've tried, and the problems each solution is presenting.

1. Create my own context menu, and attach to the WebGrid. (KB: http://www.intersoftpt.com/Support/WebGrid/KBArticle/Create-your-own-specific-row-context-menu-on-WebGrid/)

    a. The sample downloaded from the page will show the context-menu on upper-left corner on Chrome, FireFox and Safari. Won't show anything on IE.

    b. When it opens up in the wrong place, I click the option I want to activate and it won't do anything. My code was updated to have an OnMenuItemClicked event coded. AutoPostBostBack is set to "Yes". The event is not called on the server-side

2. Tried to change the built-in context menu of the grid (KB: http://www.intersoftpt.com/Support/WebGrid/Tutorial/Text/Customize-Context-Menu/ )  

    a. There are options that won't even detect the mouse-hover to change the option style

    b. Clicking on any option won't call any client-side nor server-side event. I need server-side, but couldn't even make an "alert('Hello world');" to work here.

3. Added a ButtonColumn and tried to make it work from there

    a. The effect is ugly and un-wanted, but it calls the server side events. But the ajaxToolkit modalPopup simply will not show up. I'm using the server-side "Show()" method to show it and it won't work

    b. I isolated the ModalPopup panel in a new page, added a button a called the "Show()" method on the server side from it, and it worked as expected. Made me think the problem is associated with the WebGrid.

One favor I ask: if you're providing help here, please do attach sample codes so I can see what you see. I've browsed through some posts and people suggest lots of things and the discussion goes for over 1 week until they find out it's something simple in the code that was not provided. I don't want to lose two or three weeks to solve something potentially simple.


     Thank you very much


D

All times are GMT -5. The time now is 3:53 PM.
Previous Next