Hi.
Is it possible to hide the "Add new row" row from the grid in Visual Style Builder? Or turn on/off other properties as well or hide some columns? It's distracting to see all possible columns when you want to see the clean, basic version of the grid.
For example, this is the applied theme in the app (header and filter row):
and this in the VSB:
And particularly, for example, right now I'm trying to figure out how to increase the space/border/thin line (or change color) between the header and filter row. I can see it's white and about 1px in the app but no matter which "border" setting I change I can't seem to affect the final result.
Jure
1 Answer, 1 is accepted
The AllowAddNewRow property controls whether the grid will show the new row:
https://docs.telerik.com/devtools/winforms/controls/gridview/rows/new-row
In Visual Style Builder you may access the RadGridView's properties by using the RadControlSpy tool like this:
Thus, you can disable the EnableFiltering property or any other property that controls the visibility of the system rows.
As to the question about the thin border, I am not sure which border exactly you need to customize. Could you please provide a screenshot with the marked zone you need to customize? Thus, we would get better understanding of the precise case and provide further assistance. Thank you in advance.
I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Principal
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.
Thanks, that was helpful.
I'm referring to this line:
Thank you for the provided screenshot. I am not sure whether this is a custom theme or some of the default themes, but the white line is expected to be a style defined for the header row element. This is how the Fluent theme is styled:
OK, thank you. I'd prefer if I could set the bottom margin (which doesn't seem to have any effect) because the border "eats" into the element - here I set the width to 23 to be more obvious:
Is it possible?
Also, is there a difference when I apply the change via Control Spy vs. if I select the element from the control tree on the left?
Jure, the spy tool allows you to have a quick preview of any style changes. If you want to customize the theme, it is necessary to apply the settings in Visual Style Builder by selecting the desired element on the left tree structure. It is possible to apply bottom Padding to the header cell element:
Dess, the border is fine for now. But here's another mystery: GridDataRowElement.HotTracking. I just want to change the text color. I've copied the MarkerForeColor repository item to MarkerForeColor2 and changed it to white, yet the text remains black when I go over a row. I'm using my own custom theme but here's a screenshot of modifying the original Fluent theme:
Jure, the ForeColor is usually defined at cell level. Since it may be very tricky to achieve it in VisualStyleBuilder, I would suggest you a better solution with just a few lines of code.
The attached gif file illustrates the result:
Private Sub RadGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting
e.CellElement.SetThemeValueOverride(LightVisualElement.ForeColorProperty, Color.Red, "HotTracking")
End Sub