I have been new at this component and been trying to use it
I would like to display an empty grid on load of my page.
the grid should have no data and it should display the "No records to display."
we have a check box above the grid where the user will check what items they want to display in the grid......
When checked the grid will display the items information.
I have seen other forums about this but can't find a sample running program....
I saw the forum which mention about the use of a blank object to the grids datasource but I cant figure out how to make it...
Pls. I would like to see how to use a blank object to the datasource...since i think its the best way or is their another way??
I would like to display an empty grid on load of my page.
the grid should have no data and it should display the "No records to display."
we have a check box above the grid where the user will check what items they want to display in the grid......
When checked the grid will display the items information.
I have seen other forums about this but can't find a sample running program....
I saw the forum which mention about the use of a blank object to the grids datasource but I cant figure out how to make it...
Pls. I would like to see how to use a blank object to the datasource...since i think its the best way or is their another way??
9 Answers, 1 is accepted
0
Hello Erwin,
Try the following approach:
Kind regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Try the following approach:
protected void Page_Load(object o, EventArgs e) |
{ |
RadGrid1.DataSource = new int[] { }; |
} |
<telerik:RadGrid ID="RadGrid1" runat="server" /> |
Kind regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Erwin
Top achievements
Rank 1
answered on 25 May 2009, 06:33 AM
Thank you for the solution..
I have another problem about the grid....
I would like to know how you made the grid load itself ...I mean when you click something in you grid, the grid reload but in my project the whole page load.. I downloaded sample programs but they do not run since
im using the latest version of telerik Q1 2009
can you show me in a sample how to load the grid only not the whole page...
I have another problem about the grid....
I would like to know how you made the grid load itself ...I mean when you click something in you grid, the grid reload but in my project the whole page load.. I downloaded sample programs but they do not run since
im using the latest version of telerik Q1 2009
can you show me in a sample how to load the grid only not the whole page...
0

Princy
Top achievements
Rank 2
answered on 25 May 2009, 07:14 AM
Hi Erwin,
You can ajaxify your grid using the RadAjaxManager or RadAjaxPanel Controls in order to prevent whole page reload. Refer to the following help documents to understand how to use either of these controls.
AJAX Manager
AJAX Panel
-Princy
You can ajaxify your grid using the RadAjaxManager or RadAjaxPanel Controls in order to prevent whole page reload. Refer to the following help documents to understand how to use either of these controls.
AJAX Manager
AJAX Panel
-Princy
0

Erwin
Top achievements
Rank 1
answered on 25 May 2009, 08:32 AM
I am trying to used the Ajax panel. but their is an error..
Server Error in '/' Application.
the grid is in a control which the main page calls.
another thing.....
I have displayed a empty grid but i do not see the "No records to display"....how can i show this message or how can i modify it to make my own message like "You have not selected any Item" ?
Server Error in '/' Application.
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
the grid is in a control which the main page calls.
another thing.....
I have displayed a empty grid but i do not see the "No records to display"....how can i show this message or how can i modify it to make my own message like "You have not selected any Item" ?
1

Shinu
Top achievements
Rank 2
answered on 25 May 2009, 11:13 AM
Hello Erwin,
Refer to the following document which explains on how to avoid the error that you receive:
Also try setting the NoMasterRecordsText property to a custom text as shown below:
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server"> |
<MasterTableView NoMasterRecordsText="You have not selected any Item"> |
Additionally, make sure that you pass an empty data source to the grid to get the NoRecords template displayed:
|
Thanks
Shinu.
0

Erwin
Top achievements
Rank 1
answered on 26 May 2009, 03:15 AM
Thank you very much
Your solutions are very helpful
It works now.
Your solutions are very helpful
It works now.
0

Erwin
Top achievements
Rank 1
answered on 08 Jun 2009, 09:39 AM
I thought my problem was over when i tried using an empty grid
but...
i encounter another problem when i used a GridTemplateColumn
and add a checkbox on it..
at first the table will have no data in it then i choose some items. after i bind it i noticed that no checkbox show in the column where i put a GridTemplateColumn, the only thing that display was the header of the column.
i tried not making a empty grid and showing all items in the grid and the checkbox were visible... i cant seem to understand why the checkbox did not display if we first display an empty grid then bind it.....
but...
i encounter another problem when i used a GridTemplateColumn
and add a checkbox on it..
at first the table will have no data in it then i choose some items. after i bind it i noticed that no checkbox show in the column where i put a GridTemplateColumn, the only thing that display was the header of the column.
i tried not making a empty grid and showing all items in the grid and the checkbox were visible... i cant seem to understand why the checkbox did not display if we first display an empty grid then bind it.....
0

Saurabh Srivastava
Top achievements
Rank 1
answered on 11 Aug 2009, 05:05 PM
I have a similar problem. My situation is that I bind my grid to an empty object on PageLoad (within the !IsPostBack section). I also create a datatable which would be created at runtime as the user would fill in the grid. This datatable has been assigned to be the datasource of the grid in the NeedDataSource event.
Now as soon as I press on Add a new record, the NeedDataSource event is being fired and I get nothing displayed on the screen (i.e. the grid vanishes).
The issue here is that we need a simple sample which demonstrates a grid with template columns which loads empty by default, accepts the user input (into a datatabe) with Insert/Edit and Delete functionality
Now as soon as I press on Add a new record, the NeedDataSource event is being fired and I get nothing displayed on the screen (i.e. the grid vanishes).
The issue here is that we need a simple sample which demonstrates a grid with template columns which loads empty by default, accepts the user input (into a datatabe) with Insert/Edit and Delete functionality
0
Hello Saurabh,
The problem is that RadGrid rebinds when you press the Add New Record button. Since you don't bind RadGrid after the first postback I believe this behavior is expected.
Commands that invoke Rebind() implicitly
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The problem is that RadGrid rebinds when you press the Add New Record button. Since you don't bind RadGrid after the first postback I believe this behavior is expected.
Commands that invoke Rebind() implicitly
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.