pub struct DataValidationConfig {Show 13 fields
pub sqref: String,
pub validation_type: ValidationType,
pub operator: Option<ValidationOperator>,
pub formula1: Option<String>,
pub formula2: Option<String>,
pub allow_blank: bool,
pub error_style: Option<ErrorStyle>,
pub error_title: Option<String>,
pub error_message: Option<String>,
pub prompt_title: Option<String>,
pub prompt_message: Option<String>,
pub show_input_message: bool,
pub show_error_message: bool,
}Expand description
Configuration for a data validation rule.
Fields§
§sqref: StringThe cell range to apply validation to (e.g. “A1:A100”).
validation_type: ValidationTypeThe type of validation.
operator: Option<ValidationOperator>The comparison operator (not used for list validations).
formula1: Option<String>The first formula/value for the validation constraint.
formula2: Option<String>The second formula/value (used with Between/NotBetween operators).
allow_blank: boolWhether blank cells are allowed.
error_style: Option<ErrorStyle>The error display style.
error_title: Option<String>The title for the error dialog.
error_message: Option<String>The message for the error dialog.
prompt_title: Option<String>The title for the input prompt.
prompt_message: Option<String>The message for the input prompt.
show_input_message: boolWhether to show the input message when the cell is selected.
show_error_message: boolWhether to show the error message on invalid input.
Implementations§
Source§impl DataValidationConfig
impl DataValidationConfig
Sourcepub fn dropdown(sqref: &str, items: &[&str]) -> Self
pub fn dropdown(sqref: &str, items: &[&str]) -> Self
Create a dropdown list validation.
The items are joined with commas and quoted for the formula.
Sourcepub fn whole_number(sqref: &str, min: i64, max: i64) -> Self
pub fn whole_number(sqref: &str, min: i64, max: i64) -> Self
Create a whole number range validation (between min and max).
Sourcepub fn decimal(sqref: &str, min: f64, max: f64) -> Self
pub fn decimal(sqref: &str, min: f64, max: f64) -> Self
Create a decimal range validation (between min and max).
Sourcepub fn text_length(
sqref: &str,
operator: ValidationOperator,
length: u32,
) -> Self
pub fn text_length( sqref: &str, operator: ValidationOperator, length: u32, ) -> Self
Create a text length validation.
Trait Implementations§
Source§impl Clone for DataValidationConfig
impl Clone for DataValidationConfig
Source§fn clone(&self) -> DataValidationConfig
fn clone(&self) -> DataValidationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more