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

Changing visible state of RadGrid MasterTableView buttons

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 21 Sep 2011, 07:43 PM
I am working with a grid like in your demo at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx.  The main difference is that mine is showing the MasterTableView on the top and bottom of the grid using <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="True" />.

I want to do something like change the visible state of a button in the MasterTableView.  Think of changing the "First Page" button to "Visible=false" if you are on the first page.  I can find and change the control at the top just fine, but I can not seem to change the state of the controls in the footer.  Even if I recurse through the RadGrid Controls, I find the top panel twice, but never the bottom one.  If I search for the <div> id name, I can not seem to find it.

Oh, yes the other constraint is that for what I am trying to do, I need to change it from the "RadGridX_SelectedIndexChanged so I can not just put it into the databind for the control.

How do I access the footer controls?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Sep 2011, 08:17 AM
Hello Mark,

One option is hiding the FirstPage button using CSS. Check out tehe following code snippet.
C#:
protected void RadGrid3_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridPagerItem)
  {
    GridPagerItem pagerItem = (GridPagerItem)e.Item;
    if (pagerItem.Paging.IsFirstPage)
    pagerItem.CssClass = "RadFirstPage";
  }
}
CSS:
<style type="text/css">
.RadFirstPage .rgPageFirst
 {
   display: none !important;
 }
</style>

Thanks,
Princy
Tags
General Discussions
Asked by
Tony
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or