How can i change or bind pivot client data source from database?
My example coding like that
aspx file code:
<ej:PivotClient ID="PivotClient1" runat="server" OnLoad="PivotClient1_Load" OnDataBinding="PivotClient1_DataBinding" ClientIDMode="Static" Title="Test1">
<ToolbarIconSettings EnableChartTypes="true" />
<DisplaySettings Mode="ChartAndGrid" EnableTogglePanel="true" DefaultView="Grid" />
<DataSource EnableAdvancedFilter="true" IsFormattedValues="true"></DataSource>
</ej:PivotClient>
aspx.cs file code:
protected void PivotClient1_DataBinding(object sender, EventArgs e)
{
try
{
PivotDataSource pds = new PivotDataSource();
string a = JsonData(GetReportData("1").Tables["Rpt1"]);
pds.Data = a;
PivotClient1.Model.DataSource = pds;
}
catch
{
}
}