By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

show collapsible datagrid headers

P: n/a
Hi,

I am trying to build the following functionality in the datagrid.

I have a lot of columns in the datagrid which are being populated from the
database and the user needs to scroll horizontally to view these coloumn
names.
So I want to group them into
categories which will fit into a page.
A user clicks a category and the category should
expand into its underlying set of columns belonging to that category.The
categories may be statically defined in the aspx page but the columns are
coming from the database.

So initially when the grid loads the user only sees the main categories of
the data as column headers.He can click the column headers and they
should expand to display the set of columns and their data

How do I do this?

Thanks in advance for your help.

cooltech77
Mar 5 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can't do this with the DataGrid control itself, but here's another
potential solution. If you have fixed number of categories, why not arrange
your page using DIV tags each category should have two DIV Tags, one is
allways visible and the other will display depending on what category
heading is clicked so you can build in the logic to provided a scenario that
when one clicks to expand a section all the others collapse in each
collapsable DIV you place a datagrid and have this display your custom
colums.

If your categories are variable, you could consider building your page
programatically.

You just need to be clever about how you go about servicing the various
events for each grid, just have one event handler for all the grids main
events such as Update, Edit, Delete etc

Just a thought. Also, there may be third party grids which will do what you
want.

HTH
--
Terry Burns
http://TrainingOn.net

"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Hi,

I am trying to build the following functionality in the datagrid.

I have a lot of columns in the datagrid which are being populated from the
database and the user needs to scroll horizontally to view these coloumn
names.
So I want to group them into
categories which will fit into a page.
A user clicks a category and the category should
expand into its underlying set of columns belonging to that category.The
categories may be statically defined in the aspx page but the columns are
coming from the database.

So initially when the grid loads the user only sees the main categories of
the data as column headers.He can click the column headers and they
should expand to display the set of columns and their data

How do I do this?

Thanks in advance for your help.

cooltech77

Mar 5 '06 #2

P: n/a
Thanks for your reply.My categories are fixed and I just need to show the
data,no Updates or Deletes are allowed so I can use just one datagrid as you
suggested.
My question is,how to associate the DIV tags with the column names from the
database?I can write the DIV tags to expand/hide the column but then how will
I associate it with showing/hiding data from the datagrid? .I am a bit of a
newbie so pardon me if these questions seem basic.

thanks in advance.
cooltech77

"Terry Burns" wrote:
You can't do this with the DataGrid control itself, but here's another
potential solution. If you have fixed number of categories, why not arrange
your page using DIV tags each category should have two DIV Tags, one is
allways visible and the other will display depending on what category
heading is clicked so you can build in the logic to provided a scenario that
when one clicks to expand a section all the others collapse in each
collapsable DIV you place a datagrid and have this display your custom
colums.

If your categories are variable, you could consider building your page
programatically.

You just need to be clever about how you go about servicing the various
events for each grid, just have one event handler for all the grids main
events such as Update, Edit, Delete etc

Just a thought. Also, there may be third party grids which will do what you
want.

HTH
--
Terry Burns
http://TrainingOn.net

"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
Hi,

I am trying to build the following functionality in the datagrid.

I have a lot of columns in the datagrid which are being populated from the
database and the user needs to scroll horizontally to view these coloumn
names.
So I want to group them into
categories which will fit into a page.
A user clicks a category and the category should
expand into its underlying set of columns belonging to that category.The
categories may be statically defined in the aspx page but the columns are
coming from the database.

So initially when the grid loads the user only sees the main categories of
the data as column headers.He can click the column headers and they
should expand to display the set of columns and their data

How do I do this?

Thanks in advance for your help.

cooltech77


Mar 5 '06 #3

P: n/a
Sorry, we seem to be at cross purposes here, I now see what you are trying
to acheive, The only way I can think you can do this with the standard
datagrid is to have your category columns headers clickable and then to hide
the relevant columns.

--
Terry Burns
http://TrainingOn.net
"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Thanks for your reply.My categories are fixed and I just need to show the
data,no Updates or Deletes are allowed so I can use just one datagrid as
you
suggested.
My question is,how to associate the DIV tags with the column names from
the
database?I can write the DIV tags to expand/hide the column but then how
will
I associate it with showing/hiding data from the datagrid? .I am a bit of
a
newbie so pardon me if these questions seem basic.

thanks in advance.
cooltech77

"Terry Burns" wrote:
You can't do this with the DataGrid control itself, but here's another
potential solution. If you have fixed number of categories, why not
arrange
your page using DIV tags each category should have two DIV Tags, one is
allways visible and the other will display depending on what category
heading is clicked so you can build in the logic to provided a scenario
that
when one clicks to expand a section all the others collapse in each
collapsable DIV you place a datagrid and have this display your custom
colums.

If your categories are variable, you could consider building your page
programatically.

You just need to be clever about how you go about servicing the various
events for each grid, just have one event handler for all the grids main
events such as Update, Edit, Delete etc

Just a thought. Also, there may be third party grids which will do what
you
want.

HTH
--
Terry Burns
http://TrainingOn.net

"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
> Hi,
>
> I am trying to build the following functionality in the datagrid.
>
> I have a lot of columns in the datagrid which are being populated from
> the
> database and the user needs to scroll horizontally to view these
> coloumn
> names.
> So I want to group them into
> categories which will fit into a page.
> A user clicks a category and the category should
> expand into its underlying set of columns belonging to that
> category.The
> categories may be statically defined in the aspx page but the columns
> are
> coming from the database.
>
> So initially when the grid loads the user only sees the main categories
> of
> the data as column headers.He can click the column headers and they
> should expand to display the set of columns and their data
>
> How do I do this?
>
> Thanks in advance for your help.
>
> cooltech77
>
>


Mar 5 '06 #4

P: n/a
ok but the problem is that my cateogry column names are not coming from the
database while its underlying columnsare..Let me explain
I get a bunch of fields showing my expenses ,for example, from the database.
I get the fields as say
CarInsurance,homeInsurance,books,movies,eatingOut, grocery

After getting the fields I decide I want to show Carinsurance and
homeInsurannce under one column heading as Insurance.when i click Insurance
it should expand to show me columns for CarInsurance and HomeInsurance.Then i
decide I want to show eatingOut and Grocery under Category name
FoodExpenses.So these category names are not coming from the database.

So i might have to create DIV tags and associate them with the datagrid
column headings..but the question is how?

thanks
"Terry Burns" wrote:
Sorry, we seem to be at cross purposes here, I now see what you are trying
to acheive, The only way I can think you can do this with the standard
datagrid is to have your category columns headers clickable and then to hide
the relevant columns.

--
Terry Burns
http://TrainingOn.net
"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com...
Thanks for your reply.My categories are fixed and I just need to show the
data,no Updates or Deletes are allowed so I can use just one datagrid as
you
suggested.
My question is,how to associate the DIV tags with the column names from
the
database?I can write the DIV tags to expand/hide the column but then how
will
I associate it with showing/hiding data from the datagrid? .I am a bit of
a
newbie so pardon me if these questions seem basic.

thanks in advance.
cooltech77

"Terry Burns" wrote:
You can't do this with the DataGrid control itself, but here's another
potential solution. If you have fixed number of categories, why not
arrange
your page using DIV tags each category should have two DIV Tags, one is
allways visible and the other will display depending on what category
heading is clicked so you can build in the logic to provided a scenario
that
when one clicks to expand a section all the others collapse in each
collapsable DIV you place a datagrid and have this display your custom
colums.

If your categories are variable, you could consider building your page
programatically.

You just need to be clever about how you go about servicing the various
events for each grid, just have one event handler for all the grids main
events such as Update, Edit, Delete etc

Just a thought. Also, there may be third party grids which will do what
you
want.

HTH
--
Terry Burns
http://TrainingOn.net

"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
> Hi,
>
> I am trying to build the following functionality in the datagrid.
>
> I have a lot of columns in the datagrid which are being populated from
> the
> database and the user needs to scroll horizontally to view these
> coloumn
> names.
> So I want to group them into
> categories which will fit into a page.
> A user clicks a category and the category should
> expand into its underlying set of columns belonging to that
> category.The
> categories may be statically defined in the aspx page but the columns
> are
> coming from the database.
>
> So initially when the grid loads the user only sees the main categories
> of
> the data as column headers.He can click the column headers and they
> should expand to display the set of columns and their data
>
> How do I do this?
>
> Thanks in advance for your help.
>
> cooltech77
>
>


Mar 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.