DataGrid with values not saved to the database but want to sort it.

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default DataGrid with values not saved to the database but want to sort it.

    I have a datagrid where I load the values initially and then the user can
    make changes to the data. That all works fine. But I want to add column
    sorting which I've done before. That works fine. Problem is putting the two
    together because every example of sorting I have seen shows going back to
    the database. But I haven't saved my changes yet so I can't go back to the
    database.

    Here's an example:
    Load page - read from the database.
    Person changes a value on record 1
    Person changes a value on record 3
    They then actually save the values to the database.

    But if sorting goes back to the database, then is they sort after record 1
    changes, they will lose those changes.

    I don't want to write out the changes until they decide they want to save
    everything.

    Any ideas?

    TIA.

    Jeff.


    UJ Guest

  2. Similar Questions and Discussions

    1. read row values from datagrid and populate in new datagrid values from connected
      Hello, i am new in asp.net and i am having a question: I am having a datagrid_1 in which i am showing the context of PatientDetails table....
    2. Datagrid printing calculatet values from a database.
      Hi there ! I have a birthday-date colum in my database and want to precent the calculatet ages in a Datagrid. Is that possible ? ...
    3. PSD File Saved As EPS: White becomes 1% values in CMYK
      I am working in Photoshop 6. When I am working in my PSD layer file I have white as 0% CMYK values. When I save an EPS to place in my Quark layout,...
    4. Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB.
      Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. hi, guys i have asp...
    5. Adding custom values and database values to DropDwonList
      The other way is to create a DataTable, put the --None-- as the first Row, then read the datareader into the DataTable, and append the --other-- at...
  3. #2

    Default Re: DataGrid with values not saved to the database but want to sort it.

    > I don't want to write out the changes until they decide they want to
    > save everything.
    So you will need to store these changes somewhere. How are you rebuilding
    the grid when the users sorts? Are you going back to the database? If so,
    then you'd need to DataBind from your database, and then for any data the
    user has changed you'd need to overwrite the data loaded from data binding.
    So I'd look into the DataGrid's ItemDataBound event to get the row that was
    just data bound and manually overwrite the data as necessary. How do you
    store the data? That's up to you. Perhaps a DataSet stored in Session? Just
    an idea.

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]



    Brock Allen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139