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

how to add new row incase of empty datasource or null

1 Answer 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nannu
Top achievements
Rank 1
Nannu asked on 13 Oct 2011, 10:25 AM
Hi,
We got requirement when data is empty , we show "No records found". Grid contains command to add or edit item. if there is no data or empty datasource, when the user clicks on "NEW " button , we would like to add new dummy row. I could not see telerik grid able to add new record incase of empty datasource. Can any1 provide me any solution on this

-Mahender

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 Oct 2011, 11:23 AM
Hello Nannu,

This is the expected behavior. When there is no Datasource (null), the Grid Cannot Insert the data.
Also the GridControl will not be visible if the DataSource for the grid is empty, i.e., if you have set
RadGrid1.DataSource = null or RadGrid1.DataSourceID = String.Empty.

If you want to make it visible on the page then you can set the DataSource as RadGrid1.DataSource= new string[] {}

Thanks,
Shinu.
Tags
Grid
Asked by
Nannu
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or