Background & Expectations: My window has 2 independent grids with two independent data sources. They do have a common field, but this is not Northwind so there is no linking and no internal relationship.
When I double-click on a record in the top grid, I want too filter the view in the bottom grid such that I identify a key value in both and limit as such. Sounds easy until I realized XamDataGrid has no filtering.
Data: As far as my data goes it is very complex for the Infragistic brain. I am using nested lists which are further derived using linq query. I have massaged the data to the most basic level so that the poor datagrid can find it. The ResultsView is assigned to the DataContext and DataSource respectively.
The fun part:
I've got those two grids, one with an anonymous data type which I need to evaluate and convert to some data type. That's all set. I am attempting to use vew.Filter to filter out the bottom records by the current record in the top. Easy enough, but as usual I am having trouble telling XamDataGrid to refresh itself and use the new filter.
Question: How do I use view.refresh or assign the filtered view to the XamDataGrid and then actually make the view display it?
Suggestions Welcome.
I have included the filter portion of my code behind below.
Glenn
// Grid double-click event
e)
{
.SynchronizeActiveRecordWithCurrentItem();
}
// Filter Call
SynchronizeActiveRecordWithCurrentItem()
_Schedulesgrid =
.RegoSchedulesList;
_Unitsgrid =
.RegoUnitsList;
.GetCurrentSchedulesView();
)
;
.GetCurrentUnitsView();
// Get current Unit Record
currentUnit = unitsview.CurrentItem;
_Unitsgrid.ActiveRecord =
else
);
currentUnitRec.IsActive =
currentUnitRec.IsSelected =
_Unitsgrid.BringRecordIntoView(currentUnitRec);
count = 0;
// end if
view.Filter =
item)
>();
), Segments = MySegments });
if (stronglyTyped.Schedules.ToString() == currentUnitRec.Cells["UnitID"].Value.ToString() && stronglyTyped != null
};
view.Refresh();
// ????????????? This does not work
_Schedulesgrid.DataSource = view;
GetCurrentSchedulesView()
.GetDefaultView(_Schedulesgrid.DataSource);
GetCurrentUnitsView()
.GetDefaultView(_Unitsgrid.DataSource);
Thanks Aaron,
I would like to dive into the new column sorting stuff when I get some down time. The column sorting stuff looks great, but I don't think it's intended to handle this sort of functionalty.
I was able to work out my issue. It's a bit of a hack, but it works beautifully. I've attached the class file such that it may help someone else with a similar request.
Note: this is a partial class and there are many dependencies not shown.
Thanks - Glenn,
PJM Interconnection, LLC.
Valley Forge, PA
Hello Glenn,
As a start, I would check out the brand new Record Filtering features for the XamDataGrid in NetAdvantage for WPF 2009 Volume 1. Thre is a lot of built-in funtionality that you can use in your application. Keep us posted.