Hi
i have added xamdatagrid with hierarchical data. i have added the header at the top of grid for both Parent and child records.
when i click on + sign the child records appear. when i add the row filter on gird as LabelIcons. some columns which related to child layout are not showing anything in filter dropdown.
here i attached the sample project
Please help me its very urgent
Hello,
Thank you for the sample application.
I was researching for a solution regarding the issue you are describing about the filter dropdown values for child records, and I believe that this is the default behavior and currently there is no built in functionality to show the child layout values in filter dropdown of parent field. Still please have in mind that you can populate the filter drop down in order to suit your requirements manually. In order to achieve this I can suggest you handle the RecordFilterDropDownPopulating event of XamDataGrid and add the missing values as new FilterDropDownItem. For further reference about this functionality, please have a look at our sample browser in the section:
XamDataGrid -> Organization -> Custom Filter Drop-down Items.
There in the handler of the RecordFilterDropDownPopulating event is shown how you can add custom drop-down items.
If you have any additional questions on this matter, please let me know.
Sincerely, ZhivkoEntry Level Software Developer
Hi Zhivko
Thank you for Reply. Let me try with event but can you please help me with modified sample..
Regards,
Ripal
Hello Ripal,
Thank you for your feedback.
I have modified your sample application in order to show you how can add the custom items you want to filter menu. Basically I handled the RecordFilterDropDownPopulating and in the event handler I iterate though all records and add new FilterDropDownItems based on the corresponding values for child records to the DropDownItems collection from event arguments, for example:
private void xamDG_RecordFilterDropDownPopulating(object sender, RecordFilterDropDownPopulatingEventArgs e){ FilterDropDownItem item; var expandableRecs = (sender as XamDataGrid).Records.Where(rec => rec.HasChildren).ToList(); foreach (var rec in expandableRecs) { foreach (var childRec in (rec.ViewableChildRecords[0] as ExpandableFieldRecord).ChildRecords) { item = new FilterDropDownItem(new ComparisonCondition(ComparisonOperator.Contains, (childRec as DataRecord).Cells[e.Field.Index].Value.ToString()), (childRec as DataRecord).Cells[e.Field.Index].Value.ToString()); item.Tag = (childRec as DataRecord).Cells[e.Field.Index].Field.Name.ToString(); e.DropDownItems.Add(item); } }}
foreach (var rec in expandableRecs) { foreach (var childRec in (rec.ViewableChildRecords[0] as ExpandableFieldRecord).ChildRecords) { item = new FilterDropDownItem(new ComparisonCondition(ComparisonOperator.Contains, (childRec as DataRecord).Cells[e.Field.Index].Value.ToString()), (childRec as DataRecord).Cells[e.Field.Index].Value.ToString()); item.Tag = (childRec as DataRecord).Cells[e.Field.Index].Field.Name.ToString(); e.DropDownItems.Add(item); } }}
You can take a look at the following forum thread where similar functionality was discussed:
http://www.infragistics.com/community/forums/t/44720.aspx
Let me know if you have any questions.
Hi,
I used the XamDataGrid like you. But there is a strange behaviour when you use the filtering. When you popup the filter combobox you can see entries with the same value more than once. Is there a possibility to change this behaviuor so that I only see the different values in the combobox?
Here is an image wich show this. You can use the XamGrid_ASC_Sample_CustomItemsInFilterDropDown.zip from above to test it.