Set default value in excel cell using epplus in ASP.Net

venkatg
 
on Aug 16, 2021 05:46 AM
900 Views

how to select default value from dropdownlist dynamic binding excel in using epplus c#

ExcelPackage ExcelPkg = new ExcelPackage();
ExcelWorksheet wsSheet1 = ExcelPkg.Workbook.Worksheets.Add("PrintLayoutSheet");
//PrintLayoutCardsModel carddetaillistrarity = null;
//  var carddetaillistrarity = printLayout.PrintLayoutCards.;
// var ListRarity=carddetaillistrarity.ra
int FormsCount = printLayout.Forms.Count()+2;
int StartCoumn = FormsCount + 2;
var Raritylist = wsSheet1.DataValidations.AddListValidation(wsSheet1.Cells["C"+ FormsCount + ":C" + FormsCount + ""].Address);
List<GameRarityTypeModel> parts = new List<GameRarityTypeModel>();
parts.Add(new GameRarityTypeModel() { GameRarityID = 1, RarityName = "Common" });
parts.Add(new GameRarityTypeModel() { GameRarityID = 2, RarityName = "UnCommon" });
parts.Add(new GameRarityTypeModel() { GameRarityID = 3, RarityName = "Mithic" });
Raritylist.Formula.Values.Add("Default");
for (int i = 0; i < parts.Count; i++)
{
    Raritylist.Formula.Values.Add(  parts[i].RarityName.ToString());
}

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
venkatg
 
on Aug 24, 2021 04:45 AM
wsSheet1.Cells[FormsCount, FormsCount].Value = "Default";