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
8920
Loaded on demand grid case of editing function not working
posted

I need help with dynamically loaded on demand grid
Issue: After cell’s value get edited on the postback old value seen  in the browser.  This happening only for the child grid. Parent grid works fine
Setting :
Data source for child grid (and parent grid for this matter ) stored in the session on the first page load event.
When child grid get expanded the RowIslandsPopulating retrieves DS from session creates container grid and adds it to RowIsland collection and adds columns, summary row  etc. then new grid getting datasource and gets DataBind. 
Child grid has cell edit behavior added and that is where problem starts :
Edit behaviour gets handle in RowUpdating event and if it comes from child grid then e.Values got read and both datasets ( parent and child) get updated, and parent grid gets updated dataSource and databind(). All this works fine if RowUpdating comes from Parent grid.
If it comes from child grid then after RowUpdating it goes to RowIslandsPopulating  and somehow    e.Row.RowIslands.Count get always increased after each edit.... the outcome is that on the browser the edited value get set to the original value that were there before edit....same true for the parent row, alsthough value changed in the parent's datasource.
i.e if I would change value from 50  to 100 it goes through RowUpdating  event and I can see old value as 50 new value as 100 then DataSet get updated with new value and in RowIslandsPopulating  I can see the new value in the dataSource before it gets bind... but in the browser it still has old value.  Also RowIslandsPopulating get called as many times as e.Row.RowIslands.Count ….
what seems has to be done is somehow to avoid create new child grid and get the reference to the  original one that apparently restored from ViewState and assign updated data source to it and rebind.. or clear the whole DataIsland collection before adding new container ( that would be the best scenario, but I was not able to do it) or maybe some other property has to be reset, to handle this scenario, please advise, I really stuck with this...  I’m uploading light project that illustrates the issue, just run it and try to edit one of the child grid. 

whdg_LoadOnDemandEdit01.rar
Parents
No Data
Reply
  • 8160
    Verified Answer
    posted

    Hello mcseidel,

    try to set EnableDataViewState property to true:

     

     

     

     

     

    <ig:WebHierarchicalDataGrid ID="whdg" runat="server" AutoGenerateColumns="False" EnableDataViewState

    ="true"

     

     

     

    DataKeyFields="idMaster" Height="373px" Key="idMaster" Width="1040px" OnRowIslandsPopulating

    ="whdg_RowIslandsPopulating"

     

     

     

    OnCalculateCustomSummary="whdg_CalculateCustomSummary" OnRowUpdating

    ="whdg_RowUpdating">

Children
No Data