Hi,
I'm looking for an example to the implementation of viewForSectionColumn but in C#. The examples and documentation are all in objective C.
I'm using a datasource helper.
Thanks
Kathy
Hi Kathy,
Sure!
Basically, you just need to override this method on your implementation of your IGGridViewDelegate:
public class GriDelegate : IGGridViewDelegate { public override UIView ResolveSectionColumnView (IGGridView gridView, int section) { UIView v = new UIView (new RectangleF (0, 0, 0, 100)); v.BackgroundColor = (section%2==0)? UIColor.Red : UIColor.Green; return v; } }
You'll then just return the view you want to display, based on the section. One thing that you have to specify, is the height of the view. In the above example, the height i'm specifying is 100pts.
And here is the code to setup the grid:
grid.Delegate = new GriDelegate (); IGGridViewDataSourceHelper dsh = new IGGridViewDataSourceHelper (); dsh.GroupingKey = "firstName"; dsh.Data = IGSalesmanItem.GenerateData (100).ToArray (); grid.DataSource = dsh;
Hope this helps!
-SteveZ
Hi Steve,
That did help and thanks for answering so quickly. One other question, how do I get the data that's in column 0 connected to the columnView? right now what shows is the background color.