3
Answers

Am havg this error that says cannot explicitly call operator

Tchala B

Tchala B

6y
222
1
I think am on the right truck but i dont know where am messing up .Any advice is welcome.
 
Here is my code

  1. private Worksheet wks(string string_1, ExpandableGridView expandableGridView_2)  
  2.         {  
  3.             IEnumerator enumerator = null;  
  4.             IEnumerator enumerator1 = null;  
  5.             Worksheet worksheet;  
  6.             Worksheet worksheet1 = new Worksheet();  
  7.             int num = 0;  
  8.             int num1 = 0;  
  9.             try  
  10.             {  
  11.                 this.list_0.Clear();  
  12.                 try  
  13.                 {  
  14.                     enumerator = expandableGridView_2.Columns.GetEnumerator();  
  15.                     while (enumerator.MoveNext())  
  16.                     {  
  17.                         DataGridViewColumn current = (DataGridViewColumn)enumerator.Current;  
  18.                         if (!current.Visible)  
  19.                         {  
  20.                             continue;  
  21.                         }  
  22.                         this.list_0.Add(current.Index); 
  23. //the error appears on the below lines of code where it says get_Item
  24.                         worksheet1.CellGrid.get_Item(num1, num).set_Value(current.HeaderText);  
  25.                         worksheet1.CellGrid.get_Item(num1, num).set_WrapText(true);  
  26.                         worksheet1.CellGrid.get_Item(num1, num).set_BackgroundColor(Color.Gray);  
  27.                         worksheet1.CellGrid.get_Item(num1, num).set_Color(Color.White);  
  28.                         worksheet1.CellGrid.get_Item(num1, num).set_VerticalAlignment(1);  
  29.   
  30.                         if (num1 > 0)  
  31.                         {  
  32.                             worksheet1.CellGrid.get_Item(num1, num).set_RotationAngle(-90);  
  33.                         }  
  34.                         num1 = checked(num1 + 1);  
  35.                     }  
  36.                 } 
Answers (3)