We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl Hierarchy child refresh

Thread ID:

Created:

Updated:

Platform:

Replies:

102543 Feb 7,2012 07:09 PM Feb 13,2012 07:31 AM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Truman Lackey
Asked On February 7, 2012 07:09 PM

With a Hierarchy in the grid how can I refresh a granchild relation where items have been added/deleted through ajax calls in the background?

For example in the ThreeLevelHierarchies sample if an item was added to the GrandChild DataTable how can I just refresh that part of the grid without a full postback and have the same items expanded?


Truman Lackey
Replied On February 8, 2012 01:39 PM

Figured this out doing the following:

Client side:

var addError = { 'Method': 'add', 'id': id};
__doPostBack('<%= UpdatePanel.ClientID.ToString() %>', JSON.stringify(addError));

Server side:

helper class:
public class Method
{
public String Method { get; set; }
public int ElementErrorID { get; set; }
}

in aspx.cs file:

private void RefreshGrid(Method method)
{

Syncfusion.Grouping.Table myTable = this.ScenariosGridGrouping.Table.RelatedTables["Parent"].RelatedTables["Child"];

if (method.Method == "add")
{
var item = (from items in pdc.dat_ElementErrors where errors.ElementError_ID == elementErrorMethod.ElementErrorID select errors).Single();
ElementErrorRepository.ErrorView errorView = new Pontoon.Models.ElementErrorRepository.ErrorView(elementErrorMethod.ElementErrorID, error.ElementError_Name, error.Scenario_Crew_ElementRating_ID, error.br_Scenario_Crew_Element_ElementRating.Element_ID);
errorTable.SourceList.Add(errorView);
}
else if (elementErrorMethod.Method == "delete")
{
ElementErrorRepository.ErrorViewList errorList = ( ElementErrorRepository.ErrorViewList)errorTable.SourceList;
var error = (from errors in errorList where errors.ElementError_ID == elementErrorMethod.ElementErrorID select errors).Single();
errorTable.SourceList.Remove(error);
}



Truman Lackey
Replied On February 8, 2012 01:48 PM

Last entry posted on accident without full listing.

Figured this out doing the following:

Client side:

var addError = { 'Method': 'add', 'ID': id};
__doPostBack('<%= UpdatePanel.ClientID.ToString() %>', JSON.stringify(addError));

Server side:
Im my case I am using sql to linq and the underlying source is obtained from a ling query and is a BindingList and it is getting set when the initial page post is made and also setting the relations in the TableDescriptors.

ItemRepository is a sql to linq wrapper class that inherits from BindingList. This is important as the SourceList for the Grouping.Table will not update the underlying records if it is not a BindingList<>

helper class:
public class Method
{
public String Method { get; set; }
public int ID { get; set; }
}

in aspx.cs file:

private void RefreshGrid(Method method)
{
DataContext dc = new DataContext();
Syncfusion.Grouping.Table itemTable = this.ScenariosGridGrouping.Table.RelatedTables["Parent"].RelatedTables["Child"];

if (method.Method == "add")
{
ItemRepository.ItemView itemView = new ItemRepository.ItemView(method.ID);
itemTable.SourceList.Add(itemView);
}




Sridhar N [Syncfusion]
Replied On February 13, 2012 07:31 AM

Hi Truman,

Thanks for your interest in Syncfusion products.

We are sorry for the inconvenience caused. Currently we don't have ajax call for editing in Hierarchy grid. Could you please send us your sample so that we can analyze it and find your exact requirement and provide solution. The information provided will be great help in resolving issue.

Please let us know if any concerns.

Regards,
Sridhar N


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;