Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 16, 2021 14:39
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/550b13132ccd30dbedb4266a651a7c6d to your computer and use it in GitHub Desktop.
Save bjoerntx/550b13132ccd30dbedb4266a651a7c6d to your computer and use it in GitHub Desktop.
// check if there is a SubTextPart at the
// current input position
if (textControl1.SubTextParts.GetItem() == null)
return;
// retrieve current SubTextPart
SubTextPart stpMergeBlock = textControl1.SubTextParts.GetItem();
// check if SubTextPart is a MergeBlock
if (TXTextControl.DocumentServer.DataSources.DataSourceManager.IsMergeBlock(
textControl1.SubTextParts.GetItem()) == true) {
// create a MergeBlockInfo object from SubTextPart
TXTextControl.DocumentServer.DataSources.MergeBlockInfo mbInfo =
new TXTextControl.DocumentServer.DataSources.MergeBlockInfo(stpMergeBlock);
// add a filter
mbInfo.Filters.Add(
new TXTextControl.DocumentServer.DataShaping.FilterInstruction(
"Price",
TXTextControl.DocumentServer.DataShaping.RelationalOperator.GreaterThan,
500));
mbInfo.SortingInstructions.Add(
new TXTextControl.DocumentServer.DataShaping.SortingInstruction(
"Price",
TXTextControl.DocumentServer.DataShaping.SortOrder.Ascending));
// important: apply the settings
mbInfo.Apply();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment