Datakey for Datagrid

K

Kimberly

Hi - Is it impossible to define multiple datakeys for a datagrid? If
so - any ideas on how to update a record selected from a datagrid
using the Edit, Update, Cancel buttons? I can not get past trying to
define my datakeys. I can define one of the keys but what about the
other 2?? Here is my code...

//These fields make up my key

DateTime Event_start =
(DateTime)event_grid.DataKeys[e.Item.ItemIndex];
string plat = (TextBox)e.Item.Cells[1].Controls[0];
string system = (TextBox)e.Item.Cells[3].Controls[0];

//get the new values that were entered

event_text = (TextBox)e.Item.Cells[0].Controls[0];
Event_start_display = (TextBox)e.Item.Cells[2].Controls[0];
Notify_start = (TextBox)e.Item.Cells[4].Controls[0];

string Update_db = "update t_cust_appl_evt set ntfy_strt_dtm
='"+Notify_start.Text.Trim()+"'...

Any help is greatly appreciated.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top