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

how can I change my TextBlock in my Interaction.Behaviors?

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Graves
Top achievements
Rank 1
Brian Graves asked on 14 Jun 2010, 05:05 PM

I implemented the following blog:
http://blogs.telerik.com/pavelpavlov/posts/10-02-01/empty_data_template_in_radgridview_for_silverlight_and_wpf.aspx

I use it to show:
Please wait while report is loading...

 

 

 

This works great but I need to programmatically change the text in my TextBlock if there is an error like:
This report cannot be loaded due to an internal error.  Please try again.

Using C#, how can I get the TextBlock defined in the xaml (which shows the first message), modify the text, and redisplay it?  I tried naming the TextBlock but my codebehind doesn't recognize it.

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 15 Jun 2010, 03:05 PM
Hi Brian Graves,

if you include a Using Telerik.Windows.Controls , you will get access to an extension method :

ChildrenOfType<T>
So you could then do something like :

var textBlock = MyUserControl.ChildrenOfType<TextBlock>[0]

Let me know in case you have troubles implementing this.

Best wishes,
Pavel Pavlov
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Brian Graves
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or