Hello,
I have a template column with Text and buton in the CellControl Template. When cell is in edit mode, the text is displayed in TextBox, otherwise in TextBlock
Currently when i click the button the entire cell enters into edit mode, so TextBox is displayed.
what do i need to do in order the cell will enter edit mode only on clicking the TextBlock ?
I tried setting e.handle=true on button click event. but it doesn't help.
I have been looking into your question and I have managed to achieve the functionality that you are looking for by handling the ‘CellEnteingEditMode’ event of the XamGrid like e.g. :
private void MyGrid_CellEnteringEditMode(object sender, Infragistics.Controls.Grids.BeginEditingCellEventArgs e)
{
if (e.Cell.Column is TemplateColumn && !(Mouse.DirectlyOver is TextBlock))
e.Cancel = true;
}
If you need any further assistance on this matter, feel free to ask.
OK thanks. it helped. I had also to check if the Row is not AddNewRow .
Another question-
it enters the button event click only on double click on the button. What do i need to do in order to entrer the click event on single click?
It seems the first click is "going" to the CellEditing Events.
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.
Hi Michel,
Thank you for your feedback. I have been looking into your last question and I have modified my code in order to meet your scenario :
else if (e.Cell.Column is TemplateColumn && Mouse.DirectlyOver is Button)
Button btn = Mouse.DirectlyOver as Button;
btn.ClickMode = ClickMode.Press;
This way if the button is pressed, the click event will be activated.