Hello,
I have a Filter Row in my GridView's header. The normal behaviour of filter is to hide the unmatching rows.
But my requirement is to highlight the matching rows and unmatched rows will still be shown. I am using the following function to do that. I am trying to set the IsSelected Property of the matching records to true, which i hoped will highlight the row. But it is not doing that. Please help.
public void ApplySelect(object sender) |
{ |
try |
{ |
var senderElement = sender as FrameworkElement; |
FilterRowDescriptor newDescriptor = new FilterRowDescriptor(); |
newDescriptor.LogicalOperator = FilterCompositionLogicalOperator.And; |
int idx=0; |
foreach (MainPage.BuyHeadView bhRow in this.grid.Items) |
{ |
TextBox txt = senderElement as TextBox; |
if (bhRow.CampaignName.StartsWith(txt.Text.Trim())) |
{ |
this.grid.Records[idx].IsSelected = true; |
} |
idx++; |
} |
//headerRow.ParentGrid.FilterDescriptors.Remove(headerRow.ParentGrid.FilterDescriptors.Where(fd => fd is FilterRowDescriptor).FirstOrDefault()); |
//headerRow.ParentGrid.FilterDescriptors.Add(newDescriptor); |
} |
catch |
{ |
} |
} |