c# - WPF How to make the background of DataGridComboBoxColumn to be the same as DataGridTextBoxColumn -


I have a DataGrid ComboX column in DataGrid. Cambodia is applied in this form to show Cambodia like blanket-box all the time (click or not)

xmlns: dg = "http://schemas.microsoft.com/ Wpf / 2008 / toolkit "

  & lt; Dg: DataGridTemplateColumn header = "time unit" x: name = "timeUnit" & gt; & Lt; DG: DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Combobox selected value = "{binding relataram.time usenet}" background = "white" borderbrows = "{x: faucet}" itemsource = "{binding time unit list}" & gt; & Lt; / ComboBox & gt; & Lt; / DataTemplate & gt; & Lt; / DG: DataGridTemplateColumn.CellTemplate & gt; & Lt; / DG: DataGridTemplateColumn & gt;   

Now the issue is that there is an alternative background in Datagrams. I want CombBlocks in the DataGrid to use the same background as the text box column in DataGrido. Whenever datagrams are selected, the combo box should be highlighted in the same color, because how to complete the remaining line? Thanks

  & lt; Style x: key = "DataGridCellStyle" TargetType = "{x: Type DG: DataGrid Sale}" & gt; & Lt; Setter Property = "Reference Menu" Value = "{DynamicResource cellContextMenu}" /> & Lt; / Style & gt; & Lt; Style x: Key = "DataGridRowStyle" TargetType = "{x: Type DG: DataGridRO}" & gt; & Lt; Style.Triggers & gt; & Lt; Trigger Property = "Alternative Index" value = "1" & gt; & Lt; Setter property = "background" value = "beige" /> & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; Setter property = "margin" value = "0 2 0 2" /> & Lt; / Style & gt; & Lt; Style x: Key = "DataGridStyle" TargetType = "{x: Type DG: DataGrid}" & gt; & Lt; Setter Property = "Optional" value = "2" /> & Lt; Setter property = "row style" value = "{static resource datagrid RO style}" /> & Lt; Setter property = "cell style" value = "{static resource datagrid seleastile}" /> & Lt; / Style & gt;    

You set the Background setting to Combobox your dataTemplate to transparent .

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -