Apply condition based hyperlink for specific row or column
17 Feb 20222 minutes to read
You can apply conditions for specific row or column using label
option to show hyperlink option in the pivot table. It can be configured using the conditionalSettings
option through code behind, during initial rendering. The required settings are:
-
label
: Specifies the header name to get visibility of hyperlink option for row or column. -
condition
: Specifies the operator type such as equals, greater than, less than, etc. -
value1
: Specifies the start value. -
value2
: Specifies the end value.
<ejs-pivotview id="PivotView" height="300">
<e-datasourcesettings dataSource="@ViewBag.DataSource" expandAll="false">
<e-drilledmembers>
<e-field name="Country" items="@ViewBag.countryMembers"></e-field>
<e-field name="Year" items="@ViewBag.yearMembers"></e-field>
</e-drilledmembers>
<e-formatsettings>
<e-field name="Amount" format="C0" maximumSignificantDigits="10" minimumSignificantDigits="1" useGrouping="true"></e-field>
</e-formatsettings>
<e-rows>
<e-field name="Country"></e-field>
<e-field name="Products"></e-field>
</e-rows>
<e-columns>
<e-field name="Year" caption="Year"></e-field>
<e-field name="Quarter"></e-field>
</e-columns>
<e-values>
<e-field name="Sold" caption="Units Sold"></e-field>
<e-field name="Amount" caption="Sold Amount"></e-field>
</e-values>
</e-datasourcesettings>
<e-hyperlinkSettings>
<e-conditionalsettings>
<e-format label="Germany" conditions="Between" value1="500"></e-format>
</e-conditionalsettings>
</e-hyperLinkSettings>
</ejs-pivotview>
public ActionResult Index()
{
var data = GetPivotData();
ViewBag.DataSource = data;
ViewBag.yearMembers = new string[] { "FY 2015" };
ViewBag.countryMembers = new string[] { "France" };
return View();
}