Accessing Template Columns from server side

2 posts, 0 answers
  1. Abdul
    Abdul avatar
    39 posts
    Member since:
    Oct 2010

    Posted 17 Feb 2011 Link to this post

    Dear Telerik Team, 

    I have created a template column in RadGrid (code attached) . Now I want to insert constant data in this template column from server side.  Also I want to reuse this column multiple times... Please answer if it is possible ? Following are description of the problems

    Like in this grid I have created table, now I want to insert data in the column of that table. I have no SQL data base to bind with... is there a way to insert data in this table from server side. How I can access the columns and rows of that inner table. 

    2nd thing is I want to use this entire structure (template column) in each column of the grid. and number of columns of grid are unknown say I need to repeat this structure to unknown number of times.

    Abdul Ahad 

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="extrapage.aspx.cs" Inherits="ERM.Sales_Mix.extrapage" %>
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div>
            <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None">
    <MasterTableView>
    <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
     
    <RowIndicatorColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
     
    <ExpandCollapseColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table ID="Table_01" border="0" cellpadding="0" cellspacing="0" width="400">
                        <tr>
                            <td align="center" background="images/TABLE_01.gif" colspan="5" height="29">
                                <font color="#FFFFFF" face="Arial" size="+1">Month Title</font></td>
                        </tr>
                        <tr>
                            <td background="images/TABLE_02.gif" height="27" width="156">
                            </td>
                            <td background="images/TABLE_03.gif" height="27" width="62">
                            </td>
                            <td background="images/TABLE_04.gif" height="27" width="60">
                            </td>
                            <td background="images/TABLE_05.gif" height="27" width="62">
                            </td>
                            <td background="images/TABLE_06.gif" height="27" width="60">
                            </td>
                        </tr>
                        <tr>
                            <td height="19" width="156">
                            </td>
                            <td height="19" width="62">
                            </td>
                            <td height="19" width="60">
                            </td>
                            <td height="19" width="62">
                            </td>
                            <td height="19" width="60">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5" height="19" width="60">
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
            </telerik:RadGrid>
        </div>
        </form>
     
    </body>
    </html>
     
  2. Johny
    Johny avatar
    80 posts
    Member since:
    Aug 2008

    Posted 23 Feb 2011 Link to this post

    Hi,

    I hav finded this link very helps:
    http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html
    http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html#Creating_template_columns_programmatically


    for binds to server you can also use expressions:
    http://msdn.microsoft.com/en-us/library/ms178135%28vs.80%29.aspx
    http://msdn.microsoft.com/en-us/library/6dwsdcf5%28VS.71%29.aspx
    http://msdn.microsoft.com/en-us/library/ms178366.aspx

    Tanks.

    Johny
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top