Subclassing DataGrid

  • Thread starter David Rainsford
  • Start date
D

David Rainsford

I would like to make a DataGrid control but with some modifications.

Firstly, I would like all fields that come out of the database to be
editable at all times.
I would also like another row (this one non-editable) on the Datagrid which
shows the average or total values (and I want to be able to specify which
columns this will work for)
I would also like another column (again non-editable) which will also show
average or total values from specified columns

For example (damn this newsreader won't use a monospaced font - if you have
the same problem, copy and paste into notepad to see my example more
clearly)

Project Jan Feb Avg
foo {0.1} {0.3} 0.4
bar {0.5} {0.25} 0.75
TOTAL 0.6 0.55 1.15



The values in {} are editable and stored in the database. The other
numerical values are dynamically calculated and recalculated every time a
field is edited.

Is this realistic? Is subclassing the DataGrid web control the way to go
with this, or is there an easier way to achieve what I want to do?

Thanks in advance for your advice,


David
 
A

Alvin Bruney [MVP]

It's one approach. I'd only use it if I intended to release the control to
other folk. If it is for one project, you can just customize the itemcreated
and itemdatabound event handlers to give you what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top