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

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

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 2
Ajay asked on 16 Jun 2009, 08:31 AM
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 


1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 17 Jun 2009, 02:11 PM
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.
Tags
Grid
Asked by
Ajay
Top achievements
Rank 2
Answers by
Veli
Telerik team
Share this question
or