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

Radgrid Header with Empty Datasource.

1 Answer 485 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Swapna M
Top achievements
Rank 1
Swapna M asked on 17 Apr 2010, 11:49 AM
Hi,
    I am using Radgrid. On page load, it is empty. But still i want to show the grid header.
And also if i bind empty datasource, the header should not become invisble.
How to achieve this? I have set 

ShowHeader

 

="true" but no use.



Thanks in advance.

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Apr 2010, 09:32 AM
Hi Swapna,

Have you tried setting MasterTableView-ShowHeadersWhenNoRecords property in order to control the header visibility according to datasource?

Also set the DataSource to empty string to show the header on page load.
C#:
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadGrid1.DataSource = String.Empty; 
    } 

ASPX:
 
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" >  
    <MasterTableView AutoGenerateColumns="False" ShowHeadersWhenNoRecords="true">  

Regards,
Princy.
Tags
Grid
Asked by
Swapna M
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or