Click here to Skip to main content
15,885,141 members
Home / Discussions / C#
   

C#

 
AnswerRe: Delete data from sql server(C#) Pin
Simon_Whale23-Dec-13 22:09
Simon_Whale23-Dec-13 22:09 
AnswerRe: Delete data from sql server(C#) Pin
Rahul Rajat Singh24-Dec-13 0:00
professionalRahul Rajat Singh24-Dec-13 0:00 
QuestionDelete data from sql server Pin
Member 1048484823-Dec-13 20:02
professionalMember 1048484823-Dec-13 20:02 
AnswerRe: Delete data from sql server Pin
Richard MacCutchan23-Dec-13 22:13
mveRichard MacCutchan23-Dec-13 22:13 
QuestionDataGridView Calculated Column update when move to new row C# Pin
ahmed_one23-Dec-13 19:49
ahmed_one23-Dec-13 19:49 
AnswerRe: DataGridView Calculated Column update when move to new row C# Pin
smithjdst23-Dec-13 23:30
smithjdst23-Dec-13 23:30 
GeneralRe: DataGridView Calculated Column update when move to new row C# Pin
ahmed_one24-Dec-13 0:43
ahmed_one24-Dec-13 0:43 
GeneralRe: DataGridView Calculated Column update when move to new row C# Pin
smithjdst24-Dec-13 12:45
smithjdst24-Dec-13 12:45 
after looking a little more, it may be better to use the cellvaluechanged event...

sample
(note this was tested only in C# win32.forms, and the column ValueTypes are strings):
private void dataGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) {
     /*check Changing cell is "not" in the "Total" Column,
      *would keep calling cell changed event, when the "Total" cell value changes*/
     if ((e.RowIndex >= 0) && e.ColumnIndex != DataGrid.Columns["Total"].Index) {
          //r = row of the changed Cell.
          int r = e.RowIndex;

          //get values from cells in the same row
          int Qty = 0;
          int.TryParse((string)DataGrid["Quantity", r].Value, out Qty);

          double Price = 0D;
          double.TryParse((string)DataGrid["UnitPrice", r].Value, out Price);

          //Calculate Total, Change cell value in "Total"
          DataGrid["Total", r].Value = Price * Qty;
     }
}


modified 24-Dec-13 19:07pm.

GeneralRe: DataGridView Calculated Column update when move to new row C# Pin
ahmed_one24-Dec-13 21:27
ahmed_one24-Dec-13 21:27 
QuestionMaintainScrollPositionOnPostback on UpdatePanel Pin
vkEE23-Dec-13 9:28
vkEE23-Dec-13 9:28 
Questionthe name does not exist in the current context Pin
Member 996531123-Dec-13 9:03
Member 996531123-Dec-13 9:03 
QuestionRe: the name does not exist in the current context Pin
Brisingr Aerowing23-Dec-13 10:02
professionalBrisingr Aerowing23-Dec-13 10:02 
AnswerRe: the name does not exist in the current context Pin
Member 996531123-Dec-13 10:36
Member 996531123-Dec-13 10:36 
GeneralRe: the name does not exist in the current context Pin
Brisingr Aerowing24-Dec-13 12:27
professionalBrisingr Aerowing24-Dec-13 12:27 
QuestionHow to use Oracle SQLLDR to upload Text file data through C# Pin
Daljit S. Gill22-Dec-13 23:12
Daljit S. Gill22-Dec-13 23:12 
QuestionLarge text file(1.5 gb) reading using Background worker Pin
Arjun Mourya22-Dec-13 22:56
Arjun Mourya22-Dec-13 22:56 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
BillWoodruff23-Dec-13 0:08
professionalBillWoodruff23-Dec-13 0:08 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 3:05
Arjun Mourya23-Dec-13 3:05 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Member 996531123-Dec-13 10:41
Member 996531123-Dec-13 10:41 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
Manfred Rudolf Bihy23-Dec-13 0:49
professionalManfred Rudolf Bihy23-Dec-13 0:49 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 2:57
Arjun Mourya23-Dec-13 2:57 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Eddy Vluggen23-Dec-13 7:25
professionalEddy Vluggen23-Dec-13 7:25 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya24-Dec-13 0:10
Arjun Mourya24-Dec-13 0:10 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff23-Dec-13 1:06
mveOriginalGriff23-Dec-13 1:06 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 2:50
Arjun Mourya23-Dec-13 2:50 

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.