Newbie problem - Changing Gridview field value (i.e. calculate a value) before clicking update VS2

Discussion in 'ASP .Net' started by AAJ, Sep 6, 2006.

  1. AAJ

    AAJ Guest

    Hi All

    I have a problem and wonder if any one can help

    I have a strongly typed dataset looking at a sqlServer

    I have a class that forms my BLL that manages this dataset

    I have a datagrid on the UI

    I can edit a record. Within the edit template of the record I have a
    dropdown that is bound to the main dataset. When I click update, the
    datasource/database/UI are updated correctly via my BLL.

    This is where my problem is.

    The drop down holds data about work cost i.e.
    1 = Workcost 1
    2 = Workcost 2
    3 = Workcost 3 etc...

    There are other fields in the Gridview, in particular one called Quantity
    and one called Total.

    In windows forms, it is easy for me to catch an event on the combo box, and
    calculate the total depending on what is selected i.e. Total = QTY *
    Workcost, but not write to the database

    What I can't figure out how to do is do this on a web page, within the
    'editing' of the Gridview. The calculated value just needs to be fleeting,
    as the drop down or Quantity changes, the screen recalculates (nothing
    wiriiten) as soon as update is clicked, no problem, my business logic can
    deal with the calculations and update the source as required

    So in summary, In edit mode on the gridview, on change of workrate or
    quantity, update the gridview to show the temp calculated values (but not
    update the database), and when update is pressed, The business logic will re
    calculate and update the database.

    If anyone knows how to do this it would be really usefull.

    TIA and best regards

    AAJ, Sep 6, 2006
    1. Advertisements

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. Mr. x
    Mr. x
    Nov 30, 2003
  2. Replies:
  3. Rickey Whitworth

    Gridview Updates not writing to database after clicking update

    Rickey Whitworth, Nov 7, 2005, in forum: ASP .Net Web Controls
    Steven Cheng[MSFT]
    Nov 11, 2005
  4. jochen scheire

    Calculate field based on another field in form

    jochen scheire, Apr 21, 2004, in forum: Javascript
    Mick White
    Apr 22, 2004
  5. jr

Share This Page