question about grid columns

  • Thread starter Thread starter Nikhil Patel
  • Start date Start date
N

Nikhil Patel

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
 
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
 
Back
Top