We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ej.grids.Grid Render just column headers with null data

Thread ID:

Created:

Updated:

Platform:

Replies:

146195 Jul 25,2019 12:34 AM UTC Jul 25,2019 11:20 AM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Travis
Asked On July 25, 2019 12:34 AM UTC

Is it possible to render a grid's (ej.grids.Grid) column headers when the datasource is null?

Thavasianand Sankaranarayanan [Syncfusion]
Replied On July 25, 2019 11:20 AM UTC

Hi Travis, 

Greetings from Syncfusion support. 

Yes, we can set the column headertext value when the dataSource as null. 

Refer the below code example. 


var grid = new ej.grids.Grid({ 
    dataSource: null, 
    columns: [ 
        { field: 'OrderID', headerText: 'Order ID', width: 120, textAlign: 'Right' }, 
        { field: 'CustomerName', headerText: 'Customer Name', width: 150 }, 
        { field: 'OrderDate', headerText: 'Order Date', width: 130, format: 'yMd', textAlign: 'Right' }, 
        { field: 'Freight', width: 120, format: 'C2', textAlign: 'Right' }, 
        { field: 'ShippedDate', headerText: 'Shipped Date', width: 140, format: 'yMd', textAlign: 'Right' }, 
        { field: 'ShipCountry', headerText: 'Ship Country', width: 150 } 
    ] 
}); 
grid.appendTo('#Grid'); 


We have prepared a simple sample in the following link. 


Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon