0

I have a RadTextBox and I need my back-end to know the Text of it. However, I get an error when trying to access it from anywhere within my backend:

txtnote does not exist in the current context.

 <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes"> <ItemTemplate> <telerik:RadTextBox ID="txtnote" InputType="Text" Width="100%" Rows="4" runat="server" Text='<%# Eval("notes")%>' TextMode="MultiLine"></telerik:RadTextBox> </ItemTemplate> </telerik:GridTemplateColumn> 

Does anyone have any suggestions on how I can get the Text value of this?

6
  • Show the code behind. Commented Jun 14, 2018 at 18:45
  • As mentioned above, I cannot access this from anywhere. My backend is completely empty, just an empty page_load method. Commented Jun 14, 2018 at 18:52
  • Check this out. Commented Jun 14, 2018 at 19:07
  • 1
    If you have the ability try posting on their forums, they have good support. Only things I can suggest would be restart your IDE. I find Visual Studio and Telerik controls sometimes get into a funk. Do you have multiple versions of their WPF controls installed on the system? I've had issues where different versions of the software wouldn't play nicely together. Commented Jun 14, 2018 at 20:25
  • You are in a template of a data-bound control, so you can't directly access the server element in code-behind. There are lots of ways to get it though, you just have to search. Such as telerik.com/forums/… Commented Jun 15, 2018 at 15:59

1 Answer 1

1

Thanks to @Seano666, I found a solution. This is what I ended up using:

RadTextBox txtbox = (RadTextBox)item["Notes"].FindControl("txtnote"); string WhatIWantedToFind = txtbox.Text; 

Thanks.

Sign up to request clarification or add additional context in comments.

1 Comment

Glad you figured it out! I guess I could have made some free internet points here, oh well :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.