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
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
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
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
Top
thanks a lot for your Support
Have a good day
Regards
PJ Pralong
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
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
Thanks a lot
Now I have everything as I wish
Best Regards