Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changing cell in TableNode not persisting (Read 1963 times)
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Changing cell in TableNode not persisting
Apr 15th, 2008 at 1:35pm
Print Post  
I am indexing into a cell table[1,0], so 2nd column first row. I set the .Text property.

When I step through the debugger I see that the value of Text has changed, but once finished I call diagramView.EndEdit(true); and then the text is empty for the cell.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing cell in TableNode not persisting
Reply #1 - Apr 15th, 2008 at 1:54pm
Print Post  
Calling EndEdit() will raise the LeaveInplaceEdit and DestroyEditControl events. Perhaps you are setting the Text from a handler of these events?
  
Back to top
 
IP Logged
 
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
Re: Changing cell in TableNode not persisting
Reply #2 - Apr 23rd, 2009 at 9:23am
Print Post  
Hi!

I want to use my own EditControl so I handle CreateEditControl event.

I have InplaceEditAcceptOnEnter = True & InplaceEditCancelOnEsc = True but I dont know why ESC & ENTER doesnt work for me. My EditControl is DevExpress.XtraEditors.TextEdit type. What do I need to set? Keypreview property?

So in this situation I handle txtTableCell_KeyPress event:

Code
Select All
Private Sub txtTableCell_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtTableCell.KeyPress
	  Select Case Asc(e.KeyChar)
		Case 27
		    'ESC
		    Me.fcDiagramView.EndEdit(False)
		Case 13
		    'ENTER
		    Me.fcDiagramView.EndEdit(True)
	  End Select
    End Sub
 



But calling Me.fcDiagramView.EndEdit(True) doesnt work for me. How I know in DestroyEditControl event or in LeaveInplaceEditMode event if changes was accepted? Do I need to transfer changes to e.Item manually? Or calling Me.fcDiagramView.EndEdit() is enough?

Thx for your answer.


...MUDO...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Changing cell in TableNode not persisting
Reply #3 - Apr 23rd, 2009 at 12:51pm
Print Post  
Esc & Enter are handled automatically according to these properties only for the standard textbox. This is how DiagramView handles the TextBox.KeyPress event:

Code
Select All
private void OnInplaceTextBoxKeyPress(object o, KeyPressEventArgs args)
{
	if (inplaceAcceptOnEnter && args.KeyChar == (char)13)
	{
		EndEdit(true);
		args.Handled = true;
	}
	if (inplaceCancelOnEsc && args.KeyChar == (char)27)
	{
		EndEdit(false);
		args.Handled = true;
	}
}
 



The boolean argument of EndEdit s not passed to those events, and is used only with the standard textbox. You will have to assign it to some property of the custom edit control and check it when LeaveInplaceEditMode or DestroyEditControl is called.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint