private void SetGridView() { GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName); ObservableList <GridColView> viewCols = new ObservableList <GridColView>(); view.GridColsView = viewCols; viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.AttachmentType, WidthWeight = 100, BindingMode = BindingMode.OneTime }); viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.Name, WidthWeight = 200 }); viewCols.Add(new GridColView() { Field = "...", Header = "...", WidthWeight = 20, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.GridAttachment.Resources["ParamValueExpressionButton"] }); viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.ExtraInformation, WidthWeight = 250 }); viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.ZipIt, WidthWeight = 50, Header = "Zip It", HorizontalAlignment = System.Windows.HorizontalAlignment.Center, StyleType = GridColView.eGridColStyleType.Template, CellTemplate = (DataTemplate)this.GridAttachment.Resources["ReportAttachment"] }); AttachmentsGrid.SetAllColumnsDefaultView(view); AttachmentsGrid.InitViewItems(); }
private void SetGridView() { GridViewDef view = new GridViewDef(GridViewDef.DefaultViewName); ObservableList <GridColView> viewCols = new ObservableList <GridColView>(); view.GridColsView = viewCols; viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.AttachmentType, WidthWeight = 50, BindingMode = BindingMode.OneTime }); viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.Name, WidthWeight = 300 }); viewCols.Add(new GridColView() { Field = EmailAttachment.Fields.ZipIt, WidthWeight = 50, StyleType = GridColView.eGridColStyleType.CheckBox }); AttachmentsGrid.SetAllColumnsDefaultView(view); AttachmentsGrid.InitViewItems(); }