Hi,
I use a ViewModel as a source for my datagrid. One property is an observablecollection<string>. What happens is the observable column appears as a "+" sign to the left of every row and when i click on the "+" sign it shows me the columns whose types were observable.
Is it not possible to display them in a cell and not when the user clicks on the + sign? Also, when i select the column (observable) and when I try to get the currently selected record it throws a null but gets me the correct row when I click on the columns not of type observable. See code below.
Please not that I have few observable columns which needs to be edited and few non editable.
void XamDgScheduledAudit_RecordActivated(object sender, Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs e)
{
var dr = e.Record.DataPresenter.ActiveRecord as DataRecord;
var recVal = dr.DataItem as ScheduleAuditInfoViewModel;
}
Thanks,Ranjith
Ranjith,
I do not have a sample right now, but you can look at the following forum threads:
http://community.infragistics.com/forums/p/26622/97841.aspx#97841
http://community.infragistics.com/forums/p/27016/99332.aspx#99332
Hello Alex,
I'm new to WPF and Infragistics. Can you provide any sample code if possible?
Thanks,
Ranjith
Hello Ranjith,
You can make this ObservableCollection field to an unbound field and set its BindingPath property to the property of that type. You have to provide custom CellValuePresenter so that the cell will display data of type collection - make the control an items control.
Hope this helps.