Click here to Skip to main content
15,908,901 members
Home / Discussions / C#
   

C#

 
Generalhi,need your help about win api in c# Pin
18-Sep-01 18:09
suss18-Sep-01 18:09 
GeneralStream piping Pin
Ray Hayes17-Sep-01 10:02
Ray Hayes17-Sep-01 10:02 
QuestionEvent Log from a remote computer? Pin
14-Sep-01 8:56
suss14-Sep-01 8:56 
AnswerRe: Event Log from a remote computer? Pin
another17-Sep-01 11:18
another17-Sep-01 11:18 
GeneralRe: Event Log from a remote computer? Pin
Chintan.Desai27-Nov-08 20:21
Chintan.Desai27-Nov-08 20:21 
QuestionHOW TO CANCEL A PRESSED KEY ?? Pin
Carlos Lopes11-Sep-01 4:48
Carlos Lopes11-Sep-01 4:48 
GeneralC# object instantiation Pin
SAWilde6-Sep-01 23:27
SAWilde6-Sep-01 23:27 
GeneralDebug my code Pin
Chaim Nussbaum5-Sep-01 6:52
Chaim Nussbaum5-Sep-01 6:52 
Hi CodeProject,

I have created a form with a datagrid, my requirement is that when
the user clicks "F5" I want to update a certain column with the current
time.

I defined a DataGridTableStyle and a DataGridTextBoxColumn object. I
attached an event handler to the DataGridTextBoxColumn.TextBox.KeyUp
property.

So now when I hit "F5" the column is updated, but alas, as soon as I
navigate to a different line, the row disappears! Am I doing something
wrong, or is this a bug? Maybe someone has an different way of doing this?

Anyways, this is my code for the KeyUp event:

private void dataGridColumn1_TextBox_KeyUp(object sender, KeyEventArgs kea)
{
if (kea.KeyCode == Keys.F5)
{
DataRowView drv = (DataRowView)dataGrid1.BindingContext
[dataGrid1.DataSource].Current;
drv["Col1"] = DateTime.Now.ToLongTimeString();
}
}

Thanks


GeneralProxy server for Windows Pin
Dmitry M. Belikov5-Sep-01 2:23
Dmitry M. Belikov5-Sep-01 2:23 
QuestionWhere are my winforms? Pin
mstechy2-Sep-01 4:40
mstechy2-Sep-01 4:40 
AnswerRe: Where are my winforms? Pin
Eric Gunnerson (msft)4-Sep-01 8:55
Eric Gunnerson (msft)4-Sep-01 8:55 
GeneralRe: Where are my winforms? Pin
4-Sep-01 15:44
suss4-Sep-01 15:44 
GeneralDataColumn Caption property doesn't works. Pin
Carlos Lopes30-Aug-01 0:40
Carlos Lopes30-Aug-01 0:40 
Generalfsream Pin
25-Aug-01 5:42
suss25-Aug-01 5:42 
GeneralI want to read an ASP recordset in C# component Pin
Csmart24-Aug-01 2:49
Csmart24-Aug-01 2:49 
GeneralRe: I found it myself Pin
14-Sep-01 3:20
suss14-Sep-01 3:20 
GeneralDataRow Caption property doesn't works. Pin
Carlos Lopes23-Aug-01 0:13
Carlos Lopes23-Aug-01 0:13 
QuestionSelecting a branch in a TreeView? Pin
Andreas Philipson21-Aug-01 12:46
Andreas Philipson21-Aug-01 12:46 
General"RETURN" key as "TAB" key Pin
Carlos Lopes19-Aug-01 21:55
Carlos Lopes19-Aug-01 21:55 
GeneralRe: "RETURN" key as "TAB" key Pin
Richard Dean14-Apr-09 0:11
Richard Dean14-Apr-09 0:11 
GeneralC Pin
doso18-Aug-01 1:44
doso18-Aug-01 1:44 
GeneralRe: C Pin
Christian Graus18-Aug-01 2:06
protectorChristian Graus18-Aug-01 2:06 
GeneralRe: C Pin
doso18-Aug-01 2:32
doso18-Aug-01 2:32 
GeneralRe: C Pin
Christian Graus18-Aug-01 2:41
protectorChristian Graus18-Aug-01 2:41 
GeneralRe: C Pin
doso18-Aug-01 3:03
doso18-Aug-01 3:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.