Posted 18 Jun 2018 Link to this post
I need to change the BackColor of the Tabs inside the PageViewElement of a Child row in a Gridview. I can access the PageViewElement itself, but how do I get to the Tabs' BackColor Property?
private void myDataTable_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
GridDetailViewCellElement detailCell = e.CellElement as GridDetailViewCellElement;
if (detailCell != null)
detailCell.Margin = new Padding(60, 0, 0, 0);
detailCell.Font = new Font(new FontFamily("Calibri"), 20.0f, FontStyle.Bold | FontStyle.Underline);
detailCell.ForeColor = Color.FromArgb(255, 102, 0);
detailCell.PageViewElement.DrawFill = true;
detailCell.PageViewElement.BackColor = Color.Red; //this sets the backcolor of the PageViewElement
}
Posted 19 Jun 2018 Link to this post
private
void
RadGridView1_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
GridDetailViewCellElement detailCell = e.CellElement
as
GridDetailViewCellElement;
if
(detailCell !=
null
)
detailCell.Margin =
new
Padding(60, 0, 0, 0);
detailCell.Font =
Font(
FontFamily(
"Calibri"
), 20.0f, FontStyle.Bold | FontStyle.Underline);
detailCell.PageViewElement.DrawFill =
true
;
foreach
(var item
in
detailCell.PageViewElement.Items)
item.BackColor = Color.Red;
item.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
item.DrawFill =
Hi Dimitar.
That's works.Thanks buddy.
Now I have another question. How do I set the ItemFitMode for these tabs? VisualStudio2012Dark theme I am applying just washes out all the borders and colors. Now that I can set the back color, and If I can set the ItemFitMode to StripViewItemFitMode.Fill and adjust Borders to make the tabs visible, Ill be happy and stop bugging you guys.
MG
Posted 19 Jun 2018 in reply to Manoj Link to this post
ok, got the Border figured out.
Now only need the StripViewFitMode
item.Size =
System.Drawing.Size(500, item.Size.Height);
item.BackColor = Color.FromArgb(64,64,64);
item.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
item.BorderColor = Color.FromArgb(255, 102, 0);
item.BorderGradientStyle= Telerik.WinControls.GradientStyles.Solid;
item.BorderWidth = 3;
item.DrawBorder =
Posted 20 Jun 2018 Link to this post
var stripElement = detailCell.PageViewElement
RadPageViewStripElement;
stripElement.ItemFitMode = StripViewItemFitMode.Fill;