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

Change grid Color

5 Answers 377 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ashwitha
Top achievements
Rank 1
Ashwitha asked on 20 Sep 2014, 03:01 PM
I want to change backcolour of the radgrid while printing the panel which contains this particular grid.
On click of print button , the grid backcolour should be none in the page being printed.

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 23 Sep 2014, 12:49 PM
Hello Ashwitha,

Thank you for writing.

To change the color of the panel, you should set the following property:
radGridView1.TableElement.BackColor = Color.Transparent;

Once printed, you can restore the color.

If you need to change other colors you should use the formatting events: 

Other useful articles can be found in the printing support section of RadGridView: http://www.telerik.com/help/winforms/gridview-printing-support-events.html.

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Ashwitha
Top achievements
Rank 1
answered on 24 Sep 2014, 03:52 AM
function PrintPanel() {

                        var panel = document.getElementById("<%=ResponeData.ClientID %>");
                
                var printWindow = window.open('', '', 'height=400,width=800');
                printWindow.document.write('<html><head><title>DIV Contents</title>');
                printWindow.document.write('</head><body >');

                printWindow.document.write(panel.innerHTML);
               
                printWindow.document.write('</body></html>');
                printWindow.document.close();
                setTimeout(function () {
                   
                printWindow.print();
                }, 500);
                return false;
            }
 Hey,
Thanks for replying.But the solution dint work for me. I have copied the code snippet. ResponeData is a pannel which contains radgrid. I need to change the Backcolor of the radgrid 









0
Dimitar
Telerik team
answered on 25 Sep 2014, 08:41 AM
Hello Ashwitha,

Thank you for writing back.

I am not sure which color exactly you want to change. Perhaps you can include a snapshot and point it.  

In addition I wanted to ask you if you are using the WinForms suite (as this is the WinForms forum)? I am asking you this since your sample code contains some html but you have not mentioned other product after I have pointed you to some documentation articles for the Winforms RadGridView. If you are using UI for ASP.NET, please consider addressing your question in the appropriate forum: http://www.telerik.com/forums/aspnet-ajax

I am looking forward to your reply.
 
Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Sebastian
Top achievements
Rank 1
answered on 22 Oct 2014, 07:08 AM
I have not found anywhere the way to change row's background color when mouse is over the row...
Is there any way?
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Oct 2014, 03:45 PM
Hello Sebastian,

Thank you for writing.

The easiest way to customize the row back color when hovering is to modify the theme. Please refer to the attached pictures demonstrating where to specify the hot tracking color. Thus, if the RadGridView.EnableHotTracking property is set to true, the rows/cells should be colored according to your customization. Additionally, you can use the CellFormatting and the RowFormatting events.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Ashwitha
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ashwitha
Top achievements
Rank 1
Sebastian
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or