i am not able bind data from edit item template to item template in datalist control on click of update command.I given my code below
oneditcommand="DataList1_EditCommand" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" ForeColor="Purple" GridLines="Vertical" oncancelcommand="DataList1_CancelCommand" onitemdatabound="DataList1_ItemDataBound" onselectedindexchanged="DataList1_SelectedIndexChanged" onupdatecommand="DataList1_UpdateCommand"> Reg No Patient Compliats Mob.No onclick="button2_Click" Text="Update" /> Text="Cancel" />
Text='<%# DataBinder.Eval(Container.DataItem,"time") %>'>
| ||
| ||
|
|
|
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
{
DataTable dt = (DataTable)Session["time"];
string patient = ((TextBox)e.Item.FindControl("TbxPatient")).Text;
((Label)e.Item.FindControl("LblPatient")).Text = patient;
DataList1.EditItemIndex = -1;
DataList1.DataSource = dt;
DataList1.DataBind();
}
I can't get value of patient to item template.above code is not working.Please help me.can I do this?
Madhu KPosted Jan 8, 2011, 1:12 PM