How to align the cell value in PivotGrid?
This KB illustrates that how to align the cell value in PivotGrid control.
Solution:
You can align the cell value in PivotGrid by using the following code examples at sample level.
JavaScript
$("#PivotGrid1").ejPivotGrid({ url: "../wcf/PagingService.svc"});
$("#Button1").ejButton({
size: "normal",
click:"btnClick"
});
function btnClick(args) {
$("#PivotGrid1 table th")[1].style["text-align"] = "center";
return false;
}
ASP
<ej:PivotGrid ID="PivotGrid1" Url="../wcf/PagingService.svc" runat="server"></ej:PivotGrid>
<ej:Button ID="Button1" runat="server" Size="Large" Type="Reset" OnClick="btnClick" ShowRoundedCorner="true" Text=" Click Here…"></ej:Button>
<script>
function btnClick(args) {
$("#PivotGrid1 table th")[1].style["text-align"] = "center";
return false;
}
</script>
MVC
@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("~/wcf/PagingService.svc"))
@Html.EJ().Button("Button1").Text("Click Here…").Size(ButtonSize.Normal).ShowRoundedCorner(true).ClientSideEvents(e => e.Click("btnClick"))
<script>
function btnClick(args) {
$("#PivotGrid1 table th")[1].style["text-align"] = "center";
return false;
}
</script>