Hello,
I had one query for you. I need to add the style, style triggers and Data Triggers dynamically and depending upon the database fields i needs to set the alignment in the grid not in xaml using the Data Triggers but using the style dynamically upon the datatype of the field.
I tried using the styles dynamically but it didnt work. So can you please answer me whether xceed datarow/datacell supports the dynamically adding the styles.
I am getting the desired output but for some DataCell i want the Alignment as Left which i may get using the Data Trigger but i am making the UserControl so i want to set it dynamically how could i get the desired output?
I tried using the code in .cs as below in the Constructor:
Style st = new Style(typeof(Xceed.Wpf.DataGrid.DataCell));
st.Setters.Add(new Setter(HorizontalAlignmentProperty, "Right"));
gd.Resources.Add("StyleForDataCell", st);
The above code is not working.
Kindly me send your inputs for the same.
Thank You,
Paras Sanghani
Nothing Is Impossible