Hello my forum mates.

I want a UipickerView in my sample app. to be filled with data from a
particular table. I have started defining the PickerDataModel class. But am
facing some problems. The code completion intellisense isn't prompting the
'Selected' method. If I forcefully write it, it is prompting an error, 'Are
you missing a using directive or assembly reference?' message.

What is this issue? Why isn't Selected appearing in my code-completion? What
other namespace do I have to incorporate?

Here is the entire code listing for my PickerDataMode for your perusal:--->

using System;
using System.Collections;
using MonoTouch.UIKit;
using System.Configuration;
using System.IO;
using System.Collections.Generic;
using Mono.Data.Sqlite;
using System.Data;
using System.Data.Common;
namespace ASTONAPP
{
        public class PickerDataModel: UIPickerViewModel
        {
                public PickerDataModel ()
                {
                }

                public List<string> Items 
                {

                        get 
                        { 
                                return this._items; 
                        } 
                        set 
                        { 
                                this._items = value; 
                        }
                }

                List<string> _items = new List<string>();

                public string SelectedItem 
                {
                        get 
                        { 
                                return this._items[this._selectedIndex]; 
                        } 
                }
                public int _selectedIndex = 0;

                public override int GetRowsInComponent (UIPickerView picker, int
component) 
                {
                        return this._items.Count;
                }

                public override string GetTitle (UIPickerView picker, int row, 
int
component) 
                {
                        return this._items[row];
                
                }
                public override int GetComponentCount (UIPickerView picker) 
                {
                        return 1;
                }

                public override void Selected(UIPickerView picker, int row, int 
component)
               {
                       this._selectedIndex=row;
                       if(this.ValueChanged!=null)
                       {
                                   this.ValueChanged(this, new EventArgs());
                       }
               }

        }
}


Can you spot something wrong that I am doing here? What is missing? Look
forward to some active help on this one.

Many Thanks.

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Implementing-UIPickerView-with-data-from-Database-tp4655796.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to