MINIMIZING THE RAD GRID TODISPLAY AS AN(LOOK LIKE) HORIZONTAL RULER WHEN IT CONTAINS NO DATA

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

    Posted 16 Jun 2009 Link to this post

    Hi folks !

    Im using the RAD GRID from ASP.NET AJAX UI Controls.

    Iam using the GRAY SKIN for the above mentioned GRID.

    Actually, I want to display my Rad Grid show like an HORIZONTAL RULER when it containd no data. (i.e. RAD GRID should not display the COULMN HEADERS even if contains no data.)

    I dont know you guys are getting me or not. ?

    Guys,

    I hope you are getting me,

    Let me give you an another exapmle :-

    I have an ASPX Page that display the RAD GRID(with GRAY SKIN) , this RAD GRID is connected to the OBJECT DATASOURCE. At the first instanace , RAD GRID contains two or three columns (i.e. COLUMN HEADERS).
     
    Now here my problem comes , I want these RAD GRID COLUMN HEADERS not to be visible until or unless I hit the SHOW GRID/ANY BUTTON to show the RAD GRID at its fullest with data being displayed.

    Or in the simpler words , I want to have my grid look like the HORIZONTAL RULER when it do not have any records to display.
     
    If you guys want me to give you  an screen shot, I will surely provide it to you.

    Please provide me the much needed help as you giys have done it before .

    Thanks & Regards

    Ajay 


  2. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 17 Jun 2009 Link to this post

    Hello Ajay,

    Try the following approach: In your RadGrid's PreRender event, check if your master table contains any data items. If none, hide your header and set your RadGrid's border style to none. If you place a single <hr /> element in your MasterTableView's NoRecordsTemplate, effectively, you will get only the horizontal ruler display when no records are present:

    <NoRecordsTemplate> 
        <hr /> 
    </NoRecordsTemplate> 

    void RadGrid1_PreRender(object sender, EventArgs e) 
        if (RadGrid1.MasterTableView.Items.Count == 0) 
        { 
            RadGrid1.ShowHeader = false
            RadGrid1.BorderStyle = BorderStyle.None; 
        }         

    Check this out.

    Kind regards,
    Veli
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top