5 Answers, 1 is accepted
0
Hi Andre,
Thank you for writing.
You can use the following approach for this:
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Thank you for writing.
You can use the following approach for this:
private
void
RadGridView1_CellClick(
object
sender, GridViewCellEventArgs e)
{
if
(e.Row.ViewTemplate == radGridView1.MasterTemplate)
{
Console.WriteLine(
"Master"
);
}
else
{
Console.WriteLine(
"Child"
);
}
}
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Andre
Top achievements
Rank 1
answered on 20 Mar 2018, 02:32 PM
thanks for the solution.
i said something wrong. i want to call a contextMenu only from a templategrid. i couldn't find a cellclick event for a templategrid.
so far I have done the following without success.
private void dgvOrder_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
if (e.ContextMenuProvider is GridCellElement cellElement) {
if (cellElement is GridDetailViewCellElement detailCell) {
e.ContextMenu = _contextMenuOperation;
}
Console.WriteLine(cellElement.ViewTemplate.Caption);
}
}
Translated with www.DeepL.com/Translator
i said something wrong. i want to call a contextMenu only from a templategrid. i couldn't find a cellclick event for a templategrid.
so far I have done the following without success.
private void dgvOrder_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
if (e.ContextMenuProvider is GridCellElement cellElement) {
if (cellElement is GridDetailViewCellElement detailCell) {
e.ContextMenu = _contextMenuOperation;
}
Console.WriteLine(cellElement.ViewTemplate.Caption);
}
}
Translated with www.DeepL.com/Translator
0
Accepted
Hi Andre,
Here is how you can check if the event is fired for a child cell:
Let me know if I can assist you further.
Regards,
Dimitar
Progress Telerik
Here is how you can check if the event is fired for a child cell:
private
void
RadGridView1_ContextMenuOpening(
object
sender, ContextMenuOpeningEventArgs e)
{
if
(e.ContextMenuProvider
is
GridDataCellElement cellElement)
{
var cell = e.ContextMenuProvider
as
GridDataCellElement;
if
(cell.ViewTemplate == radGridView1.Templates[0])
{
Console.WriteLine(
"Child Cell"
);
}
}
}
Let me know if I can assist you further.
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Andre
Top achievements
Rank 1
answered on 21 Mar 2018, 06:01 PM
hi dimitar
genau das habe ich gesucht !
besten dank !
genau das habe ich gesucht !
besten dank !
0
Andre
Top achievements
Rank 1
answered on 21 Mar 2018, 06:02 PM
hi dimitar
that's exactly what I was looking for!
best thanks !
that's exactly what I was looking for!
best thanks !