Hello,
I have a 2-dimensional array created from the following text file:
[test1]
data1=asdfawe
data2=2
data3=223d
data4=22
[test2]
data1=23fs
data2=234rs
data3=2d@
data4=wef
data5=23f2
[test3]
data1=2ef
data2=weffws
data3=wewfe
data4=dw
What I am currently doing to fill the gridview is this:
[code=C#]
Table table = new Table();
GridViewRow headerRow = new GridViewRow(-1, -1, DataControlRowT ype.Header, DataControlRowS tate.Normal);
TableCell h1cell = new TableCell();
h1cell.Controls .Add(new LiteralControl( "test #"));
headerRow.Cells .Add(h1cell);
for (int n = 0; n < maxElements; n++)
{
TableCell hcell = new TableCell();
hcell.Controls. Add(new LiteralControl( n.ToString()));
headerRow.Cells .Add(hcell);
}
table.Rows.Add( headerRow);
for (int a = 0; a < numSearches; a++)
{
GridViewRow row = new GridViewRow(a, a, DataControlRowT ype.DataRow, DataControlRowS tate.Edit);
for (int b = 0; b < maxElements; b++)
{
TableCell cell = new TableCell();
cell.Controls.A dd(new LiteralControl( array[a, b]));
row.Cells.Add(c ell);
}
table.Rows.Add( row);
}
GridView1.Contr ols.Add(table);
[/code]
This gives me:

If all I wanted to do was show the text file in a grid setting I would be finished, but I cannot figure out how to add a column that allows editing of the rows.
When I manually add a column to the Gridview in the GUI editor, it shows up with edit or delete buttons down the column (depending on what I chose, edit or delete).
But when I run the code it removes the edit/delete column from the gridview.
All I really need to be able to do is edit the contents of the row and then have that change the values inside the table to be later posted to the same or a new text file.
thank you.
I have a 2-dimensional array created from the following text file:
[test1]
data1=asdfawe
data2=2
data3=223d
data4=22
[test2]
data1=23fs
data2=234rs
data3=2d@
data4=wef
data5=23f2
[test3]
data1=2ef
data2=weffws
data3=wewfe
data4=dw
What I am currently doing to fill the gridview is this:
[code=C#]
Table table = new Table();
GridViewRow headerRow = new GridViewRow(-1, -1, DataControlRowT ype.Header, DataControlRowS tate.Normal);
TableCell h1cell = new TableCell();
h1cell.Controls .Add(new LiteralControl( "test #"));
headerRow.Cells .Add(h1cell);
for (int n = 0; n < maxElements; n++)
{
TableCell hcell = new TableCell();
hcell.Controls. Add(new LiteralControl( n.ToString()));
headerRow.Cells .Add(hcell);
}
table.Rows.Add( headerRow);
for (int a = 0; a < numSearches; a++)
{
GridViewRow row = new GridViewRow(a, a, DataControlRowT ype.DataRow, DataControlRowS tate.Edit);
for (int b = 0; b < maxElements; b++)
{
TableCell cell = new TableCell();
cell.Controls.A dd(new LiteralControl( array[a, b]));
row.Cells.Add(c ell);
}
table.Rows.Add( row);
}
GridView1.Contr ols.Add(table);
[/code]
This gives me:

If all I wanted to do was show the text file in a grid setting I would be finished, but I cannot figure out how to add a column that allows editing of the rows.
When I manually add a column to the Gridview in the GUI editor, it shows up with edit or delete buttons down the column (depending on what I chose, edit or delete).
But when I run the code it removes the edit/delete column from the gridview.
All I really need to be able to do is edit the contents of the row and then have that change the values inside the table to be later posted to the same or a new text file.
thank you.

Comment