When setting data validation on a cell, it seems that all boolean in the struct (show_error, dropdown, etc...) are inverted. It must be set to false to be enabled and to true to disable it.
let mut data_validation = DataValidation::new(
DataValidationType::List,
DataValidationCriteria::EqualTo,
DataValidationErrorType::Warning,
);
data_validation.show_error = false; // This displays the error when setting a wrong value
// data_validation.show_error = true; // This does not displays the error when setting a wrong value
data_validation.dropdown = false; // Same here
data_validation.error_title = Some("WRONG VALUE".to_owned());
data_validation.error_message = Some("WRONG VALUE".to_owned());
data_validation.value_list = Some(vec!["1".to_owned(), "2".to_owned(), "3".to_owned()]);
sheet1.data_validation_cell(1, 1, &data_validation)?;
When setting data validation on a cell, it seems that all boolean in the struct (
show_error
,dropdown
, etc...) are inverted. It must be set to false to be enabled and to true to disable it.