![]() The control template sets the default selection highlight color to the system resource TextSelectionHighlightColorThemeBrush. The practical default is a brush using the theme resource TextSelectionHighlightThemeColor. The brush used to highlight the selected text. lectionHighlightColor = solidColorBrush Public Property SelectionHighlightColor As SolidColorBrush Property SolidColorBrush ^ SelectionHighlightColor var solidColorBrush = lectionHighlightColor The condition is, if the value in the 2nd column is out-of-stock, then it will change the background color of the cell or cells.Gets or sets the brush used to highlight the selected text.Įquivalent WinUI property: Microsoft.UI. In the first example, I’ll show you how to change the background color of a cell or multiple cells based on a condition. ![]() Onrowdatabound="GridView_RowDataBound" 1)Ĝhange Cell Background Color based on Condition Note: If you are a C# developer, you’ll have to add onrowdatabound property to the GridView at design time. I’ll have to write the color changing code inside GridViews RowDataBound event. ("Sony", "Out of Stock", "0")Īfter I have created the GridView and added few rows and columns to it, I’ll now write the procedures to change colors to the Cell. TColumn = New Data.DataColumn("Quantity", ("System.String")) TColumn = New Data.DataColumn("Stock", ("System.String")) TColumn = New Data.DataColumn("Product", ("System.String")) ' NOW BIND THE GRIDVIEW WITH THE DATATABLE.ĭim tColumn As Data.DataColumn ' TABLE COLUMNS. Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load TColumn = new ("Quantity", ("System.String")) TColumn = new ("Stock", ("System.String")) TColumn = new ("Product", ("System.String")) NOW BIND THE GRIDVIEW WITH THE DATATABLE. ![]() ![]() Protected void Page_Load(object sender, EventArgs e) Public partial class SiteMaster : .MasterPage ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |