can anybody help me
i have a gridview and inside gridview there is a link button in every row
& on linkbutton click a popup has to open and gets populated with the values corresponding to that row "ID"
from DB,
but my problem is when i click the next row it always gets populated with the previous row values,
everything is in update panel??????whyyyyy is it so......
Khargesh RajputPosted Feb 19, 2015, 6:55 AM
PopupDragHandleControlID="PopupHeader" BackgroundCssClass="Background">
and panel for enter data
* Name
inside gridview
item template
in code behind row OnRowCommand
protected void grdSearch_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("Edit1"))
{
Control ctrl = e.CommandSource as Control;
GridViewRow CurrentRow = ctrl.NamingContainer as GridViewRow;
string strID = grdSearch.DataKeys[CurrentRow.RowIndex].Value.ToString();
lblPK.Text = strID;
//query to select from table where id=strID
// fetch data in datareader or dataset
try
{
txtName.Text = dr[0]["class_Name"].ToString();
lblMode.Text = "M";
btnSave.Text = "Update";
}
catch (Exception ex)
{
}
}
}