public ChemicalsAdapter(Activity activity, IEnumerable <Chemical> chemicals) { _items = chemicals.OrderBy(s => s.Name).ToList(); _context = activity; Filter = new ChemicalFilter(this); }
public override View GetView(int position, View convertView, ViewGroup parent) { Filter = new ChemicalFilter(this); var view = convertView; if (view == null) { view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.marking_data, null); TextView Department = view.FindViewById <TextView>(Resource.Id.textView1); TextView DepartmentText = view.FindViewById <TextView>(Resource.Id.textView2); //TextView Name = view.FindViewById<TextView>(Resource.Id.textView3); TextView NameText = view.FindViewById <TextView>(Resource.Id.textView4); view.Tag = new OrgListAdapterViewHolder() { Department = DepartmentText, name = NameText }; } var holder = (OrgListAdapterViewHolder)view.Tag; holder.Department.Text = marking[position].DesignationName; holder.name.Text = marking[position].NPName; string desid = marking[position].DesignationId; return(view); }