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

Grid Back color

7 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 13 Mar 2018, 12:08 PM

How can I define the grid back color - the area in White in the attached screen shot of my test application ?

Is it possible to set it as transparent - to display the backgrond image of the hosting form 

Thanks in advance

7 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Mar 2018, 12:39 PM
Hello, Pierre-Jean,

Thank you for writing.  

According to the provided screenshot it seems that you increase the TableElement.RowSpacing. You can assign an image to the TableElement.BackgroundImage property. Thus, it will be visible in the space between the rows:
  
public RadForm1()
{
    InitializeComponent();
 
    this.radGridView1.TableElement.RowSpacing = 20;
    this.radGridView1.CellFormatting+=radGridView1_CellFormatting;
    this.radGridView1.TableElement.BackgroundImage = Properties.Resources.Nice;
    this.radGridView1.TableElement.BackgroundImageLayout = ImageLayout.Zoom;
}
 
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    e.CellElement.DrawFill = true;
    e.CellElement.BackColor = Color.Yellow;
    e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}



I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 13 Mar 2018, 01:57 PM

Thanks for your message.

It's not quite what I am looking for, I would like the row space to be transparent in order to see the image that is loaded as background of the form on which the grid is loaded, and not load the image on the grid itself.

If I set a color to the radgrid tablelement (radgrid.tableElement.backcolor = color.red for instance), the space takes that color

However if I set the tableElementbackcolor = color.transparent the space is not transparent and it becomes grey (probably "Control" color)

in the attached screenshots I have at the left a screen copy with a fixed color and at the right a "transparent" color, whis is not transparent but shows a "grey"

May be it is not possible to set this element transparent ...

Thanks

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Mar 2018, 09:40 AM
Hello, Pierre-Jean,      

Thank you for writing back. 

In order to see the image applied to the form as BackgroundImage it is necessary to make the BackColor transparent not only for the TableElement, but also for the RadGridView.RootElement:
this.BackgroundImage = Properties.Resources.Nice;
this.radGridView1.TableElement.BackColor = Color.Transparent;
this.radGridView1.RootElement.BackColor = Color.Transparent;

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 15 Mar 2018, 10:08 AM

Top

thanks a lot for your Support

Have a good day

Regards

PJ Pralong

0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 15 Mar 2018, 12:45 PM

One last question (if I may)

How do Ii remove the grid border that remains after the backcolor is set to transparent ?

I have tried tableelement.drawborder = false but it does no do the work ..

Thanks

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Mar 2018, 01:34 PM
Hello, Pierre-Jean, 

Thank you for writing.  
 
In order to remove the border around the grid, you can set the RadGridView.GridViewElement.DrawBorder property to false
this.radGridView1.GridViewElement.DrawBorder = false;
  
I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 15 Mar 2018, 02:42 PM

Thanks a lot

Now I have everything as I wish

Best Regards

Tags
GridView
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or