Subclassing DataGrid

Discussion in 'ASP .Net Datagrid Control' started by David Rainsford, Apr 1, 2004.

  1. 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
     
    David Rainsford, Apr 1, 2004
    #1
    1. Advertising

  2. 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.

    --
    Regards,
    Alvin Bruney [ASP.NET MVP]
    Got tidbits? Get it here...
    http://tinyurl.com/3he3b
    "David Rainsford" <> wrote in message
    news:...
    > 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
    >
    >
     
    Alvin Bruney [MVP], Apr 1, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S Guiboud
    Replies:
    1
    Views:
    423
    Ross Dempster
    Jul 18, 2003
  2. =?Utf-8?B?Q2h1Y2sgSGFlYmVybGU=?=

    Subclassing from System.Web.UI.Page - Designer Error

    =?Utf-8?B?Q2h1Y2sgSGFlYmVybGU=?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    482
    Mike Bridge
    Feb 20, 2004
  3. Felbrigg

    SubClassing a TextBox

    Felbrigg, Apr 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    365
    Felbrigg
    Apr 27, 2004
  4. Jeronimo Bertran

    Subclassing a DataGrid control

    Jeronimo Bertran, May 3, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    120
    Steven Cheng[MSFT]
    May 10, 2005
  5. Dan

    Subclassing DataGrid

    Dan, Feb 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    114
Loading...

Share This Page