当前位置: 首页>>代码示例>>C#>>正文


C# XtraReport.GetCurrentColumnValue方法代码示例

本文整理汇总了C#中XtraReport.GetCurrentColumnValue方法的典型用法代码示例。如果您正苦于以下问题:C# XtraReport.GetCurrentColumnValue方法的具体用法?C# XtraReport.GetCurrentColumnValue怎么用?C# XtraReport.GetCurrentColumnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XtraReport的用法示例。


在下文中一共展示了XtraReport.GetCurrentColumnValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MakeCellsRightToLeft

        /// <summary>
        /// Fixes RTL alignment direction for the given cells in the given report
        /// </summary>
        /// <param name="report">The report to fix its RTL direction alignment</param>
        /// <param name="cells">Cells to intercept their Text proeprty for a possible RTL fix</param>
        private static void MakeCellsRightToLeft(XtraReport report, IEnumerable<XRLabel> cells)
        {
            foreach (var cell in cells)
            {
                // Searching for cells that have a binding on their Text property
                var binding = cell.DataBindings.FirstOrDefault(x => x.PropertyName == "Text");

                if (binding != null)
                {
                    // In order to be able to unregister from the event we have to have
                    // a reference to the handler
                    PrintEventHandler beforePrintDelegate = null;

                    beforePrintDelegate = (_s, _e) =>
                    {
                        var value = report.GetCurrentColumnValue(binding.DataMember);

                        if (report.Parameters.Cast<Parameter>().Any(x => x.Name == binding.DataMember))
                        {
                            // a parameter is bound to this control
                            cell.Text = FixRTL(cell.Text);
                        }
                        else
                        {
                            // Examine the data type of the obtained value if it's not string
                            // we unregister from the BeforePrint event not to get future notifications
                            if (value is string)
                            {
                                // Adds a Right-To-Left MARK (U+200F) to the end of the string
                                (_s as XRLabel).Text = FixRTL(value.ToString());
                            }
                            else
                            {
                                // Unregisters from the BeforePrint
                                cell.BeforePrint -= beforePrintDelegate;
                            }
                        }
                    };

                    // Registering to the BeforePrint event to intercept the string values
                    cell.BeforePrint += beforePrintDelegate;
                }
                else
                {
                    // If the cell has no binding to any source so just add RLM character
                    // to the end of its Text property
                    cell.Text = FixRTL(cell.Text);
                }
            }
        }
开发者ID:RDF-Co,项目名称:RDF.Reports.DevX.15.1,代码行数:55,代码来源:XtraReportRTLTextFixer.cs


注:本文中的XtraReport.GetCurrentColumnValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。