D
Derek
I'm having some difficultly with the following problem.
I'm using the datagrid, with a "custom rich editor". I'm trying to fire an
event on the cell of the datagrid when the user clicks or double clicks the
cell. I must avoid javascript at all costs.
In my DataGrid_ItemDataBound event, I have the following:
private void DataGrid_ItemDataBound(object sender,
System.Web.DataGrid.ItemEventsArgs e)
{
// App feedback highlight & hand cursor for end user
e.Item.Cell[2].Attributes.Add("onmouseover",
"this.style.bgcolor='white'");
e.Item.Cell[2].Attributes.Add("onmouseover",
"this.style.bgcolor='pok-a-dots'");
e.Item.Cell[2].Style.Add("cursor", "hand");
// Get the BtnEdit button which resides in cell[2]
richEditor.Text = lblEdit.Text
Button btnEdit = (Button)e.Item.Cells[2].Controls[3];
//Set an onClick event to fire a showRichEditor()
e.Item.Cells[2].Attributes["ondblclick"]
Page.GetPostBackClientEvent(btnEdit,"showRichEditor()");
}
private void showRichEditor()
{
richEditor.Visable = true;
}
Any help would be appreciated.
Regards,
Derek
I'm using the datagrid, with a "custom rich editor". I'm trying to fire an
event on the cell of the datagrid when the user clicks or double clicks the
cell. I must avoid javascript at all costs.
In my DataGrid_ItemDataBound event, I have the following:
private void DataGrid_ItemDataBound(object sender,
System.Web.DataGrid.ItemEventsArgs e)
{
// App feedback highlight & hand cursor for end user
e.Item.Cell[2].Attributes.Add("onmouseover",
"this.style.bgcolor='white'");
e.Item.Cell[2].Attributes.Add("onmouseover",
"this.style.bgcolor='pok-a-dots'");
e.Item.Cell[2].Style.Add("cursor", "hand");
// Get the BtnEdit button which resides in cell[2]
richEditor.Text = lblEdit.Text
Button btnEdit = (Button)e.Item.Cells[2].Controls[3];
//Set an onClick event to fire a showRichEditor()
e.Item.Cells[2].Attributes["ondblclick"]
Page.GetPostBackClientEvent(btnEdit,"showRichEditor()");
}
private void showRichEditor()
{
richEditor.Visable = true;
}
Any help would be appreciated.
Regards,
Derek