fiogf49gjkf0d Jay,
You absolutely can bind a Sublogix entity list to a datagrid in a .NET Extension. This is an example that would bind all contacts for a particular account to a grid, where the account ID is the Current ID passed into the .NETExtensionHelper event (sorry, I don't know VB syntax)
private void UserControl1_SalesLogixRecordChanged(string CurrentID) { var repo = New Repository(SlxApplication.ConnectionString); var contacts = repo.Find<Contact>(x => x.Accountid == CurrentID); DataGridView1.DataSource = contacts; }
Make sense?
Or if the Linq expression makes it hard to understand (or to translate back to VB), you can also do it like this:
private void UserControl1_SalesLogixRecordChanged(string CurrentID) { var repo = New Repository(SlxApplication.ConnectionString); var contacts = repo.Select<Contact>() .Where("AccountId", Operator.Equals, CurrentID) .OrderBy("LastName", OrderByDirection.Ascending) //this line optional .Execute(); DataGridView1.DataSource = contacts; }
|