didFinishLayingOutShinobiDataGrid Not Called


#1

In an attempt to modify the padding on the header cells I’ve followed the posting below…

http://www.shinobicontrols.com/forum/shinobicontrols/2013/5/change-the-padding-on-a-header-and-cells-of-a-column-or-row-/

I’ve implemented the delegate method  didFinishLayingOutShinobiDataGrid

#pragma mark Shinobi Data Grid Delegate Methods
- (void)didFinishLayingOutShinobiDataGrid:(ShinobiDataGrid *)grid
{
    for(SDataGridColumn *col in grid.columns){
        SDataGridHeaderCell *hcell = col.headerCell;
        [hcell setLeftIndentForTextView:3];
        hcell.frame = hcell.frame;
    }
}

I’ve also declared the protocol in my header file…

@interface ViewController : UIViewController <SDataGridDataSource, SDataGridDelegate>

didFinishLayingOutShinobiDataGrid is never called, however.  Any help would be appreciated.

Rob


#2

I found my issue with the delegate method not being called…  Hadn’t set .delegate=self.  Doh.

However, a new issue…

The indentations are setting properly with the following code, 

#pragma mark Shinobi Data Grid Delegate Methods
- (void)didFinishLayingOutShinobiDataGrid:(ShinobiDataGrid *)grid
{
    for(SDataGridColumn *col in grid.columns){
        SDataGridHeaderCell *hcell = col.headerCell;
        [hcell setLeftIndentForTextView:0.f];
        [hcell setRightIndentForTextView:0.f];
        hcell.frame = hcell.frame;
    }
}

However, the headerCell text seems to be getting corrupted:

If I scroll horizontally, the values seem to appear and disappear.

If I comment out the .delegate = self;, everything behaves properly again:

Any ideas?  My datasource for the column headers is a simple array.

Thx,

Rob