Home Forums WPF controls Xceed DataGrid for WPF Custom styles

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22542 |

    HI,

    1. We want to place the custom image in the selected rowSelectorPane when we click on menuitem. We are able to change the image statically through applying styles, but we want this to be done dynamically thru codebehind.

    2. Change the cell border color of the selected cell and also change the RowSelectorPane and Column Header background color.

    please see the image at the link below
    http://www.geocities.com/wpf007/xceed/pkey.JPG

    Imported from legacy forums. Posted by rajendernag (had 2343 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi, Rajendra

    Kindly find the below code for the dynamically adding styles:

    Style st = new Style(typeof(Xceed.Wpf.DataGrid.DataCell));

                st.Setters.Add(new Setter(HorizontalContentAlignmentProperty, HorizontalAlignment.Right));

                this.Resources[typeof(DataCell)] = st;

    I applied the horizontal alignment propery dynamically. Also we can add the DataTrigger & Style Trigger for the same.

    Kindly let me know if you want the DataTrigger to be also dynamic.

    Paras Sanghani

     

     

     

     

     

    Imported from legacy forums. Posted by paras (had 703 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.