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
Grid View Selected Row Changed Event
posted

Hey - Should be another really simple question. Just looking to handle a Selected Row Changed Event when a row selection is changed in the GridView. I might have my head stuck in a typical WinForms environment but essentially, I just need to execute some code when the Selected Row in the GridView is changed. My thought process is to handle an event on the GridView for SelectedRowChanged but it's probably something different.

 

 

Thanks.

  • 40030
    Verified Answer
    Offline posted

    Hi, 

    Yup its a little bit different in iOS. 

    Basically thats what the delegate is for. I actually wrote a blog post on this not to long ago:

    http://es.infragistics.com/community/blogs/stevez/archive/2012/12/10/c-to-objective-c-part-10-events.aspx

    All you need to do is  implement the IGGridViewDelegate protocol. In monotouch its slightly different, as a protocol is basically like an interface in objective-c however in monotouch they had to do it slightly different, so its actually another class.

    So anyways, it would look something like this:

    public class GridDelegate :IGGridViewDelegate
        {
            public override void DidSelectRow (IGGridView gridView, IGRowPath path)
            {

            }
        }

    And you would hook up your grid like this:

    grid.WeakDelegate = new GridDelegate ();

    I assumed you wanted this in C# based on other questions you've posted. If you need it objective-c instead, let me know.

    -SteveZ