My DGV has a BackColors line set to various colors based on business logic. When the user selects a row, the color changes to the selected BackColor row, thereby closing the preset color. I would like to keep the original color when selecting a line and indicate the selection with a (possibly) bold border around the selected line. Is it possible? Is there an easy alternative I'm missing out on?
EDIT To be clear, this is a WinForms application.
- . , .
, , ,
Dim backColor as Color = Color.Yellow row.DefaultCellStyle.BackColor = backColor row.DefaultCellStyle.SelectionBackColor = Color.FromArgb(backColor.R * 3 / 4, backColor.G * 3 / 4, backColor.B * 3 / 4)
< 1 , , , .
DataGridView , , DataGridView. , DataGridView , .. , , - .
, , , , , . , .
. , datagridview, Microsoft, , .
:
MSDN DataGridView
DataGridView
, , , , , .
, , , .
, googling "datagridview custom behavior".
, Windows Form, -, ?
<SelectedRowStyle CssClass="MyCssClass" />
where you have to create a CSS class to define a table row with your desired border style. Or you can use the inline border style with
<SelectedRowStyle BorderStyle="Solid" BorderWidth="1" BorderColor="Black" />
Source: https://habr.com/ru/post/1710476/More articles:HTTPS connection in iphone - iphoneПроблемы с ColumnSeries из Silverlight Charting Toolkit - chartshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1710473/rss-feed-created-using-zendfeed-firefox-prompts-to-download-not-display-as-rss&usg=ALkJrhiImJCT-J-5-DNdLrxpoo6TPKS3OgPass array pointer to Haskell for function C - cСериализация XML: System.InvalidOperationException: не ожидалось - c#Text fields not selectable in ExtJs grid - extjsPowerful tools for creating SQL queries - sqlSeparate ASP.NET Session IDs for http and https - httpadding a control to tabs generated dynamically in tabcontrol in C # .net - c #Diff RegisterClientScriptBlock & RegisterStartupScript & responce.write ("script") - javascriptAll Articles