Click here to Skip to main content
15,896,304 members
Home / Discussions / C#
   

C#

 
QuestionHow to add images to toolstrip menu? Pin
Aravinthan13-Mar-08 19:35
Aravinthan13-Mar-08 19:35 
Generalinsert the records from dataset into database Pin
Miss Maheshwari13-Mar-08 18:47
Miss Maheshwari13-Mar-08 18:47 
AnswerRe: insert the records from dataset into database Pin
Pankaj Garg13-Mar-08 19:57
Pankaj Garg13-Mar-08 19:57 
GeneralFinding Memory Leaks Pin
MAW3013-Mar-08 15:42
MAW3013-Mar-08 15:42 
GeneralRe: Finding Memory Leaks Pin
OR0N13-Mar-08 15:44
OR0N13-Mar-08 15:44 
GeneralConditionally loading global variables Pin
Glen Harvy13-Mar-08 15:25
Glen Harvy13-Mar-08 15:25 
GeneralRe: Conditionally loading global variables Pin
Christian Graus13-Mar-08 16:12
protectorChristian Graus13-Mar-08 16:12 
GeneralImpossible to programaticaly assign values to a binded datagridview Pin
baranils13-Mar-08 11:55
baranils13-Mar-08 11:55 
Hello

It seems really impossible to programaticaly assign values to a binded datagridview. In the following example I'm trying to renum a column value
The result is unpredictible : some values are assigned, some not ?
Some are reflected to the binded dataset but not all ?

private void Rit_Renum()
{
  int Step;
  int Order = 1;
  int.TryParse(txb_renum.Text, out Step);
  if (Step < 0) Step = 1;
  dgv_rit.Columns["order1"].SortMode = DataGridViewColumnSortMode.NotSortable;
  Order = 1;
  for (int i = 0; i < dgv_rit.Rows.Count; i++)
  {
    if (dgv_rit.Rows[i].Cells["order"].Value == null) break;
    dgv_rit.Rows[i].Cells["order1"].Value = Order;
    Order += Step;
  }
  dgv_rit.Refresh();
}


I start with a sorted list 1 to 12
I swap a few contiguous rows values
(11 = 12, 12=11) then sort
(10=11, 11=10) then sort
(9=10, 10=9) then sort
So now the original row 12 have the value 9 and the position of 9
Then I renum with a step of 3

The result is this ??

1
3
4
6
7
9
10
12
16
22
28
34

Does anyone undersdand what happen !
GeneralRe: Impossible to programaticaly assign values to a binded datagridview Pin
Christian Graus13-Mar-08 12:14
protectorChristian Graus13-Mar-08 12:14 
GeneralRe: Impossible to programaticaly assign values to a binded datagridview Pin
baranils13-Mar-08 12:22
baranils13-Mar-08 12:22 
GeneralRe: Impossible to programaticaly assign values to a binded datagridview Pin
Christian Graus13-Mar-08 12:39
protectorChristian Graus13-Mar-08 12:39 
GeneralRe: Impossible to programaticaly assign values to a binded datagridview Pin
baranils13-Mar-08 20:38
baranils13-Mar-08 20:38 
GeneralSerialPort Closes for no Reason Pin
jdajos13-Mar-08 11:18
jdajos13-Mar-08 11:18 
QuestionRe: SerialPort Closes for no Reason Pin
Paw Jershauge13-Mar-08 12:47
Paw Jershauge13-Mar-08 12:47 
GeneralRe: SerialPort Closes for no Reason Pin
jdajos17-Mar-08 2:55
jdajos17-Mar-08 2:55 
GeneralRe: SerialPort Closes for no Reason Pin
Paw Jershauge18-Mar-08 11:50
Paw Jershauge18-Mar-08 11:50 
GeneralFile.GetCreationTime Pin
Christian Graus13-Mar-08 10:57
protectorChristian Graus13-Mar-08 10:57 
GeneralRe: File.GetCreationTime Pin
snorkie13-Mar-08 11:05
professionalsnorkie13-Mar-08 11:05 
GeneralRe: File.GetCreationTime Pin
Christian Graus13-Mar-08 11:09
protectorChristian Graus13-Mar-08 11:09 
GeneralRe: File.GetCreationTime Pin
snorkie13-Mar-08 11:17
professionalsnorkie13-Mar-08 11:17 
GeneralRe: File.GetCreationTime Pin
OR0N13-Mar-08 15:42
OR0N13-Mar-08 15:42 
GeneralRe: File.GetCreationTime Pin
N a v a n e e t h13-Mar-08 20:57
N a v a n e e t h13-Mar-08 20:57 
GeneralRe: File.GetCreationTime Pin
OR0N14-Mar-08 7:50
OR0N14-Mar-08 7:50 
Generalmultiple regression for crime forecasting Pin
hiraa13-Mar-08 10:41
hiraa13-Mar-08 10:41 
GeneralRe: multiple regression for crime forecasting Pin
Christian Graus13-Mar-08 10:50
protectorChristian Graus13-Mar-08 10: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.