5 posts, 0 answers
  1. Ajay
    Ajay avatar
    66 posts
    Member since:
    May 2009

    Posted 30 Jul 2009 Link to this post

    Hi Telerik Guys !

    Guys ! Iam using the Q2 2009 version for the ASP.NET RAD CONTROLS

    I have set the SKIN property to DEFAULT for the  RAD GRID.

    Im using DATA TABLE to bind it with OBJECT DATA SOURCE.

    I have used  all the mentioned solution provided at your end , but all in vain.

    Could you plz help me how to show up the header of the grid .

    Right now , RAD GRID is behaving just like a HORIZONTAL SCROLL BAR.

    Below is the code that I have been using :-
    .CS File :-

    At Page_Load :

      SearchResultsRadGrid.MasterTableView.GetColumn("RowIndicator").Display = false;


    protected void SearchResultsRadGrid_PreRender(object sender, EventArgs e)
                SearchResultsRadGrid.MasterTableView.ShowHeadersWhenNoRecords = true;

    Help !

    Ajay Jamwal

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

    Posted 30 Jul 2009 Link to this post

    Hello Ajay,

    The RadGrid may appear as a horizontal line when the datasource for the RadGrid is null(when no records) initially. Inorder to display the header row of the grid even when the grid's datasource is not assigned, you can try the following code:
     if (RadGrid1.DataSource == null)  
                RadGrid1.DataSource = new string[] { };  
    Additionally, you can declaratively set the ShowHeadersWhenNoRecords property also to True.

    Hope this helps...
  3. DevCraft R3 2016 release webinar banner
  4. Ajay
    Ajay avatar
    66 posts
    Member since:
    May 2009

    Posted 30 Jul 2009 Link to this post

    hi shinu !

    I have put that code on to Page Load as well as on to the Grid Pre-Render event , but nothing working

    It just displays the following message :-

    "Both DataSource and DataSourceID are defined on 'ctl00'.  Remove one definition."

    I have the following code at the RadGrid :-

    <telerik:RadGrid ID="SearchResultsRadGrid" AllowSorting="true" runat="server" Width="98%" GridLines="Vertical"
                    SkinID="RadGridHeaderSkin" Style="margin: 10px  10px 10px 10px" OnPreRender="SearchResultsRadGrid_PreRender" OnItemDataBound="SearchResultsRadGrid_ItemDataBound"
                    DataSourceID="TherapeuticObjectDataSource" OnSelectedIndexChanged="SearchResultsRadGrid_SelectedIndexChanged">

    (That is, only DataSourceID  is provided.)

    Its not working .

    Please help !
  5. Amresh Kumar
    Amresh Kumar avatar
    3 posts
    Member since:
    Dec 2009

    Posted 05 Jan 2010 Link to this post

    Hi Ajay

    Whatever u have done is looks alright. I want to confirm one thing whether you are putting any validation before binding with grid.
    This will work only when Radgrid.datasource = datatable or dataset will execute.

    Before executing dont put any condition whether data is there or not in datatable or dataset.

    ShowHeadersWhenNoRecords = true

  6. atefe mohamadzade
    atefe mohamadzade avatar
    9 posts
    Member since:
    Mar 2010

    Posted 13 Jun 2010 Link to this post

    my datasource is null when i fire it grid dont show
    and i can't add new record
    i tried this skill but not answered
    please help me
Back to Top
DevCraft R3 2016 release webinar banner