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,