回复 1楼progame的帖子
实现思路如下,在LayoutChanging中记录下新添加的控件和位置,在LayoutChanged中修改控件属性:
- string controlname = "";
- string sectionname = "";
- private void reportdesigner_LayoutChanging(object sender, LayoutChangingArgs e)
- {
- if (e.Type == LayoutChangeType.ControlAdd)
- {
- GrapeCity.ActiveReports.SectionReportModel.TextBox text = e.NewValue as GrapeCity.ActiveReports.SectionReportModel.TextBox;
- controlname = text.Name;
- sectionname = e.NewSectionName;
- }
- }
- private void reportdesigner_LayoutChanged(object sender, LayoutChangedArgs e)
- {
- if (e.Type == LayoutChangeType.ControlAdd)
- {
- ((reportdesigner.Report as GrapeCity.ActiveReports.SectionReport).Sections[sectionname].Controls[controlname] as GrapeCity.ActiveReports.SectionReportModel.TextBox).Text = "AAAA";
- }
- }
复制代码 |