View Single Post
  #3 (permalink)  
Old August 25th, 2010, 05:25 AM
sridhar c sridhar c is offline
Registered User
 
Join Date: Aug 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Response:To Generic Data usage error

Hi Chroniclemaster1, There is an error your code, which throws cannot implicitly convert type ContentType to ContentType ....
Just remove the '<ContentType>' content in addContent method and should compile fine.
The error free code is as follows:
public class TableCell<ContentType> where ContentType : new()
{
private int classRowIndex = 0;
private int classColumnIndex = 0;
private ContentType classTableCellContent = new ContentType();


/// <summary>
/// TableCell<ContentType>() - Constructors for creating a new TableCell
/// </summary>
public TableCell() { }
public TableCell(int inputRowIndex, int inputColumnIndex, ContentType inputTableCellContent)
{
addContent(inputRowIndex, inputColumnIndex, inputTableCellContent);
}


/// <summary>
/// void addContent<ContentType>(int inputRowIndex, int inputColumnIndex, ContentType inputTableCellContent) - accepts row and column indexesa dictionary and returns the XHTML to display all it's contents as a list
/// </summary>
public void addContent(int inputRowIndex, int inputColumnIndex, ContentType inputTableCellContent)
{
classRowIndex = inputRowIndex;
classColumnIndex = inputColumnIndex;
this.classTableCellContent = inputTableCellContent;
}
}

Hope it solves your problem.
Bye
sridhar