This is a migrated thread and some comments may be shown as answers.

CellClick not firing for custom cell element

1 Answer 194 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 14 Jul 2016, 03:04 PM

I've got a custom cellelement and column that contains a RadWebBrowserElement. Clicking inside the document does not trigger the cellclick(other regular columns work fine). I've tracked down the event I need and added an onclick listener to it with: _webBrowserElement.WebBrowserItem.WebBrowserControl.Document.Click += Document_Click;

Clicking inside the document fires Document_Click but I'm assuming I have to somehow have Document_Click fire the cellclick event but am unclear how to do this.

Any help would be much appreciated,

Thanks

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 15 Jul 2016, 08:43 AM
Hello Brandon,

Thank you for writing.

You can convey the Click event of the Document by using the EventDispatcher class and raise the CellClick event in the grid: 
private void Document_Click(object sender, HtmlElementEventArgs e)
       {
           this.MasterTemplate.EventDispatcher.RaiseEvent<GridViewCellEventArgs>(EventDispatcher.CellClick, this,
                    new GridViewCellEventArgs(this.RowInfo, this.ColumnInfo, this.GridViewElement.ActiveEditor));
       }

I am also sending you attached a sample project demonstrating the suggested approach.

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Tags
GridView
Asked by
Brandon
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or