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
1106
Manual Binding - Urgent Help Needed
posted

I have to do a demo tomorrow and need some help here.

I have the WHDG working with four levels of  nesting. I have used the drop on sql DataSources and the WHDS bound to the grid.

Selection, expansion is fine. However, I need to use my own DAL to do updates , adds and deletes.

My current issues is that although I have manged to add a new row ( can see this int he backend, ) im not sure how to refresh the grid. Here is the event I am using and my code. I need to know.

** How to update the Grid on the UI, the databind in the code below does not work, although the backend sql store is updated fine.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

protected void WebHierarchicalDataGrid1_RowAdding(object sender, Infragistics.Web.UI.GridControls.RowAddingEventArgs e)
        {
            var container = (Infragistics.Web.UI.GridControls.ContainerGrid)sender;


            switch (container.Level)
            {

                case 0: //Items
                    break;

                case 1: // Hazard Risks

                    Model.IMdlHazard mdl = new Model.MdlHazard();

                    System.Exception exception = new Exception();

                    mdl.ItemID = int.Parse(e.Values["ItemID"].ToString());
                    mdl.Description = e.Values["Description"].ToString();
                    mdl.HazardSubCatID = int.Parse(e.Values["HazardSubCatID"].ToString());
                    mdl.UserName = "bp1\burntf";

                    DAL.DALRiskAssessment.tblHazard_Upd(ref mdl, out exception);
                    container.DataSource = WHDS;
                    container.DataBind();
                    break;


                case 2 : //HazardRisks
                    break;

                case 3: //Groups Affected
                    break;
            }

            e.Cancel = true;

        }