Where can I get a GridView?

Discussion in 'iOS Programming' started by mikezang, Jun 21, 2010.

Thread Status:
Not open for further replies.
  1. mikezang macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #1
    I have a Excel file to manage my stock trading.

    I want to port it to iPad, of course not all Excel functions, just have a GridView to show my stock data like in Excel, where can I find a GridView? is the TableView in iPad also a GridView?
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    It's a single-column grid. With some effort, I suppose you could make a custom UITableViewCell to make it work like multiple columns.
     
  3. seepel macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #3
    this is how the photos app is done
     
  4. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
  5. dmelgar macrumors 68000

    Joined:
    Apr 29, 2005
    #5
    I'm looking for this as well.
    Some of the approaches I've seen mentioned include:

    1. AQGridView
    2. DTGridView
    3. Create your own UITableViewCell with multiple columns. Some references said it was relatively easy...

    I've seen most references for AQGridView. Is that considered the best and simplest approach?
     
  6. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #6
    I make a custom table cell, now I can get a Excel Format table.
     
  7. dmelgar macrumors 68000

    Joined:
    Apr 29, 2005
    #7
    Is there sample code around to do that? Book or project or blog post?
     
  8. mikezang thread starter macrumors 6502a

    Joined:
    May 22, 2010
    Location:
    Tokyo, Japan
    #8
    Make a customer TableCell and TableView
    Code:
    #import <UIKit/UIKit.h>
    @interface TradeCell : UITableViewCell {
    	UILabel *labelStartDate;
    	UILabel *labelEndDate;
    	UILabel *labelTradeType;
    	UILabel *labelCode;
    	UILabel *labelAmount;
    	UILabel *labelStartPrice;
    	UILabel *labelEndPrice;
    	UILabel *labelPosition;
    	UILabel *labelProfitLoss;
    	UILabel *labelProfitLossRate;
    	UILabel *labelFee;
    	UILabel *labelTax;
    	UILabel *labelInterest;
    }
    @property (nonatomic, retain) IBOutlet UILabel *labelStartDate;
    @property (nonatomic, retain) IBOutlet UILabel *labelEndDate;
    @property (nonatomic, retain) IBOutlet UILabel *labelTradeType;
    @property (nonatomic, retain) IBOutlet UILabel *labelCode;
    @property (nonatomic, retain) IBOutlet UILabel *labelAmount;
    @property (nonatomic, retain) IBOutlet UILabel *labelStartPrice;
    @property (nonatomic, retain) IBOutlet UILabel *labelEndPrice;
    @property (nonatomic, retain) IBOutlet UILabel *labelPosition;
    @property (nonatomic, retain) IBOutlet UILabel *labelProfitLoss;
    @property (nonatomic, retain) IBOutlet UILabel *labelProfitLossRate;
    @property (nonatomic, retain) IBOutlet UILabel *labelFee;
    @property (nonatomic, retain) IBOutlet UILabel *labelTax;
    @property (nonatomic, retain) IBOutlet UILabel *labelInterest;
    @end
    
    Code:
    #import <UIKit/UIKit.h>
    
    #define kTableViewRowHeight		44
    #define kTradeFilename			@"trade.plist"
    #define kTradeKey				@"Trades"
    
    @interface TradeTableController : UIViewController <UITableViewDelegate, UITableViewDataSource>  {
    	NSMutableArray *list;
    	UITableView *viewHeader;
    	UITableView *viewDetail;
    }
    
    @property (nonatomic, retain) NSMutableArray *list;
    @property (nonatomic, retain) IBOutlet UITableView *rowHeader;
    @property (nonatomic, retain) IBOutlet UITableView *rowDetail;
    
    -(IBAction) toggleEdit:(id)sender;
    -(NSString *) tradeFilePath;
    -(void) applicationWillTerminate:(NSNotification *)notification;
    
    @end
    
    screen like this
     

    Attached Files:

  9. dmelgar macrumors 68000

    Joined:
    Apr 29, 2005
    #9
    Thanks! That gave me enough of the idea I was able to Google and found examples. Still ran into issues but worked through them. My biggest one was that I didn't realize the UITableView has a property for the row size.

    Its working for me with my own view.

    Thanks!
     
  10. f.sabri macrumors newbie

    Joined:
    May 25, 2011
    #10
    Dear mikezang ,

    can u please send me the sample that you make for the custom TableCell and TableView

    My Email : faisal.ysabri@gmail.com

    i will really appreciate it very
    Accept my highest consideration...
     
Thread Status:
Not open for further replies.

Share This Page