This is a migrated thread and some comments may be shown as answers.

Question about RadGrid

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 03 Mar 2010, 02:54 PM

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

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 04 Mar 2010, 03:40 PM
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.
Tags
Grid
Asked by
J
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or