Question about RadGrid

2 posts, 0 answers
  1. J
    J avatar
    143 posts
    Member since:
    Jun 2006

    Posted 03 Mar 2010 Link to this post

    Really simple question.  im working on the layout and design of my grid.  how do i fill my ascx radgrid with dummy data?  not looking to databind it to anything, just want to put 1 or 2 rows of dummy data in the columns collection.

    <telerik:RadGrid ID="RadGrid1" runat="server" Width="95%" AutoGenerateColumns="False" 
        PageSize="5" AllowSorting="True" AllowPaging="True" GridLines="None" ShowStatusBar="True" 
        > 
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <MasterTableView Width="100%" HierarchyLoadMode="ServerBind" DataKeyNames="ID"   
        HierarchyDefaultExpanded="True" 
        PageSize="5">  
            <DetailTables> 
                <telerik:GridTableView runat="server" DataKeyNames="ID" Caption="Document Versions" 
                    PageSize="5">  
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" /> 
                    </ParentTableRelation> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="ID" Visible="false" UniqueName="ID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="DocumentNumber" HeaderText="Document Number" 
                            UniqueName="DocumentNumber">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Version" HeaderText="Document Version" UniqueName="Version">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </telerik:GridTableView> 
                <telerik:GridTableView runat="server" DataKeyNames="ID" Caption="Document Title" 
                    PageSize="5">  
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="ID" MasterKeyField="ID" /> 
                    </ParentTableRelation> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="ID" Visible="false" UniqueName="ID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Title" UniqueName="Document Title">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </telerik:GridTableView> 
            </DetailTables> 
            <ExpandCollapseColumn Visible="True">  
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" UniqueName="ID" Visible="False" /> 
                <telerik:GridBoundColumn DataField="documentTitle" HeaderText="Document Title" UniqueName="documentTitle" 
                    SortExpression="documentTitle" /> 
                <telerik:GridBoundColumn DataField="Primary POC" HeaderText="Primary POC" UniqueName="Primary POC" 
                    ReadOnly="True" SortExpression="Primary POC" /> 
            </Columns> 
        </MasterTableView> 
        <FilterMenu EnableTheming="True">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </FilterMenu> 
    </telerik:RadGrid> 

    J
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 04 Mar 2010 Link to this post

    I don't believe it's possible to just insert some data into the markup of the RadGrid - you would have to have some sort of datasource for the Grid. You could always just make a simple DataTable (or DataSet since you have a hierarchy going on) and assign the table(s) a few rows of data.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top