This is a migrated thread and some comments may be shown as answers.

Duplicate data in DocumentMapText

1 Answer 12 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dondon
Top achievements
Rank 1
Dondon asked on 27 Nov 2017, 04:29 AM

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,

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 29 Nov 2017, 04:47 PM
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
Tags
General Discussions
Asked by
Dondon
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or