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

question about grid columns

P: n/a
Hi all,
What is the best way to allow the administrator of the application to
select which columns are displayed in a Databound grid in an aspx form. I
was thinking of creating a form and display all possible columns with a
checkbox. The admin would check the checkboxes for each column they want to
display in the grid. My question is where should I save these settings ( in
XML or SQL Server?). Also when these settings are changed, how can I force
the application to use the updated settings if the application is already
running. Where should I write the code to read these settings(I was thinking
to use Application_Start in global.asax and store the settings in
Application object) and to save these settings(I have no idea where should I
write code to save settings). Any code samples would also be appreciated.

Thanks in advance.
Nikhil
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Hi Nikhil,

The answer to your question depends heavily on your requirements. For
example, can the administrator select settings for more than one datagrid, or
all datagrid types inherit from one selection.

In any case, I would recommend using Database for such a purpose. It's also
better to create the datagrid on a request basis. This way, you can reflect
the latest changes. If I were you (and once I did this in a similiar
situation) I would write a stored procedure, which returns data and also the
datagrid meta information, such as which columns to display, their headtexts,
etc. This would give you the biggest flexibilty. It's only downside is, when
you want to do cell specific processing (for example making a cell red if
it's value is less than a threshold etc.) then you need a good design to
handle this.

Using an XML file is faster, but it's rather more meaningful to use an XML
file as a readonly template, which defines some settings but not supposed to
be changed through the application. Just think about the design behind the
web.config file and the usage of it.

Hope this gives some ideas,

Ethem Azun

"Nikhil Patel" wrote:
Hi all,
What is the best way to allow the administrator of the application to
select which columns are displayed in a Databound grid in an aspx form. I
was thinking of creating a form and display all possible columns with a
checkbox. The admin would check the checkboxes for each column they want to
display in the grid. My question is where should I save these settings ( in
XML or SQL Server?). Also when these settings are changed, how can I force
the application to use the updated settings if the application is already
running. Where should I write the code to read these settings(I was thinking
to use Application_Start in global.asax and store the settings in
Application object) and to save these settings(I have no idea where should I
write code to save settings). Any code samples would also be appreciated.

Thanks in advance.
Nikhil

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.