SDataGridHeaderMultiLineCell example


#1

Sorry i am newbie in IOS and want also to use the Shinobi for my app. i need to enable a multiline column header to fit my column title and SDataGridHeaderMultiLineCell is recommended or only way to do this, how can i implement this, i cannot find any example related to this.

thanks,

ariel


#2

Greetings Program!

I though simply setting the headerCellType would do the trick but it didn’t work for me; it just truncated the long title text.

column.headerCellType = [SDataGridHeaderMultiLineCell class];

Wg


#3

it works only in one column but the rest got truncated, what is wrong?  :confused:

column = [[SDataGridColumn alloc] initWithTitle:@"Line Items"];
    column.editable = NO;
    
    column.headerCellStyle.contentInset = padding;
    column.width = @80;
    column.headerCellType=[SDataGridHeaderMultiLineCell class];
    column.headerCellStyle.textAlignment = NSTextAlignmentLeft;
    
    cellStyle = [[SDataGridCellStyle alloc] init];
    cellStyle.font = font;
    cellStyle.contentInset = padding;
    cellStyle.textAlignment = NSTextAlignmentCenter;
    column.cellStyle = cellStyle;
    [_shinobiDataGrid addColumn:column];
    

    column = [[SDataGridColumn alloc] initWithTitle:@"Units Ordered"];
    column.editable = NO;
    column.width = @80;
    column.headerCellStyle.contentInset = padding;
    column.headerCellType=[SDataGridHeaderMultiLineCell class];
    column.headerCellStyle.textAlignment = NSTextAlignmentCenter;
    
    cellStyle = [[SDataGridCellStyle alloc] init];
    cellStyle.font = font;
    cellStyle.contentInset = padding;
    cellStyle.textAlignment = NSTextAlignmentCenter;
    column.cellStyle = cellStyle;
    [_shinobiDataGrid addColumn:column];
    
    column = [[SDataGridColumn alloc] initWithTitle:@"Units Recvd"];
    column.editable = NO;
    column.headerCellType=[SDataGridHeaderMultiLineCell class];
    
    column.width = @88;
    column.headerCellStyle.contentInset = padding;
    column.headerCellStyle.textAlignment = NSTextAlignmentCenter;
    
    cellStyle = [[SDataGridCellStyle alloc] init];
    cellStyle.font = font;
    cellStyle.contentInset = padding;
    cellStyle.textAlignment = NSTextAlignmentCenter;
    column.cellStyle = cellStyle;
    [_shinobiDataGrid addColumn:column];
    
    
    column = [[SDataGridColumn alloc] initWithTitle:@"Temp Taken"];
    column.editable = NO;
    column.width = @88;
    column.headerCellStyle.contentInset = padding;
    column.headerCellStyle.textAlignment = NSTextAlignmentCenter;
    
    cellStyle = [[SDataGridCellStyle alloc] init];
    cellStyle.font = font;
    cellStyle.contentInset = padding;
    column.headerCellType=[SDataGridHeaderMultiLineCell class];
    
    cellStyle.textAlignment = NSTextAlignmentCenter;
    column.cellStyle = cellStyle;
    [_shinobiDataGrid addColumn:column];

#4

I’m at a loss on this one; it won’t even work for one column for me.

Wg


#5

i play with the column size :smiley: