Change grid Color

6 posts, 0 answers
  1. Ashwitha
    Ashwitha avatar
    4 posts
    Member since:
    Sep 2014

    Posted 20 Sep 2014 Link to this post

    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.
  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 23 Sep 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ashwitha
    Ashwitha avatar
    4 posts
    Member since:
    Sep 2014

    Posted 23 Sep 2014 in reply to Dimitar Link to this post

    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 









  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 25 Sep 2014 Link to this post

    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.
     
  6. Sebastian
    Sebastian avatar
    4 posts
    Member since:
    Mar 2014

    Posted 22 Oct 2014 in reply to Dimitar Link to this post

    I have not found anywhere the way to change row's background color when mouse is over the row...
    Is there any way?
  7. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 24 Oct 2014 Link to this post

    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready