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

[Solved] GridView collapse current record after every refresh

3 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jose
Top achievements
Rank 2
Jose asked on 12 Oct 2010, 07:14 PM
Hello,

I'm following the example provide in demo page in order to show 2 child grids in 2 tabs.

All works fine, but every time that I refresh, sort, filter, etc., one of the grids (master, child, etc) the master current record is collapse and I need to open again it to see the contents.

I'm working in server mode.

It's there any solution to leave open the details view after a refresh?
Regards
Jose

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 13 Oct 2010, 07:34 AM
Hello Jose,

Use the RowAction event and expand the DetailView like this:

.RowAction(row => 
        {
            if (/*some condition*/)
            {
                row.DetailRow.Expanded = true;
            }
})


Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jose
Top achievements
Rank 2
answered on 13 Oct 2010, 09:20 AM
Thank you very much Atanas,

I'm doing this for the first record as demo example, but I cannot figure how to know what record was displayed when user press any of the options that refresh the grid (sort, refresh, etc.) in order to expand these record or if this is possible.

Any idea?
Regards
Jose
0
Atanas Korchev
Telerik team
answered on 13 Oct 2010, 02:53 PM
Hello Jose,

A possible solution is to store the expanded parent rows (their key precisely) in a query string variable and pass it along when the grid pages, sorts etc. This is not a trivial task but is possible. I have attached a sample project which can help you get started.

All the best,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Jose
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Jose
Top achievements
Rank 2
Share this question
or