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
535
Recursion issue with OnAssigningFieldLayoutToItem
posted

Hi,

In my Xamdatagrid I load certain data based on click of different buttons.

When I click the button after certain steps OnAssigningFieldLayoutToItem is called. In this function I made a function call to AddDynamicColumns. This function had following code:

for(int i=0;i<fields.Count;i++)
{
if (layout.Fields.Contains(fields[i]))
{
    layout.Fields.Remove(fields[i]);
}
}

No the problem i when I load the data for the first time the code runs properly, but when I reload the loaded data in this case OnAssigningFieldLayoutToItem calls AddDynamicColumns and when this flow reaches layout.Fields.Remove(fields[i]); it again calls OnAssigningFieldLayoutToItem.

This way I am stuck in recursion between the two functions.

Kindly help.

Parents
  • 22015
    posted

    Hello Neelesh,

     

    Thank you for your post!

     

    I have been looking into it and it seems that I am missing something from your scenario. Would you please provide me with more detailed information on the functionality you are using for the reloading the data in the XamDataGrid.?

    If possible would you please provide me with a small sample application, showing the functionality you are using? This way I would be able to further investigate this issue for you.

     

    Looking forward to hearing from you.

Reply Children