Here ListView Data Will Not be Populated on Activated , Data Will be Populated when
You search anything
namespace FilterListView.Module
{
public partial class ViewController1 : ViewController
{
public ViewController1()
{
InitializeComponent();
RegisterActions(components);
}
protected override void OnActivated()
{
base.OnActivated();
if (View is ListView && View.ObjectTypeInfo.Type == typeof(ContactA))
{
ListView lv = (ListView)View;
lv.CollectionSource.CollectionChanged += new EventHandler(CollectionSource_CollectionChanged);
}
}
void CollectionSource_CollectionChanged(object sender, EventArgs e)
{
ListView listView = (ListView)View ;
if (listView.CollectionSource.Collection.Count > 0)
{
if (!listView.CollectionSource.Criteria.ContainsKey("EmptyCollectionCriteria"))
{
listView.CollectionSource.Criteria.Add("EmptyCollectionCriteria", CollectionSource.EmptyCollectionCriteria);
}
listView.CollectionSource.Criteria.Changed += new EventHandler(Criteria_Changed);
}
}
void Criteria_Changed(object sender, EventArgs e)
{
ListView listView = (ListView)View;
listView.CollectionSource.Criteria.Remove("EmptyCollectionCriteria");
}
}
}
Subscribe to:
Post Comments (Atom)
Mat Table Angular
Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...
-
CriteriaOperator criteria = new BinaryOperator("Age", 30, BinaryOperatorType.Greater); CriteriaOperator criteria = CriteriaOperato...
-
SortingCollection sc = new SortingCollection(); sc.Add (new SortProperty("field on which you want to sort",DevExpress.Xpo.DB.Sorti...
-
Minification and Uglyfication in Angular Deployement Minification : While building Angular Application white spaces , unused variable , u...
No comments:
Post a Comment