Does this mean, it is not possible to inspect and change values of a
datagrid row
in Item created always ? When the datagrid is re-rendering its content from
viewstate
and firing the Item Created event, shouldn't there be some way to access the
values ?
I've a requirement to remove a button column based on a value in the row.
and replace the cell with text
I do some thing like..
if (e.item.cells[0].text == "Last Level"){
LinkButton lnkBtn = ((LinkButton)e.Item.Cells[2].Controls[0]);
e.Item.Cells[2].Text = lnkBtn.Text;
e.Item.Cells[2].Controls.Remove(lnkBtn);
}
( Disabling the button colum is not option here for me.)
I tried doing this in Item Data Bound, It works but it seems this change
is not saved to view state. Upon post back, I notice that Grid has empty
values
in cell[2].
Any Ideas ?
Thanks,
-Souri
"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:eG*************@TK2MSFTNGP12.phx.gbl...
Souri:
Your datasource isn't stored in the viewstate - which is why
e.Item.DataItem is null. Thankfully the viewstate only stores what it needs to recreate
the control as-is...otherwise it would grow to be too big.
Karl
"Souri Challa" <So*********@discussions.microsoft.com> wrote in message
news:6B**********************************@microsof t.com... Hello All,
When a datagrid in a web form is getting re populated from view state
on post back, it is firing the datagrid Item Created event but the
DataGridItem(e.Item.DataItem is null) in the event arguments has no
values. Is there any way to access and manipulate the row contents in this case
?
Thanks in advance for any insigts in to this.
-Souri