Using only procedual code, how can you place an image in the column header. Here is some sample code that I am working with and I would like to place the image in the first column header.
myWP.Children.Add(xdgBookTable);
void
{
// Create a style for the label presenter
Style lbStyle = new Style(typeof(LabelPresenter));
// Create a factory for an image element
FrameworkElementFactory fefImage = new FrameworkElementFactory(typeof(Image));
BitmapImage imageSource = new BitmapImage(new Uri("pack://application:,,,/images/32X32.png"));
fefImage.SetValue(Image.SourceProperty, imageSource);
// Set the image as the root element of the visual tree,
// Note: you may want to add a tree of elements to provide some chrome around the image
ControlTemplate template = new ControlTemplate(typeof(LabelPresenter));
template.VisualTree = fefImage;
lbStyle.Setters.Add(new Setter(Control.TemplateProperty, template));
// Set the labelprsenter style for the field you are looking for
e.FieldLayout.Fields["Status"].Settings.LabelPresenterStyle = lbStyle;
}
<cingerson> wrote in message news:12374@forums.infragistics.com... Using only procedual code, how can you place an image in the column header. Here is some sample code that I am working with and I would like to place the image in the first column header.XamDataGrid xdgBookTable = new XamDataGrid();WrapPanel myWP = new WrapPanel(); DataSet ds = new DataSet(); DataTable dt = ds.Tables.Add("Books"); dt.Columns.Add("" , typeof(CheckBox)); dt.Columns.Add("Book Name", typeof(string)); CheckBox cb = new CheckBox();String bookName = âTimelineâ; dt.Rows.Add(new object[ { cb, bookName}); xdgBookTable.DataSource = ds.Tables[0].DefaultView; myWP.Children.Add(xdgBookTable); Thanks for any help. http://forums.infragistics.com/forums/p/1470/12374.aspx#12374