M
Matt M
I'm learning today.
So I have a bound datagrid with edit items in it. I've read that in order
to retrieve the values for those edit items (textboxes etc) I can only bind
the grid when NOT postBack.
i.e.
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
So my grid initially appears when I go to the page. If I hit the "edit"
link on the grid, the page reloads and the grid doesn't show up. Now, this
makes sense to me, but then how can I get the textbox values on the grid
before the grid binds again.
I'm sure this has been posted before, but I can't seem to find a relevant
answer. Any ideas?
(my code to get the text box values):
dgServices.EditItemIndex = E.Item.ItemIndex;
TextBox editService = (TextBox)
dgServices.Items[dgServices.EditItemIndex].Cells[1].FindControl("edit_Servic
e");
Response.Write(editService .Text);
Any help would be greatly appreciated.
- matt -
So I have a bound datagrid with edit items in it. I've read that in order
to retrieve the values for those edit items (textboxes etc) I can only bind
the grid when NOT postBack.
i.e.
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
So my grid initially appears when I go to the page. If I hit the "edit"
link on the grid, the page reloads and the grid doesn't show up. Now, this
makes sense to me, but then how can I get the textbox values on the grid
before the grid binds again.
I'm sure this has been posted before, but I can't seem to find a relevant
answer. Any ideas?
(my code to get the text box values):
dgServices.EditItemIndex = E.Item.ItemIndex;
TextBox editService = (TextBox)
dgServices.Items[dgServices.EditItemIndex].Cells[1].FindControl("edit_Servic
e");
Response.Write(editService .Text);
Any help would be greatly appreciated.
- matt -