0

I have a LinkButton(LinkButton_x) in my aspx page. i'm using this LinkButton to check all boxes in CheckBoxList. when i clicked on this LinkButton(LinkButton_x), code in partial class is executing to select all the boxes in CheckBoxList.

also have several LinkButtons in a TemplateField of a GridView as below.

<asp:TemplateField HeaderText="">
    <ItemTemplate>
        LinkButton1 here
        LinkButton2 here
    </ItemTemplate>
    <EditItemTemplate>
        LinkButton3 here
        LinkButton4 here
    </EditItemTemplate>
    <FooterTemplate>
        LinkButton5 here
        LinkButton6 here
    </FooterTemplate>
</asp:TemplateField>

LinkButtons in TemplateFields FooterTemplate is normally displaying. but When i click on LinkButton_x in aspx page, LinkButtons in TemplateFields ItemTemplate also displaying. i want to avoid it.

how can i solve this ?

Satpal
  • 132,252
  • 13
  • 159
  • 168
Bishan
  • 15,211
  • 52
  • 164
  • 258
  • Are you asking about hiding the linkbuttons that are inside the gridview when we click on outer linkbutton? – Sanjeev Rai Jun 19 '13 at 12:28
  • @SanjeevRai normally LinkButtons in FooterTemplate is displaying. LinkButtons in other Templates are not display. but when i click linkbutton in out side of girdview, linkbuttons in ItemTemplate is appeared. i don't need that. – Bishan Jun 20 '13 at 02:55

1 Answers1

0

If you have Linkbutton in <ItemTemplate> and you don't have written any logic to hide the linkbutton, then it will obviously display it provided that grid contains atleast one row.

I think your problem is more related to binding of grid and its number of rows during postback. It may be the case that when you click on linkbutton then due to postback grid would be getting change.

Sanjeev Rai
  • 6,721
  • 4
  • 23
  • 33