Hello Everyone,
I have list items inside objproductBL object.
- List
objproductBL = new List(); - objproductBL = objProductDAL.GetProductSpecificaton(productid).Select(item => new ProductItemsBL
- {
- ProductCategoryName = item.ProductCategoryName,
- ProductName = item.ProductName,
- AttributeName = item.AttributeName,
- ProductImage1 = item.ProductImage1,
- ValidValues = item.ValidValues,
- ProductDescription = item.ProductDescription,
- AttributeMaxLength = item.AttributeMaxLength,
- AttributeControlType = item.AttributeControlType
- }).ToList();

From the list, if the 'AttributeControlType' contain "DropDownList" then I want to show it's 'ValidValues' inside drowpdownlist.
For this, I have tried created a string[] inside model class.
- public class Mymodel
- {
- public string[] arryvalidvalue = new string[] { };
- }
- List
objproductBL = new List(); - objproductBL = objProductDAL.GetProductSpecificaton(productid).Select(item => new ProductItemsBL
- {
- ProductCategoryName = item.ProductCategoryName,
- ProductName = item.ProductName,
- AttributeName = item.AttributeName,
- ProductImage1 = item.ProductImage1,
- ValidValues = item.ValidValues,
- ProductDescription = item.ProductDescription,
- AttributeMaxLength = item.AttributeMaxLength,
- AttributeControlType = item.AttributeControlType
- }).ToList();
- ProductItemsBL objBL = new ProductItemsBL();
- /*ListValidValues*/
- bool yesno = false;
- foreach (var item in objproductBL)
- {
- for (int i = 0; i < item.ValidValues.Length; i++)
- {
- if (item.ValidValues.Substring(i, 1) == ",") yesno = true;
- }
- if (yesno == true)
- {
- objBL.arryvalidvalue = (item.ValidValues.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries));
- yesno = false;
- }
- }
- // objproductBL.AddRange()
- return objproductBL;
Please help me...

Abhilash J APosted Jan 19, 2017, 1:42 AM
Shams RehmanPosted Jan 19, 2017, 1:38 AM