Bonjour � tous !

Je r�alise un petit programme dans lequel j'ai un tabControl avec plusieurs Tabs dont chacun contient un dataGridView.

D�clar�s comme suit :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
 
public:
 
		array<System::Windows::Forms::TabPage ^> ^ MyTab;
		array<System::Windows::Forms::DataGridView^> ^ MyDataG;
 
private: System::Windows::Forms::DataGridView^  dataGridView1;
...
private: System::Windows::Forms::DataGridView^  dataGridView30;
 
private: System::Windows::Forms::TabControl^  tabControl1;
 
private: System::Windows::Forms::TabPage^  tabPage1;
...
private: System::Windows::Forms::TabPage^  tabPage30;
initialis� comme suit :

Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
DataProc(void)
		{
			InitializeComponent();
			//
			//TODO*: ajoutez ici le code du constructeur
			//
			MyDepotProc = gcnew array<DepotProc ^>(256);
			DepotProc^ T = gcnew DepotProc();
			for(int p = 0; p<=255; p++){MyDepotProc[p] = T;};
 
 
	  MyTab = gcnew array<System::Windows::Forms::TabPage ^>(30);
	  MyDataG = gcnew array<System::Windows::Forms::DataGridView ^>(30);
 
MyTab[0] = tabPage1;
...
MyTab[29] = tabPage30;
 
MyDataG[0] = dataGridView1;
...
MyDataG[29] = dataGridView30;
Dans une de mes fonctions j'it�re sur mes Tab (et DatagridView) :

Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
if(this->MyDataG[k]->RowCount != 0)
	{
		for(int y = 0; y<= this->MyDataG[k]->RowCount-1 ; y++)
		{
			String^ DATE1 = this->MyDataG[k]->Rows[y]->Cells[2]->Value->ToString();
 
	...
 
			String^ DATE2;
 
			if( !String::IsNullOrEmpty( (this->MyDataG[k])->Rows[y]->Cells[3]->Value->ToString()))
			{ 
				DATE2 = (this->MyDataG[k])->Rows[y]->Cells[3]->Value->ToString();
			}
			else
			{
				DATE2 = "01/01/1980";
			}
 
			...
Et l� j'ai le message d'erreur (la r�f�rence d'objet n'est pas d�finie � une instance d'un objet) pour la ligne avec le IsNullOrEmpty !!!?!

Je ne comprend pas pourquoi d'autant plus qu'en debug si l'�tape est "ignor�e" les donn�es sont correctement utilis�es .

Un petit id�e ? une remarque ??

MERCI !