C#:
static public System.Web.UI.WebControls.TableCell CellByName
(System.Web.UI.WebControls.DataGridItem item, string name)
{
System.Web.UI.WebControls.DataGrid grid = item.Parent.Parent as
System.Web.UI.WebControls.DataGrid;
for (int col = 0; col < item.Cells.Count; col++)
if (grid.Columns[col].HeaderText == name)
return item.Cells[col];
// not found
return null;
}
--
Eliyahu
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
can you give me example?
"Eliyahu Goldin" wrote:
Make a simple utility function that will take a column name as a
parameter, loop through the Columns collection and return the index of the column
with matching name.
Eliyahu
"JIM.H." <JI**@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com... Hello,
string colVal =((TextBox)e.Item.Cells[i].Controls[0]).Text;
this is how I reach column value in a grid:
how can I reach with the column name?
some value should be int, some date, how should I read them?
Thanks,
Jim.