insert template in cs
Im using aspxGridView control. It has templates inside. In aspx file I can write like: So aspxGridView control has got templates and one of them is StatusBar. Now I would like to set that status bar template which as You can see contains html and so on in my cs file so that I can modify it from cs file for each aspxGridView.
<aspxgridView>
...
<Templates>
<StatusBar>
<div id="StatusBarDiv" runat="server" align="right">
<table>
<tr>
<td>
<dxe:ASPxLabel ID="Title" runat="server" Text="records per page:">
</dxe:ASPxLabel>
</td> 开发者_如何学JAVA
<td>
...
Because its kind of gridView and I have a lot of them in my project I wanted to add this template to each one in default.master.cs file.
I iterate through each control, check if its aspxGridView control and if yes I would like to add that template but I dont know how to add it from cs file :/
thanks for any help on doing that
To implement a template in runtime, you should create a special class which will support the ITemplate interface and set the ASPxGridView.Templates.StatusBar property to an instance of this class. For more details, please refer to the following examples.
精彩评论