Sticky Posts in GridView

U

Uriah Piddle

Hi Gang,

I've given up looking and I am pretty sure it does not exist but I thought I
should do a post just in case I'm wrong: I am making an online forum in VS
2005 using the ASP GridView. I want to be able to make some posts 'Sticky'
and have them stay at the top of the grid no matter when they were created.
I am pretty sure I could do this procedurally in the C# module but I do not
want to loose everything I get by having a data bound control.

Does anyone know of some easy way to cause a row to stay in a group of rows
that always stays at the top?

Thanks,

Steve
 
G

Guest

Sure.
If you are going to use DataBinding, you need to put in some sort of code
that will ensure that your "Sticky" items are always the first N items in the
datasource.

So for example if you had a DataTable, you would have some code that does
InsertAt to insert these rows at the very beginning, then when you do your
databinding they will always be the first rows.
Peter
 
U

Uriah Piddle

Peter,

I tried to find a property that allows me to position a row in the
RowCreated code block but couldn't. Then I realized that I could just put
the whole thing in the 'ORDER BY' SQL statement. Sometimes things are
simpler than they appear (famous last words).

Thanks.

Steve
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top