Hi !
I have a radgrid with a datasource creating dynamicaly.it means columns create programatically and add to radgrid,so before runtime it is not clear number of columns or their names.
and some columns have header .it means a radgrid with 2 rows in header.
now i want to create a <table> with two <tr> and add columns header to <td>.
then add this <table> to GridTemplateColumn -> HeaderTemplate.
like this:
<telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName"
InitializeTemplatesFirst="false">
<FooterTemplate>
Template column footer</FooterTemplate>
<FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />
<HeaderTemplate>
<table id="Table1" cellspacing="0" style="width:240px;" class="myTable">
<tr>
<td colspan="2" align="center">
<b>Contact details</b></td>
</tr>
<tr>
<td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContName" Text="Contact name" ToolTip="Sort by ContactName"
CommandName='Sort' CommandArgument='ContactName' runat="server" /></td>
<td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContTitle" Text="Contact title" ToolTip="Sort by ContactTitle"
CommandName='Sort' CommandArgument='ContactTitle' runat="server" /></td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellspacing="0" width="100%" class="myTable">
<tr>
<td style="width: 50%">
<%# Eval("ContactName") %>
</td>
<td style="width: 50%">
<%# Eval("ContactTitle") %>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
but this is in design time.i want create this in run time.(code behind)
how can i do this?
thanks.
I have a radgrid with a datasource creating dynamicaly.it means columns create programatically and add to radgrid,so before runtime it is not clear number of columns or their names.
and some columns have header .it means a radgrid with 2 rows in header.
now i want to create a <table> with two <tr> and add columns header to <td>.
then add this <table> to GridTemplateColumn -> HeaderTemplate.
like this:
<telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="CompanyName"
InitializeTemplatesFirst="false">
<FooterTemplate>
Template column footer</FooterTemplate>
<FooterStyle VerticalAlign="Middle" HorizontalAlign="Center" />
<HeaderTemplate>
<table id="Table1" cellspacing="0" style="width:240px;" class="myTable">
<tr>
<td colspan="2" align="center">
<b>Contact details</b></td>
</tr>
<tr>
<td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContName" Text="Contact name" ToolTip="Sort by ContactName"
CommandName='Sort' CommandArgument='ContactName' runat="server" /></td>
<td style="width: 50%">
<asp:LinkButton CssClass="Button" ID="btnContTitle" Text="Contact title" ToolTip="Sort by ContactTitle"
CommandName='Sort' CommandArgument='ContactTitle' runat="server" /></td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table cellspacing="0" width="100%" class="myTable">
<tr>
<td style="width: 50%">
<%# Eval("ContactName") %>
</td>
<td style="width: 50%">
<%# Eval("ContactTitle") %>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
but this is in design time.i want create this in run time.(code behind)
how can i do this?
thanks.