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.
Unfortunately, activation email could not send to your email. Please try again.

DataValidation

Thread ID:

Created:

Updated:

Platform:

Replies:

56433 Feb 14,2007 05:56 PM Feb 17,2007 03:37 AM ASP.NET Web Forms (Classic) 4
loading
Tags: XlsIO
Craig Bart
Asked On February 14, 2007 05:56 PM

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" };


Administrator [Syncfusion]
Replied On February 15, 2007 04:07 AM

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

Melba Winshia [Syncfusion]
Replied On February 15, 2007 04:19 AM

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


Craig Bart
Replied On February 16, 2007 10:02 AM

So simply. LOL! Thanks for your help.

Melba Winshia [Syncfusion]
Replied On February 17, 2007 03:37 AM

Hi CB,

Thanks for the update!

Thanks,
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;