Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have overrides datagrid. Below are my code and xaml. how can i set style to change the datagridcell background colour when the cell is selected?
C#
public class DataGridExt : DataGrid
    {
        public DataGridExt()
        { this.AutoGeneratedColumns += new EventHandler(DataGrid_AutoGeneratedColumns);
        }
    }

HTML
<vw:DataGridExt Grid.Row="1" Background="White" AutoGenerateColumns="True" IsReadOnly="True"
    ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value,  Mode=OneWay, IsAsync=True}"
    AlternatingRowBackground="LightGray"CanUserResizeRows="False" ClipboardCopyMode="IncludeHeader"
    CanUserSortColumns="True" CanUserAddRows="False" SelectionMode="Extended" />
Posted
Updated 14-Jul-13 6:07am
v3
Comments
[no name] 14-Jul-13 10:26am    
http://stackoverflow.com/questions/14785038/how-do-you-change-wpf-datagrid-cell-background-while-editing-the-cell
Tina Ng 14-Jul-13 11:02am    
for original datagrid the solution work but not for the overrides datagrid
[no name] 14-Jul-13 12:25pm    
Well you would probably have to explain what you think an "overrides datagrid" is, as that makes no sense at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900