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

Showfooter set true doesn't working

3 Answers 255 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wilbert
Top achievements
Rank 1
wilbert asked on 06 Jun 2014, 04:13 AM
Hi guys i have all little problem here, i'm just want to appear gridview footer with gridview.showfooter = true, but I can, this my code. I've tried my best but i can't. hope you can give me some help. 

try
       {
           foreach (GridDataItem items in gridMonitorVisibilityConfiguration.Items)
           {
              
           GridFooterItem item = (GridFooterItem)gridMonitorVisibilityConfiguration.MasterTableView.GetItems(GridItemType.Footer)[0];
 
           RadComboBox cmbRolUser = (RadComboBox)item.FindControl("txtRoleUser");
           Label lblselect   = (Label)items.FindControl("spanLinkInbox");
           Label lblnoAll    = (Label)items.FindControl("lblNoAcces");
           Label lblView     = (Label)items.FindControl("lblview");
           Label lblViewMod  = (Label)items.FindControl("lblviewMod");
           Label lblAll      = (Label)items.FindControl("lblUserRoleText");
           Label lblsts      = (Label)items.FindControl("spanLinkInbox");
           Label lblstsft    = (Label)item.FindControl("spanLinkFooterInbox");
           Label lblftnoAll  = (Label)item.FindControl("lblftNoAcces");
           Label lblftView   = (Label)item.FindControl("lblftview");
           Label lblftvewMod = (Label)item.FindControl("lblftViewModify");
 
 
           Image ImgSelect   = (Image)items.FindControl("imgSelectInbox");
           Image ImgFooter   = (Image)item.FindControl("imgSelectFooterInbox");
 
         // radio button to enable grid
           if (rdShared.Checked == true)
           {
               gridMonitorVisibilityConfiguration.Enabled = true;
               lblprivate.Style["color"] = "#ACA899";
               lblshared.Style["color"] = "Black";
               //lblnoAll.CssClass = lblnoAll.CssClass + "grey";
 
               lblAll.Style["color"] = "Black";
               lblnoAll.Style["color"] = "Black";
               lblView.Style["color"] = "Black";
               lblViewMod.Style["color"] = "Black";
               lblsts.Style["color"] = "Black";
 
               lblftnoAll.Style["color"] = "Black";
               lblftView.Style["color"] = "Black";
               lblftvewMod.Style["color"] = "Black";
               gridMonitorVisibilityConfiguration.ShowFooter = true;
           }
            // rdbtn to disable gridview
           else if (rdPrivate.Checked == true)
           {
               gridMonitorVisibilityConfiguration.Enabled = false;
                
               lblshared.Style["color"] = "#ACA899";
               lblprivate.Style["color"] = "Black";
 
               
               //Edit
               lblAll.CssClass = lblAll.CssClass + "grey";
               lblnoAll.CssClass = lblnoAll.CssClass + "grey";
               lblView.CssClass = lblView.CssClass + "grey";
               lblViewMod.CssClass = lblViewMod.CssClass + "grey";
               lblsts.CssClass = lblsts.CssClass + "grey";
                
               //
               lblftnoAll.CssClass = lblftnoAll.CssClass + " grey";
               lblftView.CssClass = lblftView.CssClass + " grey";
               lblftvewMod.CssClass = lblftvewMod.CssClass + " grey";
               gridMonitorVisibilityConfiguration.MasterTableView.ShowFooter = false;
           }
       }
 
       }
       catch (Exception ex)
       {
           SetException(ex);
       }

3 Answers, 1 is accepted

Sort by
0
wilbert
Top achievements
Rank 1
answered on 09 Jun 2014, 04:44 AM
so anyone can't help me ? c'mon man :(
0
Princy
Top achievements
Rank 2
answered on 09 Jun 2014, 05:45 AM
Hi Wilbert,

I guess you are setting the RadGrid to enable or disable on a RadioButton. Please take a look at the sample code snippet. If this doesn't help, provide your full ASPX and code behind code.

ASPX:
<asp:RadioButton ID="rbtnDisable" runat="server" AutoPostBack="true" OnCheckedChanged="rbtnDisable_CheckedChanged" />
<asp:RadioButton ID="rbtnEnable" runat="server" AutoPostBack="true" OnCheckedChanged="rbtnEnable_CheckedChanged" />
<telerik:RadGrid ID="RadGrid1" runat="server". . >
    <MasterTableView ShowFooter="true">
        <Columns>
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID" Aggregate="Avg" />        
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity" Aggregate="Count" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT  OrderID,ShipCity,ShipVia FROM [Orders]"></asp:SqlDataSource>

C#:
protected void rbtnDisable_CheckedChanged(object sender, EventArgs e)
{
    RadioButton rbtn = (RadioButton)sender;
    if (rbtn.Checked)
    {
        RadGrid1.Enabled = false;
        RadGrid1.MasterTableView.ShowFooter = false;
        rbtnEnable.Checked = false;
    }
}
protected void rbtnEnable_CheckedChanged(object sender, EventArgs e)
{
    RadioButton rbtn = (RadioButton)sender;
    if (rbtn.Checked)
    {
        RadGrid1.Enabled = true;
        RadGrid1.MasterTableView.ShowFooter = true;
        RadGrid1.Rebind();
        rbtnDisable.Checked = false;
    }
}

Thanks,
Princy
0
wilbert
Top achievements
Rank 1
answered on 09 Jun 2014, 03:41 PM
thanks for your help,, it's work,,,thankss
Tags
Grid
Asked by
wilbert
Top achievements
Rank 1
Answers by
wilbert
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or