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

Complete Hierarchy always in Editmode Bound Server Site

3 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lars
Top achievements
Rank 1
Lars asked on 25 Jun 2012, 01:52 PM
Hi,

i got a Telerik Grid and need all items InPlace EditAble.
It works fine if i just open up a few Levels, but on some deeper Levels i get errors while collapsing/expanding the hierarchy.
The complete hierarchy could not be expanded at startup. (To much data)

"Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500"

The Data is bound on serverside.

Could please somebody give me an hint. I tryied a lot of the stuff explained in examples and forum entries.
But didn't get it run without having errors. :-(

Databinding:
protected void RadGridHierarchy_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    if (!e.IsFromDetailTable)
    {
        RadGridHierarchy.DataSource = GetMaterialHierarchyDataTableFiltered("ROOT", false);
    }
}
 
protected void RadGridHierarchy_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
    GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
    string ParentCode = dataItem.GetDataKeyValue("MaterialHierarchyNodeCode").ToString();
    e.DetailTableView.DataSource = GetMaterialHierarchyDataTableFiltered(ParentCode, false);
         
}

Set items to editmode:
protected void RadGridHierarchy_PreRender(object sender, EventArgs e)
{
    SaveGridValues();
 
    if (_expandedItem != null && _expandedItem.Expanded)
    {
        if (_expandedItem.HasChildItems)
        {
            foreach (GridTableView view in _expandedItem.ChildItem.NestedTableViews)
            {
                foreach (GridDataItem item in view.Items)
                {
                    item.Edit = true;
                }
                view.Rebind();
            }
        }
    }           
 
    for (int i = 0; i < RadGridHierarchy.MasterTableView.Items.Count; i++)
    {
        RadGridHierarchy.EditIndexes.Add(i);
    }
    RadGridHierarchy.Rebind();
}
 
protected void RadGridHierarchy_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.ExpandCollapseCommandName)
    {
        _expandedItem = (GridDataItem)e.Item;
    }
}


Thanks a lot for your help.
I really don't know what to try anymore...

Kind regards

Lars




3 Answers, 1 is accepted

Sort by
0
Lars
Top achievements
Rank 1
answered on 26 Jun 2012, 07:56 AM
Nobody with an advice? :-(
Telerik?
0
Marin
Telerik team
answered on 28 Jun 2012, 07:53 AM
Hi,

 You can try to temporary disable the ajax - this way you should get a more meaningful exception about what exactly has gone wrong on the server.
Otherwise the code snippets look fine. You can check for any errors during the databinding of the detail tables.

All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lars
Top achievements
Rank 1
answered on 28 Jun 2012, 09:08 AM
Hi Martin,

thanks for your reply. The Exception is better readable and we could resolve the problem faster than i expected.

Just an entry in the Web.Config.
<configuration>
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="1000" />
  </appSettings>
</configuration>

Error:

[InvalidOperationException: Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ungültig.]
   System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2420862
   System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +58
   System.Web.HttpRequest.FillInFormCollection() +159

[HttpException (0x80004005): Ungültige URL-codierte Formulardaten.]
   System.Web.HttpRequest.FillInFormCollection() +217
   System.Web.HttpRequest.get_Form() +104
   System.Web.TraceContext.InitRequest() +1487
   System.Web.TraceContext.VerifyStart() +159
   System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +9056565
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +417
Tags
Grid
Asked by
Lars
Top achievements
Rank 1
Answers by
Lars
Top achievements
Rank 1
Marin
Telerik team
Share this question
or