Walaa wrote:
dgridaccountnature.DataSource = accountnatureview;
Great. So I am on right track. Just one small help. Now on textbox change event, If i want to filter the same view in textchange event, what is the right way of doing it Sir.
In Grid Load I wrote like this which works fine
public void PopulateGrid()
{
var adapteraccountnature = new DataAccessAdapter();
var datasourceaccountnature = new EntityCollection<AccountnatureEntity>(new AccountnatureEntityFactory());
adapteraccountnature.FetchEntityCollection(datasourceaccountnature, null);
IEntityView2 customerView = datasourceaccountnature.DefaultView;
IPredicateExpression filter = new PredicateExpression(AccountnatureFields.Flag == StandardFlag.recordvalidflag);
filter.Add(new FieldLikePredicate(AccountnatureFields.Description, null, "S%"));
customerView.Filter = filter;
dgridaccountnature.DataSource = customerView;
}
Now on text change event, I wrote as follows
var datasourceaccountnature = new EntityCollection<AccountnatureEntity>(new AccountnatureEntityFactory());
IEntityView2 customerView = datasourceaccountnature.DefaultView;
IPredicateExpression filter = new PredicateExpression(AccountnatureFields.Flag == StandardFlag.recordvalidflag);
filter.Add(new FieldLikePredicate(AccountnatureFields.Description, null, "C%"));
customerView.Filter = filter;
Grid load works fine** but text change event does not change to C%**
And if I add dgridaccountnature.DataSource = customerView; in textchange event i get error Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.
If am able to solve this, this solves most my problems in my project