I have embedded a WebGrid into a SharePoint web part and it works OK - I create the grid programatically and add it using CreateChildControls method.
I have one issue which is after I add my WegGrid-containing web part to the MOSS page. I do this in MOSS via Site Actions - Edit Page and edit the web part page, click a web part zone and pick my web part to add it. It goes onto the page fine, but I can't close the web part using the X in the top right corner. I can add other built-in web parts to the page and close them OK, e.g. content query web part, content editor web part etc. But when I try to close my own web part in MOSS the browser doesn't post back and just does nothing. The same thing happens if I click the Edit dropdown and select Close or Delete - again the web part is not removed from the page.
I know this isn't a MOSS forum but I wonder if anyone else has had this problem? Seems like it might be to do with Javascript on the page?
The browser is IE7. Firefox doesn't have the same issue but you need to use IE really for MOSS work.
Thanks for sharing the solution Lars - I've updated the "Known Issues" forum with your findings - surely will be useful to a lot of people.
Thanks again.
Ok I installed NetAdvantage 2008 Volume 2 and that has finally fixed the problem. Volume 2 installs as a separate product from Volume 1 and I upgraded my project to use the Volume 2 controls using the project upgrade utility. I didn't change any of my code, and I do not explicitly set the ID of the webgrid in code. By referencing volume 2 version of the webgrid it now closes correctly when embedded into a webpart.
Thanks for your help and advice
Thanks Todd. I have MOSS SP1. I have downloaded volume 2 as you suggested and installed it but it doesn't seem to go over the top of Volume 1 - Volume 2 pops up as a separate product. Should I uninstall Vol 1 first and then install Vol 2?
Quick followup. Make sure you have SP1 installed for SharePoint (MOSS). The service pack include support for running AJAX based web parts and includes a number of JavaScript related fixes.
Let us know if this works for you.
Direct Link to the sample: http://users.infragistics.com/tsnyder/SharePointAJAX/Sample-AJAX-Grid.zip