Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Keypress events (Read 1469 times)
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Keypress events
Jul 14th, 2007 at 2:31pm
Print Post  
I notice that when the user clicks inside a Calendar item then clicks outside the item, the ItemInplaceEdited event is fired, even if the user does not change the item text. So I would like to implement logic for raising a flag whenever the user types something in a calendar item. However, none of the Key-related events (KeyPress or KeyUp/Down) fire when typing in an item. Is there some way to flag this?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Keypress events
Reply #1 - Jul 16th, 2007 at 5:02am
Print Post  
Try to handle the ItemInplaceEditEnding event and check the NewText property of the event argument. If you compare the value of this property with the current value of the HeaderText property of the in-place edited item (you can obtain a reference to the in-place edited item from the event arguments as well), you can determine whether the item text has changed during the in-place editing. The following code shows a sample handler of the ItemInplaceEditEnding event:

Code
Select All
private void calendar_ItemInplaceEditEnding(
    object sender, ItemEditConfirmEventArgs e)
{
    if (e.Item.HeaderText != e.NewText)
    {
	  // The item text has been changed during in-place editing
    }
} 


Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint