Duplicate data in DocumentMapText

2 posts, 0 answers
  1. Dondon
    Dondon avatar
    7 posts
    Member since:
    Aug 2017

    Posted 26 Nov Link to this post

    Hi,

    Im having trouble displaying the data to the documentmaptext. The code below is working which I programmatically add bookmark during the event of ItemDataBound event or even in the ItemDataBinding.

    This is the code below :

    private void detailTextBox_ItemDataBound(object sender, EventArgs e)
    {
    Telerik.Reporting.Processing.TextBox currentloadeddatainTextBox = (Telerik.Reporting.Processing.TextBox)sender;
    Telerik.Reporting.Processing.IDataObject idataObject;
    idataObject = currentloadeddatainTextBox.DataObject;
    System.Data.DataRowView datarowView = (System.Data.DataRowView)idataObject.RawData;
    System.Data.DataRow dataRow = datarowView.Row;
    string PageGroupDetails = dataRow.ItemArray.GetValue(0).ToString();
    string PageRow = dataRow.ItemArray.GetValue(2).ToString();
    if (PageGroupDetails.Contains("[BKMARK]"))
    {
    if (bookmarkList.Count == 0)
    {
    bookmarkList.Add(new BookMarkList { BookMarkID = PageGroupDetails.Replace("[BKMARK]", "").Trim() });
    detailTextBox.BookmarkId = PageGroupDetails.Replace("[BKMARK]", "").Trim();
    detailTextBox.DocumentMapText = PageGroupDetails.Replace("[BKMARK]", "").Trim();
    }
    else
    {
    if (!bookmarkList.Exists(bookmarkList => bookmarkList.BookMarkID.Equals(PageGroupDetails.Replace("[BKMARK]", "").Trim())))
    {
    bookmarkList.Add(new BookMarkList { BookMarkID = PageGroupDetails.Replace("[BKMARK]", "").Trim() });
    detailTextBox.BookmarkId = PageGroupDetails.Replace("[BKMARK]", "").Trim();
    detailTextBox.DocumentMapText = PageGroupDetails.Replace("[BKMARK]", "").Trim();
    }
    }
    currentloadeddatainTextBox.Style.Font.Bold = true;
    }
    }

    public class BookMarkList
    {
    public string BookMarkID { get; set; }
    }

     

    The code is tied in the textbox control. I load all data into these textbox. Once loaded, the event itemdatabound will be triggered. In these event, I added condition that it will only add bookmark that it not yet added and also to check if the specific data has the "[BKMARK]" string which means that these part will be bookmarked.

    Able to run the code but, somehow it doesn't display the correct documentmaptext properly, it shows duplicate data. tried debugging but I was only adding unique bookmark id and no duplicates.

    Please I need your assistance on this.

     

    Thanks,

  2. Katia
    Admin
    Katia avatar
    615 posts

    Posted 29 Nov Link to this post

    Hello Dondon,

    As of R3 2016 release, modifying definitions of report items in events is not supported - Changes on items in report events are not applied. Instead of accessing the TextBox item as a private property of the report (detailTextBox.BookmarkId) the correct approach would be to access the processing TextBox instance:
    Telerik.Reporting.Processing.TextBox currentloadeddatainTextBox = (Telerik.Reporting.Processing.TextBox)sender;
    currentloadeddatainTextBox.BookmarkId = PageGroupDetails.Replace("[BKMARK]", "").Trim();

    If the above suggestions do not help it would be best if you send us a sample project that reproduces the issue in a support ticket so we can test it locally.


    Regards,
    Katia
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top