467,907 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

Showing/Hiding different headers in Single Datagrid

Hi! Guys
I think some of you can help me here.
Here is the situation......

I have a following columns from different tables and
get a Dataset to Bind with a data grid.

1)ItemId int
2)FeatureId smallint
3)ItemName nvarchar(255)
4)ItemCategory
5)ItemPrice

and so on(not relavent here)

FeatureID =2
==> Best Selling Items
FeatureID =1
==> Best Value Items
FeatureID =0
==> Items
The reason for using a DataGrid is I want to Sort this
Dataset with different fields like Category and Price.

My default Dataset is always sort by featureid in descending order
so that I can have all the Best selling first, then Best value
items and then any Normal items.

My problem is I want to use a SINGLE grid
('casuse easier to handle pagining,sorting and coding)
and want to Display in default mode like

-------------- GRID 1---------------------------------
Best Selling Items
-------------------------------------------------------
Item Name ItemCategory ItemPrice QtyOnHand
-------------------------------------------------------
ITEMA CATEGORY_A $1.00 20
ITEMB CATEGORY_B $1.00 20
Best Value Items
-------------------------------------------------------
Item Name ItemCategory ItemPrice QtyOnHand
-------------------------------------------------------
ITEMA CATEGORY_A $1.00 20
ITEMB CATEGORY_B $1.00 20

Items
-------------------------------------------------------
Item Name ItemCategory ItemPrice QtyOnHand
-------------------------------------------------------
ITEMA CATEGORY_A $1.00 20
ITEMB CATEGORY_B $1.00 20

-------------- END OF GRID 1----------------------------

1)How can I code different headers in the same grid
2)When I sort to another field(e.g Price) all these
different header formatting should no longer be shown
and display in simple format like this

-------------- GRID 1---------------------------------
Items
-------------------------------------------------------
Item Name ItemCategory ItemPrice QtyOnHand
-------------------------------------------------------
ITEMA CATEGORY_A $1.00 20
ITEMB CATEGORY_B $1.00 20
ITEMc CATEGORY_B $2.00 20
ITEMz CATEGORY_B $4.00 20

-------------- END OF GRID 1----------------------------

Don't care about any feature(Best Selling/Value) just
in proper sorted field

Waiting for your replys
Your help is greatly appriciated.

Thanks,
John
Nov 18 '05 #1
  • viewed: 885
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by c.anandkumar | last post: by
2 posts views Thread by Kevin | last post: by
3 posts views Thread by Kenneth | last post: by
2 posts views Thread by tshad | last post: by
reply views Thread by Rahul Goel | last post: by
3 posts views Thread by Gidi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.