hi Zeeshan Memon, I think answer exists in your question only.
Zeeshan Memon wrote:
Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true)>" CommandName="MoveUp" CommandArgument="<%# Container.DataItemIndex %" >;
You should find RowCount of your gridview because your gridview is 0 based indexed. Just need to check index is RowCount-1 OR not then you show and hide your control. <asp:linkbutton id="lblUp" runat="server" font-underline="true" forecolor="blue" text="Up"> Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = CType(Container, GridViewRow).RowCount -1, false, true)>" CommandName="MoveUp" CommandArgument="<%# Container.DataItemIndex %" >; Hope this will help you. Thanks & Regards Dilipv
Dilip Kumar Vishwakarma Programmer .Net Consulting