28.05.2009, 12:05 | #1 |
Участник
|
Solutions Monkey: Custom Bound Fields in FieldGroup
Источник: http://blogs.msdn.com/solutions/arch...ieldgroup.aspx
============== You could make the AxBoundFieldGroup use the CustomBoundField (http://blogs.msdn.com/solutions/arch...nd-fields.aspx) instead of the regular bound field by hooking into the OnCreatingBoundField event (KB971547) of the AxBoundFieldFactory. For example create an assembly with the below code and put it in GAC. X++: public class AxSampleBoundFieldFactory { public void OnCreatingBoundField(object sender, CreatingBoundFieldEventArgs eventArgs) { if (eventArgs.Field.Name == "Date") eventArgs.BoundField = new AxSampleDateBoundField(); } } X++: private AxSampleBoundFieldFactory customBoundFieldFactory; protected override void OnInit(EventArgs e) { base.OnInit(e); // Subscribe to the bound field factory event this.customBoundFieldFactory = new AxSampleBoundFieldFactory(); AxBoundFieldFactory.Instance.CreatingBoundField += this.customBoundFieldFactory.OnCreatingBoundField; } protected override void OnUnload(EventArgs e) { // Unsubscribe to the bound field factory event AxBoundFieldFactory.Instance.CreatingBoundField -= this.customBoundFieldFactory.OnCreatingBoundField; base.OnUnload(e); } ============== Источник: http://blogs.msdn.com/solutions/arch...ieldgroup.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|