hi
I have a datagrid and in it i have put a textbox using the template items and i assign the value of the item ID to the textbox and its working fine, but i want to do a double click on a row and would like to return the value in the text box. I have added an attribute in the itemdatabound event as shown below. My problem is, if i double click my javascript alert function keeps returning the same value.
Does anyone know what im doing wrong.
protected void rdgAccounts_ItemDataBound1(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item)
{
string text = ((System.Web.UI.WebControls.TextBox)e.Item.FindControl("txt")).Text;
rdgAccounts.Attributes.Add("ondblclick", "return OpenGrid('" + text + "');");
}
}
function OpenGrid(txt2)
{
alert(txt2);
}
I have a datagrid and in it i have put a textbox using the template items and i assign the value of the item ID to the textbox and its working fine, but i want to do a double click on a row and would like to return the value in the text box. I have added an attribute in the itemdatabound event as shown below. My problem is, if i double click my javascript alert function keeps returning the same value.
Does anyone know what im doing wrong.
protected void rdgAccounts_ItemDataBound1(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item)
{
string text = ((System.Web.UI.WebControls.TextBox)e.Item.FindControl("txt")).Text;
rdgAccounts.Attributes.Add("ondblclick", "return OpenGrid('" + text + "');");
}
}
function OpenGrid(txt2)
{
alert(txt2);
}