Help me Please
-
Friends, I want to hide the button named down inside Item Template on last row. How can I do this. For first row I have done this Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true)>" CommandName="MoveUp" CommandArgument="<%# Container.DataItemIndex %" >; Now the same code I want to use to hide last row in Grid View. How can I do this.
-
Friends, I want to hide the button named down inside Item Template on last row. How can I do this. For first row I have done this Visible="<%# IIf(CType(Container, GridViewRow).RowIndex = 0, false, true)>" CommandName="MoveUp" CommandArgument="<%# Container.DataItemIndex %" >; Now the same code I want to use to hide last row in Grid View. How can I do this.
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 DilipvDilip Kumar Vishwakarma Programmer .Net Consulting