This is a migrated thread and some comments may be shown as answers.

RadGrid NestedView

2 Answers 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
spt3210
Top achievements
Rank 1
spt3210 asked on 12 Oct 2010, 03:21 PM
Hi,

I have a RadGrid and another grid inside as NestedViewTemplate.

Whenever I click on expand button for any row, NeedDataSource for Parent Grid is also getting called, causing performance issues.

Is there a way I can avoid this?

Please let me know if any more information is needed.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 12 Oct 2010, 03:26 PM

Try this and see if it helps.

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        // check if not rebinding detail table
        if (e.RebindReason != GridRebindReason.DetailTableBinding)
        {
            // do MasterTable binding
        }
    }
0
spt3210
Top achievements
Rank 1
answered on 12 Oct 2010, 03:53 PM
Hi Cori,

Thanks a lot for quick response.

It's working as I expected, there is one change though.
The e.RebindReason comes as "DetailTableBinding | PostBackEvent", so we need to use Bitwise enum operation to check this.

Here's the code I used:
if ((e.RebindReason & GridRebindReason.DetailTableBinding) != GridRebindReason.DetailTableBinding)

Thanks again!

Tags
General Discussions
Asked by
spt3210
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
spt3210
Top achievements
Rank 1
Share this question
or