This is a migrated thread and some comments may be shown as answers.

set visible true on button click

3 Answers 263 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shivesh
Top achievements
Rank 1
shivesh asked on 10 Nov 2010, 11:55 AM
hi,
how can i set visible footer true inside rad grid on click of button that is outside from rad grid.
thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Nov 2010, 01:08 PM
Hello Shivesh,

You can set the ShowFooter property to true to show the footer.

C#:
protected void Button1_Click(object sender, EventArgs e)
   {
       RadGrid1.ShowFooter = true;
          RadGrid1.Rebind();
   }

Thanks,
Princy.
0
shivesh
Top achievements
Rank 1
answered on 10 Nov 2010, 01:36 PM
hi,
thanks but i mean whatever command button available in this footer row.
if there are two command button then in aspx code set visible false inside radgrid
then what i will use for set visible.

Thanks
0
Princy
Top achievements
Rank 2
answered on 10 Nov 2010, 01:51 PM
Hello Shivesh,


In that case, you need to get reference to GridFooterItem and and get teh control using FindControl() method.

Checkout the code shown below.
protected void Button2_Click(object sender, EventArgs e)
{       
    GridFooterItem footerItem = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
    Label lbl = (Label)footerItem.FindControl("Label1");
    lbl.Visible = true;
}


Where the Label1 is placed inside FooterTemplate:
<FooterTemplate>
               <asp:Label ID="Label1" runat="server" Text="Count" Visible="false"></asp:Label>
           </FooterTemplate>
       </telerik:GridTemplateColumn>


Thanks,
Princy.
Tags
Grid
Asked by
shivesh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
shivesh
Top achievements
Rank 1
Share this question
or