@@ -164,75 +164,62 @@ The Grid allows you to specify a page [`TemplateId`](/api/kendo.mvc.ui.fluent/{{
164164> To use a page template, you have to set the paper size.
165165
166166The Grid supports the following page template variables:
167- * ` pageNumber `
168- * ` totalPages `
169-
170- ``` HtmlHelper
171- <style>
172- body {
173- font-family: "DejaVu Serif";
174- font-size: 12px;
175- }
176-
177- .page-template {
178- position: absolute;
179- width: 100%;
180- height: 100%;
181- top: 0;
182- left: 0;
183- }
184-
185- .page-template .header {
186- position: absolute;
187- top: 30px;
188- left: 30px;
189- right: 30px;
190-
191- border-bottom: 1px solid #888;
192-
193- text-align: center;
194- font-size: 18px;
195- }
196-
197- .page-template .footer {
198- position: absolute;
199- bottom: 30px;
200- left: 30px;
201- right: 30px;
202- }
203- </style>
204-
205- <script type="x/kendo-template" id="page-template">
206- <div class="page-template">
207- <div class="header">
208- Acme Inc.
209- </div>
210- <div class="footer">
211- <div style="float: right">Page #: pageNum # of #: totalPages #</div>
212- </div>
167+
168+ * ` pageNum ` &mdash ; Specifies the current page number.
169+ * ` totalPages ` &mdash ; Specifies the total number of pages.
170+
171+ ``` Template
172+ <script type="x/kendo-template" id="page-template">
173+ <div class="page-template">
174+ <div class="header">
175+ Acme Inc.
176+ </div>
177+ <div class="footer">
178+ <div style="float: right">Page #: pageNum # of #: totalPages #</div>
213179 </div>
214- </script>
215-
216- @(Html.Kendo().Grid<.ProductViewModel>()
217- .Name("grid")
218- .ToolBar(tools => tools.Pdf())
219- .Pdf(pdf => pdf
220- .AllPages()
221- .PaperSize("A4")
222- .Margin("2cm", "1cm", "1cm", "1cm")
223- .Landscape()
224- .RepeatHeaders()
225- .Scale(0.75)
226- .TemplateId("page-template")
227- )
228- .DataSource(dataSource => dataSource
229- .Ajax()
230- .Read(read => read.Action("Products_Read", "Home"))
231- )
180+ </div>
181+ </script>
182+ ```
183+ ``` HtmlHelper
184+ @(Html.Kendo().Grid<.ProductViewModel>()
185+ .Name("grid")
186+ .ToolBar(tools => tools.Pdf())
187+ .Pdf(pdf => pdf
188+ .AllPages()
189+ .PaperSize("A4")
190+ .Margin("2cm", "1cm", "1cm", "1cm")
191+ .Landscape()
192+ .RepeatHeaders()
193+ .Scale(0.75)
194+ .TemplateId("page-template")
232195 )
233- ```
196+ .DataSource(dataSource => dataSource
197+ .Ajax()
198+ .Read(read => read.Action("Products_Read", "Home"))
199+ )
200+ )
201+ ```
234202{% if site.core %}
235203``` TagHelper
204+ <kendo-grid name="grid">
205+ <toolbar>
206+ <toolbar-button name="pdf"></toolbar-button>
207+ </toolbar>
208+ <pdf all-pages="true" landscape="true" paper-size="A4" scale="0.75"
209+ repeat-headers="true"
210+ template-id="page-template">
211+ <grid-pdf-margin top="2" right="1" bottom="1" left="1" />
212+ </pdf>
213+ <datasource type="DataSourceTagHelperType.Ajax">
214+ <transport>
215+ <read url="@Url.Action("Products_Read","Home")" />
216+ </transport>
217+ </datasource>
218+ </kendo-grid>
219+ ```
220+ {% endif %}
221+
222+ ``` Styles
236223 <style>
237224 body {
238225 font-family: "DejaVu Serif";
@@ -261,34 +248,7 @@ The Grid supports the following page template variables:
261248 right: 30px;
262249 }
263250 </style>
264-
265- <script type="x/kendo-template" id="page-template">
266- <div class="page-template">
267- <div class="header">
268- Acme Inc.
269- </div>
270- <div class="footer">
271- <div style="float: right">Page #: pageNum # of #: totalPages #</div>
272- </div>
273- </div>
274- </script>
275- <kendo-grid name="grid">
276- <toolbar>
277- <toolbar-button name="pdf"></toolbar-button>
278- </toolbar>
279- <pdf all-pages="true" landscape="true" paper-size="A4" scale="0.75"
280- repeat-headers="true"
281- template-id="page-template">
282- <grid-pdf-margin top="2" right="1" bottom="1" left="1" />
283- </pdf>
284- <datasource type="DataSourceTagHelperType.Ajax">
285- <transport>
286- <read url="@Url.Action("Products_Read","Home")" />
287- </transport>
288- </datasource>
289- </kendo-grid>
290251```
291- {% endif %}
292252
293253## Using Server Proxy
294254
0 commit comments