Question: I'd like to get a grid with ability to add subheader (one or several rows) according to value of certain column (data source is grouped sorted by this column). Within my inherited GridView I override OnRowDataBind method: If value of considering column on current call of OnRowDataBind is not equal to previous values, then special header row is inserted before current row. 

`Table tbl = this.Controls[0] as Table; //this - pointer to CustomGridView
tbl.Controls.AddAt(rowIndex + add_counter + 1, NewSubHeaderRow); /*rowIndex - RowIndex of current row, add_counter - amount of already added SubHrader rows */` 

All works right. But problem occures on postback, when GridView restores it's state. First row and all its controls into every group (other words, first row after each dynamically added subheader row) comes without any attributes. But second row in group keeps both its own attributes and attributes of first row. 

Some help will be very usefull. Maybe there is another (and right) way to add row into GridView. Then please, provide me with links to tutorials or articles.

Answer: 
What you need definitely sounds like a hash set, C++ has this as either `std::tr1::unordered_set` or in Boost.Unordered.

P.S. Note, however, that TR1 is not **yet** standard, and you'll probably need to get Boost for the implementation.
What you're looking for is an `unordered_set`. You can find one in Boost, TR1, or C++0x. If you're hoping to associate the key with a value, then `unordered_map` does just that- also in Boost/TR1/C++0x.