how to add new row incase of empty datasource or null

2 posts, 0 answers
  1. Nannu
    Nannu avatar
    7 posts
    Member since:
    Dec 2006

    Posted 13 Oct 2011 Link to this post

    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

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Oct 2011 Link to this post

    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[] {}

  3. DevCraft R3 2016 release webinar banner
Back to Top