sorting composite control data on postback

A

Aaron Prohaska

I can't seem to figure out how to make this work. I need some sort of
design for a composite control that will allow the following things to
happen in the order listed.

-------------------------------
Page is not postback.
-------------------------------
Get datatable with data from my data tier.
DataTable data = DataTier.GetItems();
Save data to ViewState

loop through data and fill properties of child controls.

add child controls to composite control.

-------------------------------
Page is postback
-------------------------------
Get data from ViewState so I don't have to hit the database to get the
same data.
data = (DataTable)ViewState["name"];

sort data using a DropDownList to fire the postback event and retrieve
the column name to sort by.

save sorted data to ViewState["name"];

loop through sorted data and fill properties of child controls.

add child controls to composite control.

Obviously part of the reason that I'm having a hard time with this is
because I don't completely understand the execution cycle of the control
and don't know when each action should happen to make this work.

regards,

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top