[MonoTouch] UITableView Scenario Help Needed ---

2012-06-30 Thread proindigo
Hello friends. I have scenario which I will try to explain in details. I have a table ClientAssessments [AssessmentID, ProjectID, ProjectName, StartDate]. Now I am fetching all the data by simple select query and want to show it on a UITableView column. I want that when someone touches a particu

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-01 Thread Jason Awbrey
when you create your cell, you can assign the Tag property to some value from your data, then retrieve it when your cell is selected alternately, you can use the indexPath value to create a index into the array/list/whatever that was used to populate your table, and retrieve the necessary value fr

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-03 Thread proindigo
Thanks for your reply. You mean I have to create cells first for my UITableView? I mean I have a function returning a dataset. Can I not assign this dataset to the DataSource property of the control directly, like we used to do in ASP.Net? Please help me on how to create a cell for a tableview. I

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-03 Thread proindigo
Well I have played around with the code a bit and here is what I have come up with. I have created three classes, BasicTableViewItem, BasicTableViewItemGroup, BasicTableViewSource and ClientAssessment. The last class contains the properties that I want to show from the fetched dataset. Here are th

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-03 Thread proindigo
This is the exception I am getting: System.NullReferenceException:Object reference not set to an instance of an object at this.tblProjects.Source=this._tableViewSource Here tblProjects is my tableview control. -- View this message in context: http://monotouch.2284126.n4.nabble.com/UITableView

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-03 Thread proindigo
Well I have modified the code a bit for the function CreateTableItems(). It makes more sense now, although I am getting two errors. Here is my modified code block for CreateTableItems() public void CreateTableItems () { List tableItems = new List ();

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-03 Thread Jason Awbrey
here you are passing in data to the constructor but doing nothing with it - that's the first thing that jumps out at me as to why you're not getting any data in the table public BasicTableViewItemGroup (List lst) { } On Tue, Jul 3, 2012 at 2:42 AM,

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-04 Thread proindigo
Got my code working. data is being shown in nicely formatted manner in my uitableview. Now the issue is to handle row selection and fetch the corresponding AssessmentID. For reference see the following picture. http://monotouch.2284126.n4.nabble.com/file/n4655749/assessment_home_showing_logged_in_

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-04 Thread Jason Awbrey
in your DataSource class, implement RowSelected. Use the indexPath argument to get the correct element from your data public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { // Do something for the selected row } On Wed, Jul 4, 2012 at 6:26 AM, proindi

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-05 Thread proindigo
Thanks for your reply. I did some googling on RowSelected. It appears that this RowSelected method is contained in the class UITableViewDelegate, which I think I will have to extend into my BasicTableViewSource class. But it already extends the UITableViewSource class. [Fore reference please see m

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-05 Thread proindigo
Finally got my code working. But there's one strange thing I'd like to share. When I was writing my code for user interaction, RowSelected did not appear in the code completion intellisense. I forcefully had to write the code. The code compiled successfully without giving me any errors. Why this st

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-05 Thread proindigo
I am facing a new problem. Actually after showing the AssessmentID in a alert I also want the application to load a new screen AssessmentFacility. What I have done is that I have created a new class inside my DataSOurce class extending from UiViewControlller class. And in it I have written the code

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-05 Thread Jason Awbrey
When you create your TableViewSource class, pass in a reference to the TableViewController. Then in your RowSelected method use that reference to access the NavigationController of the TableViewController On Thu, Jul 5, 2012 at 4:35 AM, proindigo wrote: > I am facing a new problem. Actually aft

Re: [MonoTouch] UITableView Scenario Help Needed ---

2012-07-06 Thread proindigo
Followed your instruction. Application working just as expected now. Navigating to the new screen when I select a row. Thanks for the advice. Great technique. Cheers. -- View this message in context: http://monotouch.2284126.n4.nabble.com/UITableView-Scenario-Help-Needed-tp4655680p4655794.html