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
460
Example in C# of setting up a custom header in a grid
posted

I'd like to get an example  of setting a custom header (just text, but may require more than one line) in C#.  I'm not even sure at this point of how to make the header appear.  I like you NucliOS app but find it difficult to follow since I don't know how to convert Objective C to C#.  The app contains some good examples, just not in C#....

Parents
  • 40030
    Verified Answer
    Offline posted

    Hi Kathryn, 

    Sure, I'd be happy to help you!

    We don't currently have our samples browser in C#, however if you have any particular sample or any questions, you can feel free to post them here, and we're normally pretty quick at getting you a snippet or even a sample to demonstrate what you're looking for. 

    For a custom header, i just need a little information on how you're using the IGGridView. Are your using a IGGridViewDataSourceHelper? Or are you implementing your own IGGridViewDatSource?

    For the IGGridViewDataSource, you would simply override the TitleForHeaderInColumn method.

    public class MyDataSource :IGGridViewDataSource    
        {
            public override string TitleForHeaderInColumn (IGGridView gridView, int column)
            {
                if (column == 0)
                    return "Column 1";

                return "Other Columns";
            }
        }

    If you're using one of our IGGridViewDataSourceHelper classes, you would add your IGGridViewColumnDefinitions and specify the header text:

    dsh = new IGGridViewDataSourceHelper ();
                IGGridViewColumnDefinition col = new IGGridViewColumnDefinition (@"firstName");
                col.HeaderText = @"First Name";
                dsh.ColumnDefinitions.Add (col);

    If you need more guidance, just let me know!

    Btw, if you're interested, i've posted a series of blog posts that are designed to help developers familiar with C# learn objective-c:

    http://ko.infragistics.com/community/blogs/stevez/archive/2013/05/09/c-to-objective-c-the-ultimate-guide.aspx

    If you plan on working on iOS for a bit, perhaps they'll be helpful.

    -SteveZ

Reply Children
No Data