)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clear all dimensions and disable the pager option using an external button?

Platform: ASP.NET Web Forms (Classic) |
Control: OlapClient |
Published Date: February 9, 2015 |
Last Revised Date: July 2, 2019

This KB illustrates that how to clear all dimensions and disable the pager option.

Solution

You can clear all dimensions and disable the pager option using an external button through the following code example.

C#

protected void Button1_Click(object sender, EventArgs e)
{
  OlapClient1.EnablePaging = false;
  this.OlapClient1.AxisElementBuilderColumn.Controls.Clear();
  this.OlapClient1.AxisElementBuilderRow.Controls.Clear();
  this.OlapClient1.AxisElementBuilderSlicer.Controls.Clear();
  OlapDataManager DataManager = new OlapDataManager(@"Data Source = localhost; Initial Catalog = Adventure Works DW;");
  OlapClient1.OlapDataManager = DataManager;
  OlapClient1.UpdateAxisElementBuilder();
  if (this.OlapClient1.ActiveView == "Grid")
     OlapClient1.OlapGridCallBackPanel.ContentTemplateContainer.Controls.RemoveAt(OlapClient1.OlapGridCallBackPanel.ContentTemplateContainer.Controls.Count - 1);
  else
      OlapClient1.OlapChartCallBackPanel.ContentTemplateContainer.Controls.RemoveAt(OlapClient1.OlapChartCallBackPanel.ContentTemplateContainer.Controls.Count - 1);
  OlapClient1.DataBind();
}

VB

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
OlapClient1.EnablePaging = False
Me.OlapClient1.AxisElementBuilderColumn.Controls.Clear()
Me.OlapClient1.AxisElementBuilderRow.Controls.Clear()
Me.OlapClient1.AxisElementBuilderSlicer.Controls.Clear()
Dim DataManager As OlapDataManager = New OlapDataManager("Data Source =  localhost; Initial Catalog = Adventure Works DW;")
OlapClient1.OlapDataManager = DataManager
OlapClient1.UpdateAxisElementBuilder()
If Me.OlapClient1.ActiveView = "Grid" Then
OlapClient1.OlapGridCallBackPanel.ContentTemplateContainer.Controls.RemoveAt(OlapClient1.OlapGridCallBackPanel.ContentTemplateContainer.Controls.Count - 1)
Else
OlapClient1.OlapChartCallBackPanel.ContentTemplateContainer.Controls.RemoveAt(OlapClient1.OlapChartCallBackPanel.ContentTemplateContainer.Controls.Count - 1)
End If
OlapClient1.DataBind()
End Sub

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon