folks,
I have a method in i pass object of type Type. And i want to convert object that i have in this method, to type in Type. For example
void SetNewRecord(Type requiredType)
{
var list = GridView.DataSource as requiredType;
for (int i = 0; i < list.Length; i++)
{
if (list[i].KOD == kod)
{
GridView.CurrentCell = GridView[0, i];
return;
}
}
}
if i pass int[] as parameter, i want that GirdView.DataSource be converted to int[]. Is it possible in C# ?
You can try to use Generic to solve your problem
And if you want to call it via reflection