本文整理汇总了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);
}
}
}