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

Telerik grid is not displaying, data source does contain data

0 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 16 May 2017, 05:09 AM

I am new to Telerik controls. I am using the Telerik RadGrid control, using another page in a project as reference/template.

 

I am able to assign a data source to the radgrid, but when the page is rendered nothing else is displayed.

 

Here is my grid definition

<div>
    <asp:HiddenField runat="server" ID="hfEventID" />
    <asp:HiddenField runat="server" ID="hfCompanyID" />
    <asp:HiddenField runat="server" ID="hfBoothNumber" />
    <telerik:RadGrid runat="server" ID="HelpRequestsGrid" OnNeedDataSource="HelpRequestsGrid_NeedDataSource" AutoGenerateColumns="true"
        AllowSorting="true" AllowPaging="true" PageSize="25" ShowHeader="true">
        <ClientSettings EnablePostBackOnRowClick="false" Resizing-AllowColumnResize="true" Resizing-AllowResizeToFit="true" Resizing-ShowRowIndicatorColumn="true">
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
            <Scrolling AllowScroll="True" UseStaticHeaders="true" />
        </ClientSettings>
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <ClientSettings>
            <Resizing AllowColumnResize="true" AllowResizeToFit="true" AllowRowResize="true" ResizeGridOnColumnResize="true"/>
        </ClientSettings>          
        <MasterTableView Width="100%" ClientDataKeyNames="Id" DataKeyNames="Id" AllowMultiColumnSorting="True" 
            ShowHeadersWhenNoRecords="true" Name="Master" NoMasterRecordsText="No help requests found.">
            <NoRecordsTemplate>
                No help requests found.
            </NoRecordsTemplate>
        </MasterTableView>
    </telerik:RadGrid>
</div>

 

And in my codebehind here is where I set the data source

        protected void HelpRequestsGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (CompanyID > 0 && EventID > 0)
            {
                HelpRequestsGrid.DataSource = Service.GetHelpRequest(EventID, CompanyID);
            }
        }

 

When I step through the code the data source gets set but come render nothing is displayed. What am I missing?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Share this question
or