Joe Smith
Joe Smith

Reputation: 11

Help with column editor in a data grid!

I have a two different data sources that share one data grid. I have a column editor that allows the user to pick which columns they want to see. This works except, when I change the datasource, the columns change back to to what they started. i want the columns to stay the same as the user the picked them. Any help? thanks

Upvotes: 0

Views: 103

Answers (2)

MAW74656
MAW74656

Reputation: 3549

Sounds to me like the page is posting back and reverting to initial settings. You can put the gridview in an asp.net ajax updatepanel to prevent anything else on the page from changing.

Or you could store the columns in session variables whenever they change and read them then set the proper columns in the page_load event if its a postback.

Upvotes: 0

Paul Keister
Paul Keister

Reputation: 13097

Did you remember to set the AutoGenerateColumns property to false?

Upvotes: 1

Related Questions