Shinobigridcell display long text


#1

for now i’m building app with shinobigrid,it works well with numbers,but one column should display discription text and the text is very long, shinobigrid auto  trunctate text.so in which way the cell  can display  all text ?


#2

Greetings Program!

I couldn’t find an autoresize property specifically for the cell but I was looking at the ShinobiGrid CustomCell sample app and was thinking you could create custom width cells for the grid.

Also, if you set the canResizeColumnsViaPinch property on the grid, you could let the user handle it.

Wg


#3

As an alternative to wizgod’s approach, you can use the SDataGridMultiLineTextCell to display long text over multiple lines. Simply instantiate a column to use SDataGridMultiLineCell, and write your contents into it with setText: 


#4

tkelly

As an alternative to wizgod’s approach, you can use the SDataGridMultiLineTextCell to display long text over multiple lines. Simply instantiate a column to use SDataGridMultiLineCell, and write your contents into it with setText: 

i change my code but seems don’t work,can you send me a demo?

my code:

SDataGridColumn askColumn = 

new SDataGridColumn (columnname, deff.Name, new Class (“SDataGridMultiLineTextCell”), 

new Class (“OADataGridHeaderCell”));
                        askColumn.Width = NSNumber.FromInt32 (cwidth);
                        askColumn.HeaderCellStyle = headerstyle;
                        grid.AddColumn (askColumn); 

 

 

 

 

protected override void PrepareCellForDisplay (ShinobiDataGrid grid, SDataGridCell cell)
        {
             SDataGridMultiLineTextCell textCell = cell as SDataGridMultiLineTextCell;

textCell.AutosizesSubviews = false; 


#5

Try changing the _ SDataGridMultiLineCell _ to SDataGridMultiLineTextCell.

I tried this in one of the sample apps in and it worked:

SDataGridColumn* nameColumn = [[SDataGridColumn alloc] initWithTitle:@"Forename" cellType:[SDataGridMultiLineTextCell class]];
    nameColumn.editable = YES;
    nameColumn.width = @250;
    [_shinobiDataGrid addColumn:nameColumn];

Wg


#6

wizgod

Try changing the _ SDataGridMultiLineCell _ to SDataGridMultiLineTextCell.

I tried this in one of the sample apps in and it worked:

SDataGridColumn* nameColumn = [[SDataGridColumn alloc] initWithTitle:@"Forename" cellType:[SDataGridMultiLineTextCell class]];
    nameColumn.editable = YES;
    nameColumn.width = @250;
    [_shinobiDataGrid addColumn:nameColumn];

Wg

i’m using  SDataGridMultiLineTextCell,i seems not work.can you send me a xcode project demo.


#7

I’m not sure what I can provide; I don’t have anything other than the sample code that comes with the controls. All I did was use thier HandlingEditing sample app and change the one line:

SDataGridColumn* nameColumn = [[SDataGridColumn alloc] initWithTitle:@"Forename" cellType:[SDataGridMultiLineTextCell class]];

Also making sure to use the same class when casting the cell for the column in the prepareCellForDisplay and didFinishEditingCellAtCoordinate methods.

Wg


#8

wizgod

I’m not sure what I can provide; I don’t have anything other than the sample code that comes with the controls. All I did was use thier HandlingEditing sample app and change the one line:

SDataGridColumn* nameColumn = [[SDataGridColumn alloc] initWithTitle:@"Forename" cellType:[SDataGridMultiLineTextCell class]];

Also making sure to use the same class when casting the cell for the column in the prepareCellForDisplay and didFinishEditingCellAtCoordinate methods.

Wg

 i override HeightForRow method it the cell get height show all the text,any way let the cell auto adjust it's height by the rows width and the text length?