Hi Rahul,
Try this code.
DataControlFieldHeaderCell sortlink = (DataControlFieldHeaderCell)cell;
The reason your code in not working properly b'coz you have turned on
AutoGenerateSelectButton="true"
.
If you remove
AutoGenerateSelectButton="true"
your existing code will work perfectly, I mean without any errors or exceptions.
Hope this helps!