As per my comment... I've also removed the return value as it seemed strange to just return null. (or even the proposed list based on your function name).
public void addrowtocolors()
{
for (int i = 0; i < result.Count; i++)
{
var index = grdColors.Rows.Add();
grdColors.Rows[index].Cells["Code"].Value = result[i].Code.ToString();
grdColors.Rows[index].Cells["Desc"].Value = result[i].Desc.ToString();
}
}
or
public void addrowtocolors()
{
for (int i = 0; i < list.Count; i++)
{
var index = grdColors.Rows.Add();
grdColors.Rows[index].Cells["Code"].Value = list[i].Code.ToString();
grdColors.Rows[index].Cells["Desc"].Value = list[i].Desc.ToString();
}
}