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
570
No InitializeLayout event when using UltraWebGrid with WebHierarchicalDataSource
posted

Hi all !

I have a simple 1:n relation between departments and users to be displayed by a UltraWebGrid.

ASPx-Code & C# Code looks like this:


      <igtbl:UltraWebGrid ID="departmentWebGrid" runat="server" CaptionAlign="Top" Browser="Xml"
                oninitializedatasource="departmentWebGrid_InitializeDataSource"
                onselectedrowschange="departmentWebGrid_SelectedRowsChange"
                oninitializelayout="departmentWebGrid_InitializeLayout" Height="100%"
                Width="100%" oninit="departmentWebGrid_Init"
                oninitializeband="departmentWebG
        ....
    </igtbl:UltraWebGrid>   



    protected void departmentWebGrid_InitializeDataSource(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e) {
            if (sender is UltraWebGrid) {
                UltraWebGrid gird = (UltraWebGrid)sender;
                try {
                   
                    // Create the view
                    DataView view = new Infragistics.Web.UI.DataSourceControls.DataView();

                    // Set the required properties
                    view.DataSourceID = this.ObjectDataSourceDepartment.ID;
                    view.ID = "Department_View";

                    this.departmentWebHierarchicalDataSource.DataViews.Add(view);

                    // Set the view for SqlDataSource2
                    view = new Infragistics.Web.UI.DataSourceControls.DataView();

                    view.DataSourceID = this.ObjectDataSourceUsers.ID;
                    view.ID = "Users_View";

                    this.departmentWebHierarchicalDataSource.DataViews.Add(view);

                    DataRelation dr = new Infragistics.Web.UI.DataSourceControls.DataRelation();
                    dr.ParentDataViewID = "Department_View";
                    dr.ParentColumns = new string[ { "DepartmentId" };
                    dr.ChildDataViewID = "Users_View";
                    dr.ChildColumns = new string[ { "UserId" };
                    this.departmentWebHierarchicalDataSource.DataRelations.Add(dr);

                    this.departmentWebGrid.DataSourceID = this.departmentWebHierarchicalDataSource.ID;

                    this.departmentWebGrid.DataBind();
                    this.departmentWebGrid.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.OutlookGroupBy;

                    //this.departmentWebGrid.Bands[0].Columns[1].Hidden = true;
                } catch (Exception ex) {
                    throw new HttpException("Error: could not load data for the departments web grid !" + ex.Message);
                }
            }
        }


    protected void departmentWebGrid_InitializeLayout(object sender, LayoutEventArgs e) {
            int i = 0;
        }

Putting a breakpoint into the departmentWebGrid_InitializeLayout() delegate shows, that this event handler will never run through.

Any hint or idea is welcome. Thanks in advance !

Regards,
    Claus
 

  • 21382
    posted
    You should contact our Developer Support staff ( http://ko.infragistics.com/support/ask-for-help.aspx ). This sounds like an issue that has been reported and is currently in development. When you contact them you ask to be added to the notification for bug 9201.