Problems with Infragistics WebGrid and ObjectContainerDataSource

Topics: Web Client Software Factory
May 25, 2007 at 1:18 PM
Hi People!!!

I am trying out Infragistics WebGrid in my WCSF Solution and I have one problem because in other application that are not WCSF when InitializeDataSource event is fire after must be fire InitializeLayout and in my WCSF Solution not happen. I think that is a problem that is related with WebGrid is not compatible with objectcontainerdatasource. This is the source code:

protected override void OnInit(EventArgs e)
{
UltraWebGrid1.InitializeDataSource += new Infragistics.WebUI.UltraWebGrid.InitializeDataSourceEventHandler(UltraWebGrid1_InitializeDataSource);
UltraWebGrid1.InitializeLayout += new Infragistics.WebUI.UltraWebGrid.InitializeLayoutEventHandler(UltraWebGrid1_InitializeLayout);
base.OnInit(e);
}

void UltraWebGrid1_InitializeDataSource(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e)
{
UltraWebGrid1.DataSource = ObjectContainerDataSource1;
}

void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
this.UltraWebGrid1.DisplayLayout.FilterOptionsDefault.FilterUIType = Infragistics.WebUI.UltraWebGrid.FilterUIType.FilterRow;
this.UltraWebGrid1.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.Xml;
e.Layout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Xml;
e.Layout.FilterOptionsDefault.AllowRowFiltering = Infragistics.WebUI.UltraWebGrid.RowFiltering.OnServer;
e.Layout.FilterOptionsDefault.DropDownRowCount = 15;
e.Layout.FilterOptionsDefault.RowFilterMode = Infragistics.WebUI.UltraWebGrid.RowFilterMode.SiblingRowsOnly;
e.Layout.Pager.AllowPaging = true;
e.Layout.Pager.PageSize = 100;
}

#region IDefaultView Members

public LineaDetalle LineaDetalle
{
set { ObjectContainerDataSource1.DataSource = value; }
}

public IList<LineaDetalle> LineasDetalle
{
set { ObjectContainerDataSource2.DataSource = value; }
}

#endregion

It is compatible WebGrid. DataSource property with ObjectContainerDatasource?

Best Regards