C
Csharper95
I'm working on a program that will display a modal form containing 2
datagrids (but might as well focus on just one for now). These
datagrids display read-only information that is stored in arrays.
I'm completely new to datagrids, so I don't know what I am doing wrong
as I'm getting runtime errors. Please help
namespace ZZZ
{
............
public struct ProViewStr
{
public string[] LineNameArr;
public int[] LineStatusArr;
..................
}
........
public class ProForm : System.Windows.Forms.Form
{
.......
protected ProViewStr proViewStr;
.......
.......
private void menu_DataInfo_Click(object
sender,System.EventArgs e)
{
DataInfo dataInfo = new DataInfo();
int L = proViewStr.LineStatusArr.Length;
string[] Lname = proViewStr.LineNameArr;
dataInfo.DatSetup(proViewStr);
dataInfo.PopulateSurveyLineGrid();
dataInfo.ShowDialog();
}
} //end of class
}//end of namepace
.......................................................................................
.........................................................................................
namespace ZZZ
{
...........
public class DataInfo : System.Windows.Forms.Form
{
.........
private ProViewStr prov;
private int InfoArrsize;
..........
public void DatSetup(ProViewStr prv)
{
prov.LineNameArr = prv.LineNameArr;
InfoArrsize = prov.LineNameArr.Length;
prov.LineStatusArr = prv.LineStatusArr;
}
..........
public void PopulateSurveyLineGrid()
{
DataTable dt = new
DataTable("SurveyLineGrid");
DataRow myRow;
for(int i=0; i < InfoArrsize; i++)
{
myRow = dt.NewRow();
myRow["Line Name"] =
prov.LineNameArr;
dt.Rows.Add(myRow);
}
}
.........
}//end of class
}// end of namespace
*---------------------------------*
Posted at: http://www.GroupSrv.com
Check: http://wwww.HotCodecs.com
*---------------------------------*
datagrids (but might as well focus on just one for now). These
datagrids display read-only information that is stored in arrays.
I'm completely new to datagrids, so I don't know what I am doing wrong
as I'm getting runtime errors. Please help
namespace ZZZ
{
............
public struct ProViewStr
{
public string[] LineNameArr;
public int[] LineStatusArr;
..................
}
........
public class ProForm : System.Windows.Forms.Form
{
.......
protected ProViewStr proViewStr;
.......
.......
private void menu_DataInfo_Click(object
sender,System.EventArgs e)
{
DataInfo dataInfo = new DataInfo();
int L = proViewStr.LineStatusArr.Length;
string[] Lname = proViewStr.LineNameArr;
dataInfo.DatSetup(proViewStr);
dataInfo.PopulateSurveyLineGrid();
dataInfo.ShowDialog();
}
} //end of class
}//end of namepace
.......................................................................................
.........................................................................................
namespace ZZZ
{
...........
public class DataInfo : System.Windows.Forms.Form
{
.........
private ProViewStr prov;
private int InfoArrsize;
..........
public void DatSetup(ProViewStr prv)
{
prov.LineNameArr = prv.LineNameArr;
InfoArrsize = prov.LineNameArr.Length;
prov.LineStatusArr = prv.LineStatusArr;
}
..........
public void PopulateSurveyLineGrid()
{
DataTable dt = new
DataTable("SurveyLineGrid");
DataRow myRow;
for(int i=0; i < InfoArrsize; i++)
{
myRow = dt.NewRow();
myRow["Line Name"] =
prov.LineNameArr;
dt.Rows.Add(myRow);
}
}
.........
}//end of class
}// end of namespace
*---------------------------------*
Posted at: http://www.GroupSrv.com
Check: http://wwww.HotCodecs.com
*---------------------------------*