Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active January 14, 2020 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/4bb334f38a4205f6cb2d2092df1f8037 to your computer and use it in GitHub Desktop.
Save bjoerntx/4bb334f38a4205f6cb2d2092df1f8037 to your computer and use it in GitHub Desktop.
private void MaskDataColumnNames(dynamic data)
{
// flatten data object in case of an array
if (data.GetType() == typeof(JArray))
data = data[0];
// find merge fields ribbon menu button
RibbonMenuButton ctlInsertMergeFields =
ribbonReportingTab1.FindItem(
RibbonReportingTab.RibbonItem.TXITEM_InsertMergeField)
as RibbonMenuButton;
// get the selected master table info
DataTableInfo dataTableInfo =
ribbonReportingTab1.DataSourceManager.MasterDataTableInfo;
// select token in data object
if (dataTableInfo.TableName != "RootTable")
{
data = data.SelectToken("$.." + dataTableInfo.TableName);
}
// change the strings
ApplyMaskedString(ctlInsertMergeFields.DropDownItems, data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment