This is a migrated thread and some comments may be shown as answers.

Create an Excel Dropdown list with ExportToExcelML

2 Answers 156 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alain
Top achievements
Rank 1
Alain asked on 30 Apr 2011, 09:23 AM
Dear Telerik Team,


Is it possible to create a custom Drop Down list (validation list) in the Excel worksheet when exporting the RadGridView with ExportToExcelML (VB.net code)?

 

I;m giving herebelow an example of code to create a drop down list using the Excel Interop assemblies but which I'd like to use/convert with the faster ExportToExcelML method:

 

 

 

Private Sub AddCategoryValidationList(ByVal rng As Excel.Range)

With

 

rng.Validation

 

 

.Add(Excel.XlDVType.xlValidateList, _

 

Excel.XlDVAlertStyle.xlValidAlertStop, _

 

1,

"=Beneficiaries!$A$1:$A$1000")

 

 

.InCellDropdown =

True

 

.ErrorTitle =

"Stock release form"

 

.InputMessage =

"Please select a beneficiairy"

 

.ErrorMessage =

"The value you have entered is not a " & _

 

 

 

"valid beneficiary. Please select a beneficiary from " & _

 

 

 

"the list."

 

.ShowInput =

True

 

.ShowError =

True

 

 

End With

 

End Sub

Best regards,
Alain Cavenaile

2 Answers, 1 is accepted

Sort by
0
Alain
Top achievements
Rank 1
answered on 01 May 2011, 09:58 AM
As current work around, I have obviously reopened the workbook I created using ExportToExcelML via Interop Excel, then added the validation list as per the method exposed in my post yesterday, but I was wondering if a validation list is provided by the ExportToExcelML class or not.


Thanks and regards,
Alain Cavenaile
0
Martin Vasilev
Telerik team
answered on 05 May 2011, 07:50 AM
Hello Alain,

Thank you for writing.

The described feature is not supported by the ExporToExcelML class. Moreover, it cannot be implemented internally, because this exporting method do not use interop assembly and actually just creates a special XML format, readable by MS Excel. I think your work around is the only suitable way to implement your requirement with this class.

Do not hesitate to contact me again if you have any other questions.

Kind regards,
Martin Vasilev
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Alain
Top achievements
Rank 1
Answers by
Alain
Top achievements
Rank 1
Martin Vasilev
Telerik team
Share this question
or