3 Answers, 1 is accepted
Hello, Zygmunt,
In order to increase the border's width of the cells in the grid it is suitable to use the CellFormatting event and set the BorderBottomWidth property:
private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridDataCellElement)
{
e.CellElement.BorderBottomWidth = 5;
}
else
{
e.CellElement.ResetValue(LightVisualElement.BorderBottomWidthProperty, ValueResetFlags.Local);
}
}
I hope this helps. Let me know if you have other questions.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Presented solution has for my at least two problems .
First is that border is not setting in GridViewRowHeaderColumn what is shown in problem1.png image.
Second issue is presended in problem2.png image. When the cell is in edit mode it grows and cover the cell border.
Hello, Zygmunt,
Note, the look of our controls is defined through themes. When using the formatting events you are able to modify some properties of the visual cells, however, if you need to define a new custom look in your grid you should consider creating a custom theme that would fit your requirements.
If you want to set the same border width to the GridViewRowHeaderColumn you can use the following code snippet in the ViewCellFormatting event:
private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridRowHeaderCellElement || e.CellElement is GridDataCellElement)
{
e.CellElement.BorderBottomWidth = 10;
}
else
{
e.CellElement.ResetValue(LightVisualElement.BorderBottomWidthProperty, ValueResetFlags.Local);
}
}
According to your second question, if you need to modify the look of the cell/row when it is selected or in edit mode, you should modify the theme that you use in the Visual Style Builder tool. More information about working with VSB is available here:
https://docs.telerik.com/devtools/winforms/knowledge-base/customize-a-theme
https://docs.telerik.com/devtools/winforms/tools/visual-style-builder/working-with-visual-style-builder/working-with-repository-items
I hope this information helps. Let me know if I can assist you further.
Regards,
Nadya
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.