We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DataValidation

How do i select the first row on Data Validation list box? I would like UnChecked to be selected by default in the following code. Thanks.

IDataValidation validation = oSheet.Range["A1 "].DataValidation;

validation.ListOfValues = new string[] { "UnChecked, Checked" };


4 Replies

AD Administrator Syncfusion Team February 15, 2007 09:07 AM UTC

you can use oSheet.Range["A1 "].Text = "UnChecked"


MW Melba Winshia Syncfusion Team February 15, 2007 09:19 AM UTC

Hi CB,

You can use the following code snippets to select "UnChecked" by default.

[C#]

//Data validation to list the values in the first cell
IDataValidation validation = sheet.Range["A1"].DataValidation;
sheet.Range["A1"].Text = "UnChecked";
validation.ListOfValues = new string[] { "UnChecked, Checked" };

Here is the sample for your reference:

PickLists.zip

Kindly take a look at the sample above and let me know if you have any other questions.

Regards,
Melba



CB Craig Bart February 16, 2007 03:02 PM UTC

So simply. LOL! Thanks for your help.


MW Melba Winshia Syncfusion Team February 17, 2007 08:37 AM UTC

Hi CB,

Thanks for the update!

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon