Help with custom edit feature DataGrid C#

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,819
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top