Rather than adding control individually
add both control in HtmlTable. Add that HtmlTable in gridview.
HtmlTable table1 = new HtmlTable();
HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell;
for (int j = 1; j <= 2; j++)
{
cell = new HtmlTableCell();
if (j == 1)
{
cell.Controls.Add(lnkSortCol );
cell.VAlign = "Top";
}
else
{
cell.Controls.Add(txtFilter);
cell.VAlign = "Bottom";
}
row.Cells.Add(cell);
}
grvCtrl.HeaderRow.Cells(0).Controls.AddAt(0, table1);