Using Generics to typecast object type to generic type

Posted by Shantanu Gupta on Stack Overflow See other posts from Stack Overflow or by Shantanu Gupta
Published on 2010-04-23T07:55:27Z Indexed on 2010/04/23 8:03 UTC
Read the original article Hit count: 400

Filed under:
|
|

I am very new to generics and trying to implement it. How can i use it here.

   private T  returnValueFromGrid(int RowNo, int ColNo) 
        {
            return Converter<dgvCurrencyMaster.Rows[RowNo].Cells[ColNo].Value,T>;
        }

I am trying to convert below value to generic type and then return it.

dgvCurrencyMaster.Rows[RowNo].Cells[ColNo].Value

Here i need to know two things. How to do the above problem and how to use this in my code. Please provide some eg.

© Stack Overflow or respective owner

Related posts about generics

Related posts about .NET