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

Manipulate existing textbox value

1 Answer 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Per
Top achievements
Rank 1
Per asked on 22 Oct 2013, 09:08 AM
Hi,

I have a report containing several textboxes in my header section all bound to a sqldatasource.

In of them I need to modify the value from a delimited string (item1;item2;item3 ...) to a string with newlines at each ;
item1
item2
item3

My textbox is bound to Fields.MyDataField

I have added an event handler

private void textBox4_ItemDataBinding(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.TextBox txt = (Telerik.Reporting.Processing.TextBox)sender;
    Telerik.Reporting.Processing.IDataObject dataObject = (Telerik.Reporting.Processing.IDataObject)txt.DataObject;
 
    _myDataMember = (string)dataObject["MyDataField"];
    if (_myDataMember != null)
        StringToList();
    //Here I need to rebind textbox to the modified string
 
}

In debug mode I can see all my data field values in the dataObject EXCEPT from the one I need to modify??? This one is null. BUT if I let the report render I can see the values fine.

Apart from this strange behavior, assuming the data is there, how do I rebind my textbox showing my modified string?

Thanks,
Per

1 Answer, 1 is accepted

Sort by
0
Per
Top achievements
Rank 1
answered on 22 Oct 2013, 09:20 AM
I managed to solve it.

MyDataField was pointing to the wrong field.

I did rebind my textbox simply by adding this code

txt.Value = _myDataMember;
Tags
General Discussions
Asked by
Per
Top achievements
Rank 1
Answers by
Per
Top achievements
Rank 1
Share this question
or