Welcome Guest Search | Active Topics | Sign In | Register

Keep old values for grid items update Options
nomo
Posted: Friday, June 19, 2009 7:24:40 PM
Rank: Member
Groups: Member

Joined: 4/6/2008
Posts: 11
Hi!

I have a grid inside a CallBackPanel displaying 4 punches per date on a Time and Attendance application. Each punch is a diferent record from the database table. In order to update each record I need two reference values: Punch date, which I already have as the Grid Key value, and the old punch time which is going to be replaced.

How can I recall the old punch time for each modified item in the grid and include it in the update query?

I want to be able to edit various punches from various dates in the grid before saving them to the database. The reason is that after all the changes are made I call a function to make some calculations from different tables and I don't want to do that after each punch modification.

Thanks.
eo_support
Posted: Friday, June 19, 2009 7:45:23 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I am not exactly sure about what a punch really is in your case, but there are two ways for you to store additional data with the Grid:

1. Store multiple values in the Grid's DataKey field. For example, you can do "SELECT field_A + '|' + field_B as field_C" with your SQL and then store field_C in the Grid. Whenver you use the key data, you would split it to get the two individual values;

2. Store additional values into a hidden column. You can add an additional column but set the column's Visible to false. That way the data will be carried along with the Grid, but the column won't be visible to the user;

Hope this helps.

Thanks!
nomo
Posted: Tuesday, June 23, 2009 8:35:34 AM
Rank: Member
Groups: Member

Joined: 4/6/2008
Posts: 11
Thanks for your help, I solved it!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.