c# - Remove the default style of selected row -
I know that the question was asking a lot, but I've only seen Aksamel code file.
I'm working on a Datagrid extension, so I'm in C # code file and let me know how to remove the default style for the selected row (in my case I want to change nothing in style , I have an image
side question, what we have pressed "Ctrl" such a selection is and how C # code?
Thank you
< P> EditI try this code:
< code> style oRow = new style (Taipf (Detagreedaro)); Detatrigr Otrigr 2 = new Detatrigr (); binding Obind = new Binding (); OBindkRelativeSource = new relative resource (Riletivssorsmodkfndanstor, Taipf (Datagreedaro), 1) ; OBind.Path = new Proprteepath (Detagreedrokaissclitproprti); Otrigr 2. binding = Obnd; OTrigger2.Value = true; OTrigger2kSetterskAdd (new setter (Detagreedarokbakgriproprti, Brskkhaki)); ORowkTriggerskAdd (OTrigger2); This.RowStyle = oRow;For now, I tried to keep the selected background in Khaki for testing. But I get old blue highlights.
2 Edit
base on the idea of Sinatr, I change the Detagrid Rao to Detagrid cell and ended up with:
style oRow = new style (typewrite (DataGridsel)); Datatrigger ostrigers 2 = new data triggers (); Binding Obid = new binding (); OBind.RelativeSource = New Relative Resource (RelativeSourceMode.FundAnstore, TypeGridRO, 1); OBind.Path = New Property Path (DataGridro.isSecurealtyProperty); Ootrigger 2 Binding = oblong; OTrigger2.Value = True; OTrigger2.Setters.Add (new setter (DataGridcel background background, empty)); OTrigger2.Setters.Add (new setter (DataGridCell.BorderBrushProperty, blank); ORow.Triggers.Add (oTrigger2); This.RowStyle = oRow;
I have to get the foreground of the line only to set the foreground of the cell. But I found a new question with that solution, it is okay to fix the background to clear or should I pair it in the background of the line?
You have to change the CellStyle
control template.
For example, this stupid templateing
& lt; DataGrid x: name = "DataGrid" & gt; & Lt; DataGrid.CellStyle & gt; & Lt; Style TargetType = "DataGridCell" & gt; & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "DataGridCell" & gt; & Lt; Text block text = "1" background = "khaki" foreground = "red" /> & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; /DataGrid.CellStyle> & Lt; / Data grid & gt;
This will output the output (only 1 toggle> string, string, string> gt;
, whatever):
It remains the same for selected or selected items.
Obviously you implement it properly, but when you answer, you should give an idea.
The 7 Best Casinos in San Francisco - Mapyro
ReplyDeleteCasinos 여주 출장샵 in 나주 출장안마 San Francisco area (mapyro). Best Casinos and 성남 출장안마 Slots Reviews. 양주 출장마사지 The 원주 출장샵 only place to visit for a trip to San Francisco is the Bayview. The Casino