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

[Solved] Display Grid W/O Data

2 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 02 Jun 2009, 07:19 PM
I have the requirement, in numerous screens whereas the user will be presented with
textbox(s) to enter search criteria, and upon their entry of one or many search items
we wil retrieve the data and bind it to the grid.

When the screen opens where is a BIG HOLE in it where I was hoping some type of
placeholder, etc would display the results grid. I have googled and tried some of the
solutions to no avail.

I would love to have a something there to indicate "This is where the search results" are
going to go, possibly with the actual column headings?

Thanks!

Jim Douglas

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 03 Jun 2009, 07:58 AM
Hi Jim,

You can initially bind your grid to an empty object collection as shown below so that it displays the NoMasterRecordsText when there are no records. You can bind the grid to the searched results on postback (say a button click or so).
c#:
 protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            RadGrid1.DataSource = new object[] { };  
            RadGrid1.Rebind();  
        }  
    } 
 

Also you can customize the NoMasterRecordsText as shown below:
aspx:
<telerik:RadGrid ID="RadGrid3" AutoGenerateColumns="true" runat="server" >         
        <MasterTableView NoMasterRecordsText="Search Results" >  

Thanks
Princy. 
0
James
Top achievements
Rank 1
answered on 03 Jun 2009, 04:08 PM
Thanks, just what I wanted! Excellent support!
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
James
Top achievements
Rank 1
Share this question
or