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

NestedViewTemplate - I have a user control in there... postbacks don't work

2 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 06 Apr 2011, 08:11 PM
Hey Telerik community!

First off, I've done a lot of research on this topic. Seems I'm not the only one having trouble getting things to work inside a NestedViewTemplate. But all the posts I read dealt with having another RadGrid inside a NestedViewTemplate. My situation is a little different...

Problem

I have my own custom user control. It's very simple. If I put it INSIDE the NestedViewTemplate the postbacks don't work. If I put it OUTSIDE it works as expected.

Attached are some screen shots.

Here is the code for the simple user control:

ascx:
<telerik:RadTextBox OnTextChanged="First_Name_TextChanged" ID="tb_first_name" Width="120px" runat="server" AutoPostBack="True" />
code behind:
protected void First_Name_TextChanged(object sender, System.EventArgs e)
{
    if (!string.IsNullOrEmpty(tb_first_name.Text))
    {
        Profile.SetPropertyValue("profile_first", tb_first_name.Text);
        Profile.Save();
        ico_first_name.Text = CHECK_ICON;
    }
}

So my question is this:

How do I get that postback to actually do something, when it's inside the NestedViewTemplate?

-Josh

2 Answers, 1 is accepted

Sort by
0
Joshua
Top achievements
Rank 1
answered on 07 Apr 2011, 06:07 PM
Need a little help here guys :-)

I've been fiddling around with different solutions but nothing has seemed to work.

How do you get postbacks to work in a user control inside a nestedviewtemplate?

-Josh

0
Iana Tsolova
Telerik team
answered on 11 Apr 2011, 12:05 PM
Hello Joshua,

I assume that you should recreate the dynamically loaded user control in order to overcome that issue. For that purpose, you can handle the ItemCreated event, and if an item is expanded, load the user controls in the nested item. Check it out and let me know how it goes and is I missed something out.


Best wishes,
Iana
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
Grid
Asked by
Joshua
Top achievements
Rank 1
Answers by
Joshua
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or