Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Ultrawebgrid object binding
posted

Hi,

I have a Parent object (Budget class) with collection (implements IEnumerable) of its child elements (Documents).

class Budget {
...
IList<Document> documents;
public IList<Document> Documents { get { return documents; } };
...

class Document {
...
string name;
public string Name { get { return name; } }
}

I try to bind a collection of budget items to the grid so that the documents appear in the next child band. In the code behind I wrote:

protected void Page_Load(object sender, EventArgs e)
{

  IList<Budget> budgest = BudgetDAO.GetAllBudgets();
  MainGrid.DataSource = budgets
;
  this.MainGrid.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.Hierarchical;
  MainGrid.DataBind();
}

protected void MainGrid_InitializeBand(object sender, Infragistics.WebUI.UltraWebGrid.BandEventArgs e) {
   if (e.Band == MainGrid.Bands[1]) { e.Band.ChildBandColumn = "Documents"; }
}

Am I doing something wrong here? Could you please provide asp code that I should use in my MainGrid declaration so that this code starts working? Should I have 2 Bands elements declared or only one? May I add columns to this bands and how should they be declared?

Thanks in advance for your help,
Sebastian

Parents Reply Children