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
785
IGGridViewDataSourceHelper.MoveRow
posted

I gave it a go, but I'm just not sure what I'm doing wrong. Anyways, I need to use some custom logic and update a property in my datasource when a MoveRow is performed. And then re-order the rest of the objects properties with the new index that the MoveRow created. 

I can't seem to get it done, after my move row is complete the ordering just jumps back to the original order. I thought I may need to update the IGGridViewDataSourceHelper.DisplayData as well but that didn't work. 

Any chance you can provide me with some sample code to complete a MoveRow override?

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    So you're using a DataSourceHelper, and you want to perform additional logic after you move a row, right?

    And since you're using C#, that means you can't actually call the base class implementation.... i hate that limitation....

    Anyways, i'd be happy to tell you what we're doing under the hood. 

    If you're not using sections, it's very simple. 

    This is pseudo code, but should give you the basic idea. 

    I'm going to pretend you still have access to the underlying data, and that it's generic. 

    NSObject* obj = _myList[sourcePath.RowIndex];

    _myList.RemoveAt(sourcePath.RowIndex);

    _myList.InsertAt(obj, destinationPath.RowIndex);

    _dsh.data = _myList.ToArray();

    That should do the trick. If you're using sections, then it's a bit more complicated. Just let me know and i'll help you out with that. 

    -SteveZ

Children
No Data