Skip to content

DevExpress-Examples/asp-net-web-forms-richedit-custom-save-button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rich Text Editor for ASP.NET Web Forms - How to automatically change the availability of a custom Save button

This example demonstrates how to create a custom Save button that is disabled when the document has no changes and is enabled when the document is changed.

Implementation Details

  1. Create a function where you call the FileSaveCommand.getState method to get the state of the default Save button.
  2. Apply the availability state of the default button to your custom Save button.
function checkOnChanges() {
    var currectState = richEdit.commands.fileSave.getState();
    var saveButton = richEdit.GetRibbon().GetItemByName("Save");
    saveButton.SetEnabled(currectState.enabled);
}
  1. Call this function in DocumentChanged and EndCallback event handlers.
function onDocumentChanged(s, e) {
    checkOnChanges();
}

function onEndCallback(s, e){
    checkOnChanges();
}

Files to Review

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Create a custom Save button that changes its availability automatically.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •