Completed
Last Updated: 10 Oct 2016 08:24 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 18 Mar 2016 12:25
Category: GridView
Type: Bug Report
2
FIX. RadGridView - TargetInvocationException when searching in summary rows
Workaround: skip the summary rows by creating custom GridViewSearchRowInfo:  

private void radGridView1_CreateRowInfo(object sender, GridViewCreateRowInfoEventArgs e)
{
    if (e.RowInfo is GridViewSearchRowInfo)
    {
        e.RowInfo = new CustomGridViewSearchRowInfo(e.ViewInfo);
    }
}


public class CustomGridViewSearchRowInfo : GridViewSearchRowInfo
        {
            public CustomGridViewSearchRowInfo(GridViewInfo viewInfo) : base(viewInfo)
            {
            }

            protected override bool MatchesSearchCriteria(string searchCriteria, GridViewRowInfo row, GridViewColumn col)
            {
                if (row is GridViewSummaryRowInfo)
                {
                    return false;
                }
                return base.MatchesSearchCriteria(searchCriteria, row, col);
            }
        }
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
6 comments
ADMIN
Stefan
Posted on: 19 Sep 2016 12:54
HI Kasim,

feel free to share your project, or at least the form that contains the problematic grid with some dummy data, via support ticket, so we can review the precise case and help you with it.
Kasim
Posted on: 19 Sep 2016 11:20
Hi Dess,

I tried reproducing the error in a separate code, however not getting the same behavior as it gives in my project. Also, attached the telerik source code to diagnose the exception, however it is just throwing a generic error. So, getting no clue on what is causing the exception.
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 19 Sep 2016 05:59
Hello Kasim,

Could you please specify the exact steps how to reproduce the problem or feel free to submit a support ticket where you can provide a sample project so I can investigate the precise case? Thank you in advance.
Kasim
Posted on: 07 Sep 2016 10:20
I tried the code fix shared above, it didn't worked for me.
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 25 Mar 2016 13:08
The test project has been updated to include the correct columns. We will investigate the TargetInvocationException when searching in summary rows.
ADMIN
Ivan Petrov
Posted on: 25 Mar 2016 09:26
The cause of the exceptions was a wrong setup of the summary items. The summary expression was set up to sum the values of a non-existant column.