This is a migrated thread and some comments may be shown as answers.

RadAjaxmanager prometheus (2008 Q2) Collection was modified; enumeration operation may not execute error.

21 Answers 333 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rajdeep
Top achievements
Rank 1
Rajdeep asked on 05 Aug 2008, 11:52 AM
Hi Telerik team,

I am upgrading my telerik controls from classic to prometheus (2008 Q2).
i upgraded my radajaxmanager classic to prometheus all other controls are the classic release.

and i am receiving this error.

Collection was modified; enumeration operation may not execute.   at System.Web.UI.ControlCollection.ControlCollectionEnumerator.MoveNext()
   at Telerik.WebControls.RadMultiPage.ClearControls()
   at Telerik.WebControls.RadMultiPage.Render(HtmlTextWriter output)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Control.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Control.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


looking forward for a reply asap.

regards,
ishwar

21 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 06 Aug 2008, 06:37 AM
Hi Ritz,

Thank you for posting the stack trace of the error.

Unfortunately it will be hard to determine what is causing it without additional info. The error in ASP.NET Framework is generally thrown in case someone modifies an enumeration while moving to its next element but we are not aware of a similar problem with the RadControls.

Anyway, it seems you still work with the RadTabStrip for ASP.NET along with the new RadAjax for ASP.NET AJAX. Can you please upgrade the TabStrip/MultiPage controls as well and see how it goes? If that doesn't help we will need more information regarding your scenario. You can start with pasting the AJAX settings of RadAjaxManager along with additional info regarding your application configuration.

Regards,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rajdeep
Top achievements
Rank 1
answered on 06 Aug 2008, 08:40 AM
Hi Konstantin,

Thanks, we solved the problem but now i am facing a new problem
i have a user control it contains telerik grid,radajaxmanager (Q2) in WSS.

my gird stops working aftre first ajax call nothing happens scrolling,paging all stops working.

here is the code.

<%@ control language="C#" autoeventwireup="true" inherits="TestPrometheus, App_Web_testprometheus.ascx.cdcab7d2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<table><tr> 
        
         <td> 
             <telerik:RadCodeBlock ID="RadCodeBlock1"  runat="server">
<script type="text/javascript" language="javascript">
    function AddNew(pName,level)
    {
       var oWindow = window.radopen(pName + "?Level=" + level, "newWin");
    }
    function CallingAjax(mode, guid, level, url)
    {
       BusinessRequest(mode,guid, level, url);
       return false;
    }
    function refreshGridLevel1(arg)
    {
        if(!arg)
        {
            window["<%=RadGridLevel1.ClientID%>"].AjaxRequest('<%= RadGridLevel1.UniqueID%>', 'Rebind');
        }
        else
        {
            window["<%=RadGridLevel1.ClientID%>"].AjaxRequest('<%= RadGridLevel1.UniqueID%>', 'RebindAndNavigate');
        }
    }
</script>

<script type="text/javascript">
            <!--
            function RadGrid1_Scroll(sender, args)
            {
              if(args.get_isOnBottom())
              {
                var currentlyDisplayedRecords = sender.get_masterTableView().get_pageSize() * (sender.get_masterTableView().get_currentPageIndex() + 1);
               
                //if the presently visible items are less than the entire source records count
                //trigger an ajax request to increase them
                if(currentlyDisplayedRecords < 10)
                {
                  var newPageSize = sender.get_masterTableView().get_pageSize() + 10;
                  sender.get_masterTableView().set_pageSize(newPageSize);
                }
              }
            }

             function CustomAction()
             {
                 alert("Custom Action Triggered");
             }
             --> 
        </script>

</telerik:RadCodeBlock> 
         </td> 
     </tr> 
</table>
<table class="basecontrol" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td class="basecontrolTopLeft">
        </td>
        <td class="basecontrolTitle">
  <table cellpadding="0" cellspacing="0">
  <tr>
  <td class="basecontrolTitle"><asp:HyperLink runat="Server" ID="lblMainTitle" Text=""></asp:HyperLink>
  </td>
  <td class="AddLink"><asp:HyperLink runat="server" ID="hplAddLink" Text=""></asp:HyperLink>
  </td>
  </tr>
  </table>
        </td>
        <td class="basecontrolTopRight">
        </td>
    </tr>
    <tr>
        <td class="basecontrolSide">
        </td>
        <td class="basecontrolContent">
<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>

<telerik:RadGrid ID="RadGridLevel1" GridLines="Both" AllowMultiRowSelection="False"
runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false"
PageSize="20" Height="480px" OnItemDataBound="RadGridLevel1_ItemDataBound" Skin="">

<PagerStyle CssClass="RMPRadGridPager" Mode="NumericPages"></PagerStyle>
<HeaderStyle CssClass="RMPRadGridHeader"></HeaderStyle>
<ItemStyle CssClass="RMPRadGridItem"></ItemStyle>
<AlternatingItemStyle CssClass="RMPRadGridAltItem"></AlternatingItemStyle>
<FooterStyle CssClass="RMPRadGridFooterStyle"></FooterStyle>
<SelectedItemStyle CssClass="RMPRadGridSelectedItem" />
<GroupHeaderItemStyle BorderColor="Black" BackColor="Silver"></GroupHeaderItemStyle>

<MasterTableView Width="100%">
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:Image ID="Thumbnail" ImageUrl='<%# "/" + ConfigurationManager.AppSettings["ImageLibraryHttpPath"] + Convert.ToString(DataBinder.Eval(Container.DataItem, "_Thumbnail")) %>'
Height="50" Width="50" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Title" HeaderText="Title" SortExpression="Title">
<ItemTemplate>
<telerik:RadMenu ID="RadMenu1" runat="server" ClickToOpen="true" CollapseDelay="0"
EnableTheming="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="Created" SortExpression="Created" HeaderText="Created On"
DataField="Created" DataFormatString="{0:MM/dd/yyyy}" />
<telerik:GridBoundColumn UniqueName="Author" SortExpression="Author" HeaderText="Created By"
DataField="Author" />
</Columns>
</MasterTableView>
<ClientSettings AllowColumnsReorder="True">
<ClientEvents OnScroll="RadGrid1_Scroll" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True" />
</ClientSettings>
</telerik:RadGrid>
</td>
         <td class="basecontrolSide"></td>
    </tr>
     <tr>
          <td class="basecontrolBotLeft"></td>
          <td class="basecontrolFooter"></td>
          <td class="basecontrolBotRight"></td>
        </tr>
       
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <windows>
                        <telerik:RadWindow ID="newWin" runat="server" Title="New Site" Height="700px"
                        Width="900px" Top="0px" Left="100px" ReloadOnShow="true" Modal="true"  />
                    </windows>
        </telerik:RadWindowManager>

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGridLevel1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGridLevel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                Width="75px" Transparency="25">
                <img alt="Loading..." src='<%= originalAttribute="src" originalPath="'<%=" RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0;" />
            </telerik:RadAjaxLoadingPanel>
</table>

=====================================================

using

System;

using

System.Data;

using

System.Configuration;

using

System.Collections;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Web.UI.HtmlControls;

using

Telerik.QuickStart;

using

Telerik.Web.UI;

using

RMP.SPWrapper;

using

Microsoft.SharePoint;

public

partial class TestPrometheus : System.Web.UI.UserControl

{

DataTable dtItems = null;

RMP.RMPLogging.

RMPLogging objLogs = new RMP.RMPLogging.RMPLogging();

int iPageSize = 0;

public String sTitle = String.Empty;

public String sAddLink = String.Empty;

RMP.SPWrapper.

Roles objRoles = null;

RMP.DataObject.

Permissions objPermissions = null;

protected void Page_Load(object sender, EventArgs e)

{

sTitle =

ConfigurationManager.AppSettings["Level1WPTitle"];

lblMainTitle.Text = sTitle;

lblMainTitle.NavigateUrl =

SPContext.Current.Web.Url + ConfigurationManager.AppSettings["SiteCollectionUrl"] + "?Level=1";

 

objRoles =

new RMP.SPWrapper.Roles();

objPermissions = objRoles.CheckPermissions(

"Level1");

sAddLink =

"Add New";

if (objPermissions.Create)

{

hplAddLink.Attributes.Add(

"OnClick", "AddNew('" + ConfigurationManager.AppSettings["NewSiteUrl"] + "','1')");

hplAddLink.Text = sAddLink;

}

iPageSize =

Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]);

RadGridLevel1.PageSize = iPageSize;

dtItems =

new DataTable();

RMP.SPWrapper.

List objWrapper = new RMP.SPWrapper.List();

dtItems = objWrapper.GetListItemsByLevel(

ConfigurationManager.AppSettings["Level1Type"]);

RadGridLevel1.DataSource = dtItems;

RadGridLevel1.DataBind();

}

protected void RadGridLevel1_ItemDataBound(Object sender, Telerik.Web.UI.GridItemEventArgs e)

{

if (e.Item is GridItemType)

{

RadMenu rdMenu = (RadMenu)e.Item.FindControl("RadMenu1");

if (rdMenu != null)

{

string sTitle = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "Title"));

rdMenu.Items.Add(

new RadMenuItem(sTitle));

RadMenuItem menuItem1 = new RadMenuItem();

menuItem1.Text =

"Details";

menuItem1.NavigateUrl =

Convert.ToString(DataBinder.Eval(e.Item.DataItem, "_Url"));

rdMenu.Items[0].Items.Add(menuItem1);

RadMenuItem menuItem2 = new RadMenuItem();

menuItem2.Text =

"Add to Priority";

menuItem2.Attributes.Add(

"onClick", "javascript:return CallingAjax('1','" + DataBinder.Eval(e.Item.DataItem, "ID") + "','Level1','" + SPContext.Current.Web.Url + "')");

rdMenu.Items[0].Items.Add(menuItem2);

RadMenuItem menuItem3 = new RadMenuItem();

menuItem3.Text =

"Make a Copy";

menuItem3.NavigateUrl =

"pqr";

rdMenu.Items[0].Items.Add(menuItem3);

//if (objPermissions.Delete)

//{

// RadMenuItem menuItem4 = new RadMenuItem();

// menuItem4.Text = "Delete";

// menuItem4.NavigateUrl = "xyz";

// rdMenu.Items[0].Items.Add(menuItem4);

//}

}

}

}

}

regards,

ishwar

0
Konstantin Petkov
Telerik team
answered on 06 Aug 2008, 10:04 AM
Hi Ritz,

This code needs update. The built-in AJAX mode in RadGrid along with the relevant properties/methods client and server-side are not available in the RadGrid for ASP.NET AJAX version. We got too many confused customers when it comes to AJAX-enable their application containing RadGrid control which AJAX mode is turned on and they use or should use other AJAX controls like RadAjax framework. As you are probably aware, the Grid was unable to update other controls on the page when its AJAX mode was turned on. To fix all these, we decided to remove the AJAX mode in RadGrid in the new version and avoid the confusion.

You can use RadAjaxManager control to AJAXify your Grid or any other controls on the page. Please review the RadAjax client-side API page here as well. You will find the updated examples (all of them using RadAjax controls) live here:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Default/DefaultCS.aspx

I also suggest you review the Migration from RadGrid "Classic" to AJAX version help article. It will helpfully guide you through the migration process of RadGrid control.

Greetings,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rajdeep
Top achievements
Rank 1
answered on 06 Aug 2008, 01:00 PM
Hi Konstantin,

I made all the changes required to upgrade to Q2 release.but as soon as i deploy my user control in sharepoint only first ajax request is fired successfully.

ex: virtual scrolling is true in my grid but it reterieves only first page and everything stops working.

i removed all old properties/attributes from grid.

My server installation is : WSS/Framework 3.5/VS 2005

waiting for your help.

regards,
ishwar


<%@ control language="C#" autoeventwireup="true" inherits="TestPrometheus, App_Web_testprometheus.ascx.cdcab7d2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<table><tr> 
        
         <td> 
             <telerik:RadCodeBlock ID="RadCodeBlock1"  runat="server">
<script type="text/javascript" language="javascript">
    function AddNew(pName,level)
    {
       var oWindow = window.radopen(pName + "?Level=" + level, "newWin");
    }
    function CallingAjax(mode, guid, level, url)
    {
       BusinessRequest(mode,guid, level, url);
       return false;
    }
   
</script>

<script type="text/javascript">
            <!--
            function RadGrid1_Scroll(sender, args)
            {
              if(args.get_isOnBottom())
              {
                var currentlyDisplayedRecords = sender.get_masterTableView().get_pageSize() * (sender.get_masterTableView().get_currentPageIndex() + 1);
                //if the presently visible items are less than the entire source records count
                //trigger an ajax request to increase them
                if(currentlyDisplayedRecords < 51)
                {
                  var newPageSize = sender.get_masterTableView().get_pageSize() + 10;
                  sender.get_masterTableView().set_pageSize(newPageSize);
                }
              }
            }

             --> 
        </script>

</telerik:RadCodeBlock> 
         </td> 
     </tr> 
</table>
<table class="basecontrol" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td class="basecontrolTopLeft">
        </td>
        <td class="basecontrolTitle">
  <table cellpadding="0" cellspacing="0">
  <tr>
  <td class="basecontrolTitle"><asp:HyperLink runat="Server" ID="lblMainTitle" Text=""></asp:HyperLink>
  </td>
  <td class="AddLink"><asp:HyperLink runat="server" ID="hplAddLink" Text=""></asp:HyperLink>
  </td>
  </tr>
  </table>
        </td>
        <td class="basecontrolTopRight">
        </td>
    </tr>
    <tr>
        <td class="basecontrolSide">
        </td>
        <td class="basecontrolContent">

<telerik:RadGrid ID="RadGridLevel1" GridLines="Both" AllowMultiRowSelection="False"
runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false"
PageSize="20" Height="480px" OnItemDataBound="RadGridLevel1_ItemDataBound" >

<MasterTableView AutoGenerateColumns="False" TableLayout="Fixed">

                    <PagerStyle Visible="true" />
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:Image ID="Thumbnail" ImageUrl='<%# "/" + ConfigurationManager.AppSettings["ImageLibraryHttpPath"] + Convert.ToString(DataBinder.Eval(Container.DataItem, "_Thumbnail")) %>'
Height="50" Width="50" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Title" HeaderText="Title" SortExpression="Title">
<ItemTemplate>
<telerik:RadMenu ID="RadMenu1" runat="server" ClickToOpen="true" CollapseDelay="0"
EnableTheming="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="Created" SortExpression="Created" HeaderText="Created On"
DataField="Created" DataFormatString="{0:MM/dd/yyyy}" />
<telerik:GridBoundColumn UniqueName="Author" SortExpression="Author" HeaderText="Created By"
DataField="Author" />
</Columns>
<ExpandCollapseColumn Visible="False" Resizable="False">
                    </ExpandCollapseColumn>
                    <RowIndicatorColumn Visible="False">
                    </RowIndicatorColumn>
                </MasterTableView>

<ClientSettings AllowColumnsReorder="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True" />
<ClientEvents OnScroll="RadGrid1_Scroll" />
</ClientSettings>
</telerik:RadGrid>
</td>
         <td class="basecontrolSide"></td>
    </tr>
     <tr>
          <td class="basecontrolBotLeft"></td>
          <td class="basecontrolFooter"></td>
          <td class="basecontrolBotRight"></td>
        </tr>
       
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                    <windows>
                        <telerik:RadWindow ID="newWin" runat="server" Title="New Site" Height="700px"
                        Width="900px" Top="0px" Left="100px" ReloadOnShow="true" Modal="true"  />
                    </windows>
        </telerik:RadWindowManager>

 <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGridLevel1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGridLevel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                Width="75px" Transparency="25">
                <img alt="Loading..." src='<%= originalAttribute="src" originalPath="'<%=" RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0;" />
            </telerik:RadAjaxLoadingPanel>
</table>



0
Konstantin Petkov
Telerik team
answered on 06 Aug 2008, 02:46 PM
Hi Ishwar,

Indeed, the code looks correct know. Do you get the problem in SharePoint only? Have you tried adding that in a simple WebUserControl on a separate project?

I'd put the AJAX Manager on the page and add AJAX Manager Proxy control in the user control. See the articles here and here for details.

Greetings,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rajdeep
Top achievements
Rank 1
answered on 07 Aug 2008, 07:19 AM
Hi Konstantin,

Yes this control work fine in a web project.but as soon as i put this user control in sharepoint it stops working.

i believe RadAjaxmanager somewhere conficts with sharepoint master page located in (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL).

what i did was i removed the master page from the content pages and it started working.

but surprisingly radajaxmanager classic version is working fine in sharepoint but it breaks the page layout i believe this is a reported issue with telerik.

Can you please test this behaviour at your end any try replicate this issue.

Any help very much appreciated Konstantin, as this is now becoming a pain in my neck i cant roll back this functionality this is something promised to the clinet.

waitng for your reply.

regards,
ishwar
0
Rajdeep
Top achievements
Rank 1
answered on 08 Aug 2008, 05:29 AM
Hi Konstantin,

Any updates on my reported issue.

ishwar
0
Konstantin Petkov
Telerik team
answered on 08 Aug 2008, 08:16 AM
Hello Ishwar,

Have you tried the RadAjaxManager proxy control instead? The markup is pretty simple:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGridLevel1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGridLevel1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 

You just need to put RadAjaxManager in the MasterPage itself. There should be also ScriptManager placed after the WebPartManager to run this.

I hope this helps!

Greetings,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Larry
Top achievements
Rank 2
answered on 11 Aug 2008, 08:58 PM
I am having the exact same issue.  My EditForm will work ONE time in SharePoint 2007 and then everything stops working.  I am using IE6. 

If I save the information the first time, select another item, click the Edit button on the Grid, the checkbox disappears on the selected item and an Edit form never appears.

If I click the REFRESH button on the Browser, the Edit form suddenly appears.  It is almost as if the Visible property is never set on the Edit form after the first time.
0
Rajdeep
Top achievements
Rank 1
answered on 12 Aug 2008, 08:05 AM
Hi larry,

here is a workaround for this.

In master page "<form runat="server" onSubmit="return _spFormOnSubmitWrapper();">"

Rempve the text in red from the form tag.

1)Place the scriptmanager and radajaxmanager in master page.
2)radajaxmanagerproxy in the page.

hope this will solve your problem.

ishwar
0
Larry
Top achievements
Rank 2
answered on 12 Aug 2008, 12:00 PM
I am not sure what this javascript does in SharePoint, but won't removing this from the master page cause other pages in the site to not work properly?
0
Larry
Top achievements
Rank 2
answered on 12 Aug 2008, 12:45 PM
The code modification you provided worked for the edit form, but the Add does not work.  You have any idea what might be causing that problem?
0
Rajdeep
Top achievements
Rank 1
answered on 13 Aug 2008, 08:34 AM
can you post you code here too.?
0
Larry
Top achievements
Rank 2
answered on 13 Aug 2008, 12:50 PM
Sure.  First I will provide you with some background on how I am deploying the code.  Patrick Tisseghem create a webpart called Smart Part that can be used to easily deploy Web User controls for a SharePoint site.  There are 2 flavors of the webpart called SmartPart and SmartPart with AJAX.

I have installed MS AJAX and deployed and enabled the SmartPart feature. The newest version is 1.3 and documentation is provided by Patrick here and the download of the SmartPart can be found at CodePlex.

I have created an AJAX Control Toolkit WebSite using Visual Studio 2008 and have made all changes to the web.config to include AJAX and Telerik controls. Then I added a Web User Control to the project and started to implement a RadTabStrip with RadGrids (Web Grid) on each tab.  I have tried to change the name of each object to be unique, such as in the CommandItemTemplate.

To deploy the code to SharePoint:
  1. I created a blank site
  2. Made needed changes to the web.config to enable AJAX and Telerik controls
  3. Created the "usercontrols" directory under the InetPub VirtualDirectories for the port of the site in order to move the Visual Studio "Web User Control" code (this is documented at CodePlex)
  4. Added a directory under the "usercontrols" directory for Images  used in the CommandItemTemplate
  5. Commented out the Telerik RadScriptManager and the RadAjaxManager in the following ASPX code (because these are handle by the SmartPart with AJAX)
  6. Moved the ASPX and VB code for the control to the "usercontrols" directory
  7. Added a SmartPart with AJAX to the Default.aspx page
  8. Made the suggested changes you provided in a previous post to my default.master page
  9. Added the "Web User Control" to the "SmartPart with AJAX" using the "open tool pane" of the SmartPart
  10. And finally had a Telerik RadTabStrip with multiple RadGrids on a SharePoint site (which is FANTASTIC by the way)

Here is the ASPX Code:

<%@ Control Language="VB"
    AutoEventWireup="true"
    CodeFile="Administration.ascx.vb"
    Inherits="LostOpportunity_Administration" %>
   
<%@ Register
    Assembly="Telerik.Web.UI"
    Namespace="Telerik.Web.UI"
    TagPrefix="telerik" %>   

<%@ Register
    Assembly="AjaxControlToolkit"
    Namespace="AjaxControlToolkit"
    TagPrefix="ajaxToolkit" %>
   
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" />       
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />
       
        <%--        
       

       
        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        --%>

        <telerik:RadAjaxLoadingPanel
            ID="RadAjaxLoadingPanel1" runat="server"
            Height="75px" Width="75px" style="position:static;"
            Transparency="1" 
            MinDisplayTime="750" InitialDelayTime="1">
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' originalAttribute="src" originalPath="<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>" style="border:1;" />
        </telerik:RadAjaxLoadingPanel>  
              
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <AjaxSettings>    
                <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"
                            loadingpanelid="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"
                            loadingpanelid="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2"
                            loadingpanelid="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid3">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid3"
                            loadingpanelid="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>               
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy> 

        <telerik:RadTabStrip ID="RadTabStrip1"  
            MultiPageID="RadMultiPage1"
            runat="server" Skin="Outlook"
            SelectedIndex="0" >
            <Tabs>
                <telerik:RadTab runat="server"
                    Text="Loss Types" PageViewID="RadPageView1" Selected="True">
                </telerik:RadTab>
               
                <telerik:RadTab runat="server"
                    Text="Question Types" PageViewID="RadPageView2">
                </telerik:RadTab>
               
                <telerik:RadTab runat="server"
                    Text="Survey Layout" PageViewID="RadPageView3">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>       

        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" >
            <telerik:RadPageView ID="RadPageView1" runat="server" >
       
                 <%-- The RADGRID can have the DATASOURCEID set in the ASP page or
                     have the ONNEEDDATASOURCE set to call a module.  One overrides
                     the other, so if DataSourceID is set OnNeedDataSource will not
                     fire.
                --%>      
       
                <telerik:RadGrid  DataSourceID="SqlDataSource1"
                    ID="RadGrid1" width="97%"
                    EnableLinqExpressions="False"
                    Skin="Office2007"
                    AllowFilteringByColumn="True"
                    AllowPaging="True"
                    AllowSorting="True"
                    AllowAutomaticDeletes="true"
                    AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true"
                    PageSize="8"
                    ShowGroupPanel="False"                   
                    ShowStatusBar="True"
                    GridLines="None"
                    runat="server" AutoGenerateColumns="False">
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <ItemStyle
                        BackColor="White"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <AlternatingItemStyle
                        BackColor="#FFCC99"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <MasterTableView  
                        AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true"
                        AllowAutomaticUpdates="true"
                        CommandItemDisplay="Top"
                        DataKeyNames="lossTypeID"
                        DataSourceID="SqlDataSource1"
                        EditMode="PopUp"
                        AutoGenerateColumns="False"
                        Width="100%">
                       
                        <CommandItemTemplate>
                            <div style="padding:10px 0px;">
                                Custom command item template &nbsp;
                                <asp:LinkButton ID="btnEditSelected_1" runat="server"
                                    CommandName="EditSelected"
                                    Style="vertical-align: bottom" 
                                    CausesValidation="false"
                                    Visible='<%# RadGrid1.EditIndexes.Count = 0 %>'>                              
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" />
                                Edit
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnUpdateEdited_1" runat="server"
                                    CommandName="UpdateEdited"
                                    Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" />
                                Update
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnCancel_1" runat="server"
                                    CommandName="CancelAll"
                                    CausesValidation="false"
                                    Visible='<%# RadGrid1.EditIndexes.Count > 0 Or RadGrid1.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" />
                                Cancel editing
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAdd_1" runat="server" CausesValidation="false"
                                    CommandName="InitInsert"
                                    Visible='<%# Not RadGrid1.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" />
                                Add
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAddThis_1" runat="server"
                                    CommandName="PerformInsert"
                                    Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" />
                                Add this Loss
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnDelete_1" runat="server"
                                    CommandName="DeleteSelected"
                                    CausesValidation="false"
                                    OnClientClick="javascript:return confirm('Delete all selected Products?')">
                                <img style="border:0px;vertical-align:middle;" alt=""
                                    src="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" />
                                Delete
                                </asp:LinkButton>
                                &nbsp;&nbsp;&nbsp;
                                <asp:LinkButton ID="btnRefresh_1" runat="server"
                                    CommandName="RebindGrid">
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" />
                                Refresh
                                </asp:LinkButton>
                            </div>
                        </CommandItemTemplate>
                       
                        <Columns>
                            <telerik:GridClientSelectColumn HeaderStyle-Width="40px" >
                                <HeaderStyle Width="40px" />
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn
                                DataField="lossTypeID" HeaderText="ID" ReadOnly="True"
                                SortExpression="lossTypeID"
                                UniqueName="lossTypeID" Visible="true">
                                <HeaderStyle Width="75px" ForeColor="Silver" />                         
                                <ItemStyle Width="75px" ForeColor="Silver" />
                            </telerik:GridBoundColumn>                           
                            <telerik:GridBoundColumn
                                DataField="lossTypeDSC"
                                HeaderText="Description"
                                SortExpression="lossTypeDSC"
                                UniqueName="lossTypeDSC">
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn
                                HeaderStyle-Width="65px"
                                ItemStyle-Width="65px"
                                MaxLength="3"
                                NumericType="Number"
                                DataType="System.Int32"
                                DataField="sortOrderNBR"
                                HeaderText="Sort Order"
                                SortExpression="sortOrderNBR"
                                UniqueName="sortOrderNBR" >
                            </telerik:GridNumericColumn>
                            <telerik:GridCheckBoxColumn                              
                                DataField="activeIND"
                                HeaderText="Active"
                                SortExpression="activeIND"
                                UniqueName="activeIND">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridBoundColumn
                                DataField="createdByLogonID"
                                Display="false"
                                HeaderText="User"
                                SortExpression="createdByLogonID"
                                UniqueName="createdByLogonID">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn
                                DataField="createdWhenDTE"
                                DataFormatString="{0:MM/dd/yyyy}"
                                Display="false"
                                HeaderText="Date"
                                SortExpression="createdWhenDTE"
                                UniqueName="createdWhenDTE">                               
                            </telerik:GridDateTimeColumn>
                                                         
                        </Columns>

                        <FilterItemStyle BackColor="LightBlue" />
                       
                        <EditFormSettings ColumnNumber="2" EditFormType="AutoGenerated"
                            CaptionDataField="lossTypeDSC"
                            CaptionFormatString="Edit properties of Loss Type {0}">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle Font-Bold="true" />
                            <FormMainTableStyle GridLines="Horizontal"
                                CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2"
                                Height="120px"
                                BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False" />
                            <EditColumn ButtonType="ImageButton"
                                InsertText="Insert" UpdateText="Update"  CancelText="Cancel edit"
                                UniqueName="EditCommandColumn1">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Center" />
                             <PopUpSettings ScrollBars="Auto" />
                        </EditFormSettings>                             
                                           
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="False" Resizable="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="False">
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>       
               
            </telerik:RadPageView>
           
            <telerik:RadPageView ID="RadPageView2" runat="server">
           
                <%-- The RADGRID can have the DATASOURCEID set in the ASP page or
                     have the ONNEEDDATASOURCE set to call a module.  One overrides
                     the other, so if DataSourceID is set OnNeedDataSource will not
                     fire.
                --%>
           
                <telerik:RadGrid  DataSourceID="SqlDataSource2"
                    ID="RadGrid2" width="97%"
                    EnableLinqExpressions="False"
                    Skin="Office2007"
                    AllowFilteringByColumn="True"
                    AllowPaging="True"
                    AllowSorting="True"
                    AllowAutomaticDeletes="true"
                    AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true"
                    PageSize="8"
                    ShowGroupPanel="False"                   
                    ShowStatusBar="True"
                    GridLines="None"
                    runat="server" AutoGenerateColumns="False">
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <ItemStyle
                        BackColor="White"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <AlternatingItemStyle
                        BackColor="#FFCC99"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <MasterTableView 
                        AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true"
                        AllowAutomaticUpdates="true"
                        CommandItemDisplay="Top"
                        DataKeyNames="questionTypeID"
                        DataSourceID="SqlDataSource2"
                        EditMode="PopUp"
                        AutoGenerateColumns="False"
                        Width="100%">
                       
                        <CommandItemTemplate>
                            <div style="padding:10px 0px;">
                                Custom command item template &nbsp;
                                <asp:LinkButton ID="btnEditSelected_2" runat="server" 
                                    CommandName="EditSelected"
                                    Style="vertical-align: bottom" 
                                    CausesValidation="false"
                                    Visible='<%# RadGrid2.EditIndexes.Count = 0 %>'>                              
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" />
                                Edit
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnUpdateEdited_2" runat="server"  OnClientClick="alert('Update');"
                                    CommandName="UpdateEdited"
                                    Visible='<%# RadGrid2.EditIndexes.Count > 0 %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" />
                                Update
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnCancel_2" runat="server"
                                    CommandName="CancelAll"
                                    CausesValidation="false"
                                    Visible='<%# RadGrid2.EditIndexes.Count > 0 Or RadGrid2.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" />
                                Cancel editing
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAdd_2" runat="server"
                                    CommandName="InitInsert"
                                    Visible='<%# Not RadGrid2.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" />
                                Add
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAddThis_2" runat="server"
                                    CommandName="PerformInsert"
                                    Visible='<%# RadGrid2.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" />
                                Add this Loss
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnDelete_2" runat="server"
                                    CommandName="DeleteSelected"
                                    CausesValidation="false"
                                    OnClientClick="javascript:return confirm('Delete all selected Products?')">
                                <img style="border:0px;vertical-align:middle;" alt=""
                                    src="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" />
                                Delete
                                </asp:LinkButton>
                                &nbsp;&nbsp;&nbsp;
                                <asp:LinkButton ID="btnRefresh_2" runat="server"
                                    CommandName="RebindGrid">
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" />
                                Refresh
                                </asp:LinkButton>
                            </div>
                        </CommandItemTemplate>
                       
                        <Columns>
                            <telerik:GridClientSelectColumn HeaderStyle-Width="40px" >
                                <HeaderStyle Width="40px" />
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn
                                DataField="questionTypeID" HeaderText="ID" ReadOnly="True"
                                SortExpression="questionTypeID"
                                UniqueName="questionTypeID" Visible="true">
                                <HeaderStyle Width="75px" ForeColor="Silver" />                         
                                <ItemStyle Width="75px" ForeColor="Silver" />
                            </telerik:GridBoundColumn>                             
                            <telerik:GridBoundColumn
                                DataField="questionTypeDSC"
                                HeaderText="Description"
                                SortExpression="questionTypeDSC"
                                UniqueName="lossTypeDSC">
                            </telerik:GridBoundColumn>
                            <telerik:GridNumericColumn
                                HeaderStyle-Width="65px"
                                ItemStyle-Width="65px"
                                MaxLength="3"
                                NumericType="Number"
                                DataType="System.Int32"
                                DataField="sortOrderNBR"
                                HeaderText="Sort Order"
                                SortExpression="sortOrderNBR"
                                UniqueName="sortOrderNBR" >
                            </telerik:GridNumericColumn>
                            <telerik:GridCheckBoxColumn                              
                                DataField="activeIND"
                                HeaderText="Active"
                                SortExpression="activeIND"
                                UniqueName="activeIND">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridBoundColumn
                                DataField="createdByLogonID"
                                Display="false"
                                HeaderText="User"
                                SortExpression="createdByLogonID"
                                UniqueName="createdByLogonID">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn
                                DataField="createdWhenDTE"
                                DataFormatString="{0:MM/dd/yyyy}"
                                Display="false"
                                HeaderText="Date"
                                SortExpression="createdWhenDTE"
                                UniqueName="createdWhenDTE" >                               
                            </telerik:GridDateTimeColumn>
                                                         
                        </Columns>
                       

                        <FilterItemStyle BackColor="LightBlue" />
                       
                        <EditFormSettings ColumnNumber="2"  EditFormType="AutoGenerated"
                            CaptionDataField="questionTypeDSC"
                            CaptionFormatString="Edit properties of Question Type {0}">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle></FormCaptionStyle>
                            <FormMainTableStyle GridLines="Horizontal"
                                CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2"
                                Height="110px"
                                BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False">
                            </FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton"
                                InsertText="Insert Order" UpdateText="Update record"
                                UniqueName="EditCommandColumn2" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Center">
                            </FormTableButtonRowStyle>
                            <PopUpSettings ScrollBars="None"></PopUpSettings>
                        </EditFormSettings>                           
                     
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="False" Resizable="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="False">
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>               
           
            </telerik:RadPageView>
           
            <telerik:RadPageView ID="RadPageView3" runat="server">
           
                 <%-- The RADGRID can have the DATASOURCEID set in the ASP page or
                     have the ONNEEDDATASOURCE set to call a module.  One overrides
                     the other, so if DataSourceID is set OnNeedDataSource will not
                     fire.
                --%>      
       
                <telerik:RadGrid  DataSourceID="SqlDataSource3"
                    ID="RadGrid3" width="97%"
                    EnableLinqExpressions="False"
                    Skin="Office2007"
                    AllowFilteringByColumn="True"
                    AllowPaging="True"
                    AllowSorting="True"
                    AllowAutomaticDeletes="true"
                    AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true"
                    PageSize="7"
                    ShowGroupPanel="False"
                    ShowStatusBar="True"
                    GridLines="None"
                    runat="server" AutoGenerateColumns="False">
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <ItemStyle
                        BackColor="White"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <AlternatingItemStyle
                        BackColor="#FFCC99"
                        Font-Bold="False"
                        Font-Italic="False"
                        Font-Overline="False"
                        Font-Strikeout="False"
                        Font-Underline="False"
                        Wrap="True" />
                    <MasterTableView 
                        AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true"
                        AllowAutomaticUpdates="true"
                        CommandItemDisplay="Top"
                        DataKeyNames="surveyLayoutID"
                        DataSourceID="SqlDataSource3"
                        EditMode="PopUp"
                        AutoGenerateColumns="False"
                        Width="100%">
                        <%--
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <SelectFields>
                                    <telerik:GridGroupByField
                                        FieldAlias="Group"
                                        FieldName="groupNME">
                                    </telerik:GridGroupByField>
                                </SelectFields>
                                <GroupByFields>
                                    <telerik:GridGroupByField
                                        FieldAlias="Group"
                                        SortOrder="Ascending"
                                        FieldName="groupNME">
                                    </telerik:GridGroupByField>
                                </GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>                       
                        --%>
                        <CommandItemTemplate>
                            <div style="padding:10px 0px;">
                                Custom command item template &nbsp;
                                <asp:LinkButton ID="btnEditSelected_3" runat="server" 
                                    CommandName="EditSelected"
                                    Style="vertical-align: bottom" 
                                    CausesValidation="false"
                                    Visible='<%# RadGrid3.EditIndexes.Count = 0 %>'>                              
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Edit.gif") %>" />
                                Edit
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnUpdateEdited_3" runat="server"  OnClientClick="alert('Update');"
                                    CommandName="UpdateEdited"
                                    Visible='<%# RadGrid3.EditIndexes.Count > 0 %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Update.gif") %>" />
                                Update
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnCancel_3" runat="server"
                                    CommandName="CancelAll"
                                    CausesValidation="false"
                                    Visible='<%# RadGrid3.EditIndexes.Count > 0 Or RadGrid3.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;"
                                        alt="" src="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Cancel.gif") %>" />
                                Cancel editing
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAdd_3" runat="server"
                                    CommandName="InitInsert"
                                    Visible='<%# Not RadGrid3.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/AddRecord.gif") %>" />
                                Add
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnAddThis_3" runat="server"
                                    CommandName="PerformInsert"
                                    Visible='<%# RadGrid3.MasterTableView.IsItemInserted %>'>
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Insert.gif") %>" />
                                Add this Loss
                                </asp:LinkButton>
                                &nbsp;
                                <asp:LinkButton ID="btnDelete_3" runat="server"
                                    CommandName="DeleteSelected"
                                    CausesValidation="false"
                                    OnClientClick="javascript:return confirm('Delete all selected Products?')">
                                <img style="border:0px;vertical-align:middle;" alt=""
                                    src="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Delete.gif") %>" />
                                Delete
                                </asp:LinkButton>
                                &nbsp;&nbsp;&nbsp;
                                <asp:LinkButton ID="btnRefresh_3" runat="server"
                                    CommandName="RebindGrid">
                                    <img style="border:0px;vertical-align:middle;" alt=""
                                        src="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" originalAttribute="src" originalPath="<%= Page.ResolveUrl("usercontrols/images/Refresh.gif") %>" />
                                Refresh
                                </asp:LinkButton>
                            </div>
                        </CommandItemTemplate>
                       
                        <Columns>
                            <telerik:GridClientSelectColumn HeaderStyle-Width="40px" >
                                <HeaderStyle Width="40px" />
                            </telerik:GridClientSelectColumn>                         
                            <telerik:GridBoundColumn
                                DataField="surveyLayoutID" HeaderText="ID" ReadOnly="True"
                                SortExpression="surveyLayoutID"
                                UniqueName="surveyLayoutID" Visible="true">
                                <HeaderStyle Width="75px" ForeColor="Silver" />                         
                                <ItemStyle Width="75px" ForeColor="Silver" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn
                                DataField="surveyLayoutDSC"
                                HeaderText="Description"
                                SortExpression="surveyLayoutDSC"
                                UniqueName="surveyLayoutDSC">
                            </telerik:GridBoundColumn>
                           
                            <telerik:GridDropDownColumn
                                DataSourceID="SqlDataSource6"
                                DataField="surveyLayoutParentID"
                                HeaderText="Parent"
                                ListTextField="surveyLayoutDSC"
                                ListValueField="surveyLayoutID"
                                UniqueName="surveyLayoutParentID">
                            </telerik:GridDropDownColumn>                           
                                                      
                            <telerik:GridDropDownColumn
                                DataSourceID="SqlDataSource4"
                                DataField="lossTypeID"
                                HeaderText="Loss Type"
                                ListTextField="lossTypeDSC"
                                ListValueField="lossTypeID"
                                UniqueName="lossTypeID">
                            </telerik:GridDropDownColumn>
                            <telerik:GridDropDownColumn
                                DataSourceID="SqlDataSource5"
                                DataField="questionTypeID"
                                HeaderText="Question Type"
                                ListTextField="questionTypeDSC"
                                ListValueField="questionTypeID"
                                UniqueName="questionTypeID">
                            </telerik:GridDropDownColumn>                           
                            <telerik:GridNumericColumn
                                HeaderStyle-Width="75px"
                                ItemStyle-Width="75px"
                                MaxLength="3"
                                NumericType="Number"
                                DataType="System.Int32"
                                DataField="sortOrderNBR"
                                HeaderText="Sort Order"
                                SortExpression="sortOrderNBR"
                                UniqueName="sortOrderNBR" >
                            </telerik:GridNumericColumn>
                            <telerik:GridCheckBoxColumn                              
                                DataField="activeIND"
                                HeaderText="Active"
                                SortExpression="activeIND"
                                UniqueName="activeIND">
                            </telerik:GridCheckBoxColumn>
                            <telerik:GridBoundColumn
                                DataField="createdByLogonID"
                                Display="false"
                                HeaderText="User"
                                SortExpression="createdByLogonID"
                                UniqueName="createdByLogonID">
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn
                                DataField="createdWhenDTE"
                                DataFormatString="{0:MM/dd/yyyy}"
                                Display="false"
                                HeaderText="Date"
                                SortExpression="createdWhenDTE"
                                UniqueName="createdWhenDTE" >                               
                            </telerik:GridDateTimeColumn>
                                                         
                        </Columns>

                        <FilterItemStyle BackColor="LightBlue" />
                       
                        <EditFormSettings ColumnNumber="2"  EditFormType="AutoGenerated"
                            CaptionDataField="surveyLayoutDSC"
                            CaptionFormatString="Edit properties of Survey Layout {0}">
                            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                            <FormCaptionStyle></FormCaptionStyle>
                            <FormMainTableStyle GridLines="Horizontal"
                                CellSpacing="0" CellPadding="3" BackColor="White"
                                Width="100%" />
                            <FormTableStyle CellSpacing="0" CellPadding="2"
                                Height="120px"
                                BackColor="White" />
                            <FormTableAlternatingItemStyle Wrap="False">
                            </FormTableAlternatingItemStyle>
                            <EditColumn ButtonType="ImageButton"
                                InsertText="Insert Layout" UpdateText="Update record"
                                UniqueName="EditCommandColumn3" CancelText="Cancel edit">
                            </EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Center">
                            </FormTableButtonRowStyle>
                            <PopUpSettings ScrollBars="None"></PopUpSettings>
                        </EditFormSettings>                           
                       
                        <RowIndicatorColumn Visible="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="False" Resizable="False">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                    </MasterTableView>
                    <ClientSettings AllowDragToGroup="False">
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>            
           
            </telerik:RadPageView>
        </telerik:RadMultiPage>
       
        <asp:Label ID="lblError" runat="server" Text="" Visible="false"></asp:Label>       
<%--       
        <asp:LinqDataSource ID="LinqDataSource1" AutoPage="false" runat="server"
            ContextTypeName="DataClassesDataContext" TableName="Territories">
        </asp:LinqDataSource>
--%>
        <asp:SqlDataSource
            ID="SqlDataSource1"
            runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [lossTypeID], [lossTypeDSC], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE] FROM [lossType] ORDER BY [sortOrderNBR]"
            DeleteCommand="DELETE FROM [lossType] WHERE [lossTypeID] = @original_lossTypeID"
            InsertCommand="INSERT INTO [lossType] ([lossTypeDSC], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE]) VALUES (@lossTypeDSC, @sortOrderNBR, @activeIND, @createdByLogonID, @createdWhenDTE)"
            UpdateCommand="UPDATE [lossType] SET [lossTypeDSC] = @lossTypeDSC, [sortOrderNBR] = @sortOrderNBR, [activeIND] = @activeIND, [createdByLogonID] = @createdByLogonID, [createdWhenDTE] = @createdWhenDTE WHERE [lossTypeID] = @original_lossTypeID"
            OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_lossTypeID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="lossTypeDSC" Type="String" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
                <asp:Parameter Name="original_lossTypeID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="lossTypeDSC" Type="String" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
            </InsertParameters>           
        </asp:SqlDataSource>

        <asp:SqlDataSource
            ID="SqlDataSource2"
            runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [questionTypeID], [questionTypeDSC], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE] FROM [questionType] ORDER BY [sortOrderNBR]"
            DeleteCommand="DELETE FROM [questionType] WHERE [questionTypeID] = @original_questionTypeID"
            InsertCommand="INSERT INTO [questionType] ([questionTypeDSC], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE]) VALUES (@questionTypeDSC, @sortOrderNBR, @activeIND, @createdByLogonID, @createdWhenDTE)"
            UpdateCommand="UPDATE [questionType] SET [questionTypeDSC] = @questionTypeDSC, [sortOrderNBR] = @sortOrderNBR, [activeIND] = @activeIND, [createdByLogonID] = @createdByLogonID, [createdWhenDTE] = @createdWhenDTE WHERE [questionTypeID] = @original_questionTypeID"
            OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_questionTypeID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="questionTypeDSC" Type="String" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
                <asp:Parameter Name="original_questionTypeID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="questionTypeDSC" Type="String" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
            </InsertParameters>           
        </asp:SqlDataSource>
       
        <asp:SqlDataSource
            ID="SqlDataSource3"
            runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [surveyLayoutID], [surveyLayoutDSC], [surveyLayoutParentID], [questionTypeID], [lossTypeID], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE], (SELECT tab1.sortOrderNBR FROM lossType as tab1 WHERE tab1.lossTypeID = tab2.lossTypeID) AS sortOrderParentNBR FROM [surveyLayout] AS tab2 ORDER BY [sortOrderParentNBR], [surveyLayoutID], [sortOrderNBR]"
            DeleteCommand="DELETE FROM [surveyLayout] WHERE [surveyLayoutID] = @original_surveyLayoutID"
            InsertCommand="INSERT INTO [surveyLayout] ([surveyLayoutDSC], [surveyLayoutParentID], [questionTypeID], [lossTypeID], [sortOrderNBR], [activeIND], [createdByLogonID], [createdWhenDTE]) VALUES (@surveyLayoutDSC, @surveyLayoutParentID, @questionTypeID, @lossTypeID, @sortOrderNBR, @activeIND, @createdByLogonID, @createdWhenDTE)"
            UpdateCommand="UPDATE [surveyLayout] SET [surveyLayoutDSC] = @surveyLayoutDSC, [surveyLayoutParentID] = @surveyLayoutParentID, [questionTypeID] = @questionTypeID, [lossTypeID] = @lossTypeID, [sortOrderNBR] = @sortOrderNBR, [activeIND] = @activeIND, [createdByLogonID] = @createdByLogonID, [createdWhenDTE] = @createdWhenDTE WHERE [surveyLayoutID] = @original_surveyLayoutID"
            OldValuesParameterFormatString="original_{0}">
            <DeleteParameters>
                <asp:Parameter Name="original_surveyLayoutID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="surveyLayoutDSC" Type="String" />
                <asp:Parameter Name="surveyLayoutParentID" Type="Int32" />
                <asp:Parameter Name="questionTypeID" Type="Int32" />
                <asp:Parameter Name="lossTypeID" Type="Int32" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
                <asp:Parameter Name="original_surveyLayoutID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="surveyLayoutDSC" Type="String" />
                <asp:Parameter Name="surveyLayoutParentID" Type="Int32" />
                <asp:Parameter Name="questionTypeID" Type="Int32" />
                <asp:Parameter Name="lossTypeID" Type="Int32" />
                <asp:Parameter Name="sortOrderNBR" Type="Int32" />
                <asp:Parameter Name="activeIND" Type="Boolean" />
                <asp:Parameter Name="createdByLogonID" Type="String"
                    DefaultValue="<% HttpContext.Current.User.Identity.Name %>" />
                <asp:Parameter Name="createdWhenDTE" Type="DateTime" />
                <%-- "<%= DateTime.Now.ToString() %>"--%> 
            </InsertParameters>           
        </asp:SqlDataSource>
       
        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [lossTypeID], [lossTypeDSC] FROM [lossType] ORDER BY [sortOrderNBR]">
           
        </asp:SqlDataSource>
       
        <asp:SqlDataSource ID="SqlDataSource5" runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [questionTypeID], [questionTypeDSC] FROM [questionType] ORDER BY [sortOrderNBR]">
        </asp:SqlDataSource>
       
        <asp:SqlDataSource ID="SqlDataSource6" runat="server"
            ConnectionString="<%$ ConnectionStrings:LostOpportunityConnectionString %>"
            SelectCommand="SELECT [surveyLayoutID], [surveyLayoutDSC] FROM [surveyLayout] WHERE ([surveyLayoutID] &lt;&gt; @surveyLayoutID)">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="0"
                    Name="surveyLayoutID"
                    SessionField="sl_ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

Here is the VB Code:

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Threading

Imports System.Runtime.InteropServices
Imports System.Xml.Serialization
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.WebControls
Imports Microsoft.SharePoint.WebPartPages
Imports Telerik.Web.UI

Partial Class LostOpportunity_Administration
    Inherits System.Web.UI.UserControl

    '  Add a REFERENCE to the web.config file in COMPILATION -> ASSEMBLIES section
    '  <add assembly="ReturnOfSmartPart, Version=1.3.0.0, Culture=neutral, PublicKeyToken=9F4DA00116C38EC5"/>
    Implements SmartPart.IConnectionProviderControl

    Protected Overrides Sub OnError(ByVal e As System.EventArgs)

        Context.Items.Add("stackTrace", Server.GetLastError().StackTrace)
        Context.Items.Add("messageError", Server.GetLastError().Message)
        If Not Server.GetLastError().InnerException Is Nothing Then
            Context.Items.Add("innerMessageError", Server.GetLastError().InnerException.Message)
        Else
            Context.Items.Add("innerMessageError", String.Empty)
        End If
        Context.Items.Add("sourceError", Server.GetLastError().Source)
        Server.ClearError()
        Server.Transfer("Administration.ascx?action=Error")
        MyBase.OnError(e)
        'lblError.Text = "An Error occurred"
        'lblError.Visible = True

    End Sub

    Protected Overrides Sub OnInit(ByVal e As System.EventArgs)

        Try
            ''Dim rsm As New ScriptManager
            ''If ScriptManager.GetCurrent(Me.Page) Is Nothing Then
            ''    rsm.ID = "ScriptManager1"
            ''    rsm.SupportsPartialRendering = True
            ''    rsm.ScriptMode = ScriptMode.Release
            ''    Me.Page.Controls.Add(rsm)
            ''Else
            ''    ScriptManager.GetCurrent(Me.Page).ID = "ScriptManager1"
            ''    ScriptManager.GetCurrent(Me.Page).SupportsPartialRendering = True
            ''    ScriptManager.GetCurrent(Me.Page).ScriptMode = ScriptMode.Release
            ''    If Not TypeOf ScriptManager.GetCurrent(Me.Page) Is RadScriptManager Then
            ''        Me.Controls.Remove(ScriptManager.GetCurrent(Me.Page))
            ''        rsm.ID = "ScriptManager1"
            ''        rsm.SupportsPartialRendering = True
            ''        rsm.ScriptMode = ScriptMode.Release
            ''        Me.Page.Controls.Add(rsm)
            ''    End If
            ''End If

        Catch ex As Exception

        End Try

        MyBase.OnInit(e)
    End Sub

#Region " RadGrid "

    ''Protected Sub RadGrid_ItemCommand(ByVal sender As Object, _
    ''    ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles _
    ''        RadGrid1.ItemCommand, RadGrid2.ItemCommand, RadGrid3.ItemCommand

    ''    Select Case e.CommandName
    ''        Case "Add New"
    ''        Case "EditSelected"
    ''        Case "DeleteSelected"
    ''        Case "Update"
    ''        Case "UpdateEdited"
    ''        Case "InitInsert"
    ''        Case "Cancel"
    ''        Case "CancelAll"
    ''        Case "RebindGrid"
    ''    End Select

    ''End Sub

    Protected Sub RadGrid_ItemDeleted( _
        ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) _
            Handles RadGrid1.ItemDeleted, RadGrid2.ItemDeleted, RadGrid3.ItemDeleted

        Dim editForm As GridEditFormItem = _
            DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)(0), GridEditFormItem)
        editForm.Visible = False

    End Sub

    Protected Sub RadGrid_ItemUpdated( _
            ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) _
                Handles RadGrid1.ItemUpdated, RadGrid2.ItemUpdated, RadGrid3.ItemUpdated

        Dim editForm As GridEditFormItem = _
            DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)(0), GridEditFormItem)
        editForm.Visible = False

    End Sub

    Protected Sub RadGrid_ItemInserted( _
        ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) _
            Handles RadGrid1.ItemInserted, RadGrid2.ItemInserted, RadGrid3.ItemInserted

        Dim editForm As GridEditFormItem = _
            DirectCast(RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)(0), GridEditFormItem)
        editForm.Visible = False

    End Sub

    Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) _
            Handles RadGrid1.ItemCreated, RadGrid2.ItemCreated, RadGrid3.ItemCreated
        If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then

            Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
            Dim editor As GridNumericColumnEditor = _
                DirectCast(item.EditManager.GetColumnEditor("sortOrderNBR"),  _
                    GridNumericColumnEditor)
            Dim cell As TableCell = DirectCast(editor.NumericTextBox.Parent, TableCell)

            Dim validator As New RangeValidator()
            editor.NumericTextBox.ID = "ID_for_validation"
            validator.ControlToValidate = editor.NumericTextBox.ID
            validator.Type = ValidationDataType.[Integer]
            validator.MinimumValue = "1"
            validator.MaximumValue = "100"
            validator.ErrorMessage = "Number required (1-100)!"

            cell.Controls.Add(validator)

        End If

        If TypeOf e.Item Is GridFilteringItem Then
            Dim filteringItem As GridFilteringItem = _
                CType(e.Item, GridFilteringItem)

            For Each myCell As Telerik.Web.UI.GridTableCell In filteringItem.Controls
                If myCell.HasControls Then
                    For Each cntl As Control In myCell.Controls
                        If cntl.ToString = "System.Web.UI.WebControls.TextBox" Then
                            Dim box2 As TextBox = cntl
                            box2.Width = Unit.Pixel(40)
                        End If
                    Next
                End If
            Next

            ' Set deminsions for the filter textbox
            Dim box1 As RadNumericTextBox = _
                CType(filteringItem("sortOrderNBR").Controls(0), RadNumericTextBox)
            box1.Width = Unit.Pixel(20)

        End If

    End Sub

    Protected Sub RadGrid_ItemDataBound( _
            ByVal sender As Object, ByVal e As GridItemEventArgs) _
            Handles RadGrid1.ItemDataBound, RadGrid2.ItemDataBound, _
                    RadGrid3.ItemDataBound

        If TypeOf e.Item Is GridEditFormInsertItem AndAlso _
                e.Item.OwnerTableView.IsItemInserted Then

            '' CREATEDBYLOGONID
            Dim item As GridEditFormInsertItem = _
                DirectCast(e.Item, GridEditFormInsertItem)
            Dim txtBox As TextBox = _
                DirectCast(item("createdByLogonID").Controls(0), TextBox)
            txtBox.Text = Split(HttpContext.Current.User.Identity.Name, "\", -1, CompareMethod.Text)(1)
            txtBox.BackColor = Drawing.Color.LightYellow

            ''  CREATEDWHENDTE
            Dim rdp As RadDatePicker = _
                DirectCast(item("createdWhenDTE").Controls(0), RadDatePicker)
            rdp.Clear()
            rdp.MinDate = DateTime.Today
            rdp.MaxDate = DateTime.Today
            rdp.SelectedDate = DateTime.Today
            'Dim tbox As Object = DirectCast(rdp.Controls(2), DatePickingInput)
            rdp.BackColor = Drawing.Color.Yellow
        End If

        If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then

            '' CREATEDBYLOGONID
            Dim item As GridEditableItem = _
                DirectCast(e.Item, GridEditableItem)
            Dim txtBox As TextBox = _
                DirectCast(item("createdByLogonID").Controls(0), TextBox)
            txtBox.Text = Split(HttpContext.Current.User.Identity.Name, "\", -1, CompareMethod.Text)(1)
            txtBox.BackColor = Drawing.Color.LightYellow

            ''  CREATEDWHENDTE
            Dim rdp As RadDatePicker = _
                DirectCast(item("createdWhenDTE").Controls(0), RadDatePicker)
            rdp.Clear()
            rdp.MinDate = DateTime.Today
            rdp.MaxDate = DateTime.Today
            rdp.SelectedDate = DateTime.Today
            'Dim tbox As Object = DirectCast(rdp.Controls(2), DatePickingInput)
            rdp.BackColor = Drawing.Color.Yellow
        End If
    End Sub

#End Region

    Public Function GetProviderData() As Object _
            Implements SmartPart.IConnectionProviderControl.GetProviderData

        If RadGrid1.SelectedIndexes.Count > 0 Then
            Return RadGrid1.SelectedValue
        Else
            Return -1
        End If

    End Function

    Public ReadOnly Property ProviderMenuLabel() As String Implements SmartPart.IConnectionProviderControl.ProviderMenuLabel
        Get
            Return "This is the LOSS OPPORTUNITY Administrator"
        End Get
    End Property

End Class

0
Larry
Top achievements
Rank 2
answered on 13 Aug 2008, 01:11 PM
I should have mentioned that you will see in my code attempts to get this working.  You can just disregard the RadGrid_ItemDeleted, RadGrid_ItemUpdated and the RadGrid_ItemInserted modules.
0
Larry
Top achievements
Rank 2
answered on 15 Aug 2008, 11:35 AM
Ritz,

Any progress with this problem.  I would like to use these controls, but if I can't get this functionallity working, I may have to dump this approach.
0
Larry
Top achievements
Rank 2
answered on 18 Aug 2008, 06:46 PM
Have you made any progress solving my problem?
0
plamen
Top achievements
Rank 1
answered on 19 Aug 2008, 08:24 AM
Larry,

Does your web part work with normal PostBacks? Try disabling the Ajax by simply setting the EnableAjax property to False on your RadAjaxPanel. Test your page and determine if everything is working correctly with PostBacks. If that test passes, then you can re-enable Ajax and focus on potential problems the Ajax is introducing.

Hope this helps
0
Larry
Top achievements
Rank 2
answered on 19 Aug 2008, 02:24 PM
Thanks for your reply, John, but if you look at my code above, you will see I am not using RadAjaxPanels.  I am using a RadTabStrip, RadMultiPage, RadPageView and several RadGrids.  The RadGrid is AJAX Enabled and addition research indicates that it is always enabled (or set automatically, I am not sure which).

I am using a "CommandItemTemplate" to perform inserts, updates and deletes to the SQL table. For some reason, the "Add" button in the template does not work in SharePoint.  Outside of SharePoint, everything works fine.

I have created my page similar to the "Web Grid" created on the demos page.  The only difference is the page has several grids and can be switched using the RadTabStrip.

I am sure SharePoint is the beast causing the problem, but it would be nice to find a work-a-round.
0
plamen
Top achievements
Rank 1
answered on 20 Aug 2008, 07:27 AM
hi

Sorry for the misunderstanding, Larry

Does the same issue arises if you disable ajax (with EnableAjax=false)?

here is an example:

<telerik:RadAjaxManager EnableAjax="false"ID=" RadAjaxManager1" runat="server" /> 
0
Larry
Top achievements
Rank 2
answered on 21 Aug 2008, 11:54 AM
I have created a Web User Control and deployed it to a SharePoint site using the SmartPart developed by Patrick Tisseghem.  The SmartPart comes in two versions.  One for deploying without AJAX and one with AJAX.  If I try to deploy the Web User Control with the RadAjaxManager and I use the SmartPart without AJAX, I get an "Unexpected Error Occurred".  When I deploy it without a RadAjaxManager and RadScriptManager and use the SmartPart with AJAX, the control works fine except for adding new records.

So I can't enable or disable Ajax using the RadAjaxManager because I am not using one.  The SmartPart is a wrapper that takes care of all the Ajax calls.
Tags
Ajax
Asked by
Rajdeep
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Rajdeep
Top achievements
Rank 1
Larry
Top achievements
Rank 2
plamen
Top achievements
Rank 1
Share this question
or