Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
147 views
Hi, I'm populating a page dynamically with usercontrols, the user control is loaded without problem but the ajaxrequest or a simple postback inside the user conteol is not working..

This is an simple exsample....what's wrong with that?

ASPX:

        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
 
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
          
        <asp:Button ID="Button2" runat="server" Text="Load WebUserControl" /> 
          
    <asp:Panel ID="Panel1" runat="server">  
    </asp:Panel> 
 
        <Telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <Telerik:AjaxSetting AjaxControlID="Button1">  
                    <UpdatedControls> 
                        <Telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    </UpdatedControls> 
                </Telerik:AjaxSetting> 
            </AjaxSettings> 
        </Telerik:RadAjaxManager> 

ASPX VB

 
    Private Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button1.Click  
        Label1.Text = DateTime.Now.ToString()  
    End Sub 
 
    Private Sub Button2_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button2.Click  
        'Panel1.Controls.Add(LoadControl("WebUserControl1.ascx"))  
        LoadUserControl("WebUserControl1.ascx")  
    End Sub 
 
 
    Public Sub LoadUserControl(ByVal controlName As String)  
        If Not (LatestLoadedControlName Is NothingThen 
            Dim previousControl As Control = Panel1.FindControl(LatestLoadedControlName.Split("."c)(0))  
            If Not (previousControl Is NothingThen 
                Me.Panel1.Controls.Remove(previousControl)  
            End If 
        End If 
        Dim userControlID As String = controlName.Split("."c)(0)  
        Dim targetControl As Control = Panel1.FindControl(userControlID)  
        If targetControl Is Nothing Then 
            Dim userControl As UserControl = CType(Me.LoadControl(controlName), UserControl)  
            'slashes and tildes are forbidden  
            userControl.ID = userControlID.Replace("/""").Replace("~""")  
            Me.Panel1.Controls.Add(userControl)  
            LatestLoadedControlName = controlName  
        End If 
    End Sub 
 
 
    Private Property LatestLoadedControlName() As String 
        Get 
            Return CStr(ViewState("LatestLoadedControlName"))  
        End Get 
        Set(ByVal value As String)  
            ViewState("LatestLoadedControlName") = value  
        End Set 
    End Property 
 

ASCX

<asp:Button ID="Button1" runat="server" Text="Button" /> 
 
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
 
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">  
    <AjaxSettings> 
        <Telerik:AjaxSetting AjaxControlID="Button1">  
            <UpdatedControls> 
                <Telerik:AjaxUpdatedControl ControlID="Label1" /> 
            </UpdatedControls> 
        </Telerik:AjaxSetting> 
    </AjaxSettings> 
</Telerik:RadAjaxManagerProxy> 
 

ASCX VB

    Private Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button1.Click  
 
        Label1.Text = DateTime.Now.ToString()  
 
    End Sub 

max
Top achievements
Rank 1
 answered on 11 Feb 2009
1 answer
131 views
Hi,

I am having a few problems with Filters in the RadGrid.

My environment is Q3 2008, Dot Net 3.5 and I am mostly using FireFox as my Browser.

  1. I think you need to put something into the FilterItem Text boxes when the filter function is something that does not take arguments (e.g. Is Null, Is Not Null and so on). When the grid is displayed it is not clear that filtering has been applied in these cases

    In fact, it might also be nice if it was immediately clear to the user whether Contains, Startswith, EndsWith, Equals and son on are being used.

    You have an example of some JavaScript to allow fairly sophisticated text entry into the filter boxes folllowed by pressing the Enter key - which I feel you could embed into the RadGrid functionality as a property (else we programemrs are continually pasting in chunks of code). You could extend the idea so that user gets more feedback about which filters are being applied
  2. I have AutoPostBackOnFilter set to True (so i can use the javascript mentioned above). When I implement the GridDateTimeColumn I get a Date picker in my filter (which is absoultely great - and perhpas you ought to point this out in the documentation about column types - where you suggest that in non-edit mode there is no difference with a GridBoundColumn). My problem is that when I select a date from the picker, and before I get a chance to select the Filter Function, the postback occurs.

    Yes, i can disable AutoPostBack for Date Columns, but it would be nice to get both features.
Rosen
Telerik team
 answered on 11 Feb 2009
2 answers
104 views
We have a asp.net with a content area that has abosolut position turned on. Inside this area we have a telerik grid using the outlook2007 skin.  When the grid has data via the needsdatasource event the entire content div shrinks up to almost nothing. Strange thing is that when the we comment our the needdatasource event and the grid displays nothing but  a shell the div does not shrink/disappear.  In issue doesnt show itself in FireFox.

Thanks,
Kyle
kyle
Top achievements
Rank 1
 answered on 11 Feb 2009
1 answer
84 views
hi
when i add rad ajax control based application on server it give javascript related error and no any telerick control working
is there need to run exe on the server ?
is there nedd to any othere resource in the server?


Daniel
Telerik team
 answered on 11 Feb 2009
1 answer
147 views
Hi there,

For a new web application i want to use the Grid control from Telerik. But we need the columnheaders aligned vertically.
See the screenshot for our exact wish. Is this possible and if so how?

Thanks, Ben

Screenshot
Shinu
Top achievements
Rank 2
 answered on 11 Feb 2009
4 answers
137 views
Is there a way to set the AdRotator's ScrollDirection to scroll the item template contents in a random direction?
Reid
Top achievements
Rank 2
 answered on 11 Feb 2009
3 answers
133 views
I have a call to display a radwindow alert after a record update in the rad grid 'UpdateCommand' like so:

Protected Sub grid_dealerships_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid_dealerships.UpdateCommand 
 
        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem) 
        Dim dealer_id As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("dealer_id"
 
        Try 
            Dim dealer_name As String = (TryCast(editedItem.FindControl("txt_dealer_name"), TextBox)).Text 
 
            Dim logged As Integer = Dealership_DataAccess.UpdateDealershipInformation(dealer_id, dealer_name) 
 
            IF logged > 0 then     
 
                    DisplayMessage(String.Format("Dealership: <br/><br/><b>{0} - {1}</b><br/><br/> Was UPDATED SUCCESSFULLY!", dealer_id, dealer_name), "Dealership UPDATED"
 
            End If 
 
        Catch ex As Exception 
            DisplayMessage("Unable to update dealership record. Reason: " + ex.Message, "Update ERROR"
            e.Canceled = True 
 
        End Try 
 
    End Sub 
 
    Private Sub DisplayMessage(ByVal text As StringByVal title As String
        RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function(){radalert('" & text & "', 330, 210, '" & title & "');})"
    End Sub

Everything regarding the update works properly but the display alert does not show.  If I select a different record on the grid to display or edit then all of a sudden the alert will show up correctly....

Here is my window manager from the aspx page which only displays a radWindow I use for a different purpose.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
                function ShowDealerIDs() { 
                    window.radopen("../shared/dealerID_list.aspx""UserListDialog"); 
                    return false; 
                } 
            </script> 
        </telerik:RadCodeBlock>  
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="grid_dealerships" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>       
                    <telerik:AjaxSetting AjaxControlID="grid_dealerships"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="grid_dealerships" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>                                   
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    <Windows> 
                    <telerik:RadWindow Skin="Default"  ID="UserListDialog" runat="server" Title="User List Dialog" Height="800px" 
                        Width="550px" Left="100px" ReloadOnShow="true" Modal="true"  /> 
                </Windows> 
    </telerik:RadWindowManager> 

Georgi Tunev
Telerik team
 answered on 11 Feb 2009
1 answer
333 views
I am programmatically adding radwindows to my radwindowmanager.  What's the best server-side code to use to search the radwindowmanager's windows and make sure the window does not exist already before adding it?  I am assuming the windows might "exist" across postbacks and want to avoid dups.

Couldn't find good example of server-side usage of Find and related methods against radwindowmanager window collection.

Thx
Georgi Tunev
Telerik team
 answered on 11 Feb 2009
1 answer
149 views
Here is my objective:  I have a RadTextBox that opens a RadWindow when it receives focus.  The RadWindow contains a RadGrid, which allows the user to select a row.  Upon selection, the RadWindow closes and returns an a variable to the parent page.  I then take the id that is returned, run a query to get a string value and place that string value in the RadTextBox.  Everything is working fine until I try to put the string value in the RadTextBox.  I can get the return value from the RadWindow and even place it in a label (see below).
function refresh(id, name) {  
                var lblEmployeeId = document.getElementById("<%= lblEmployeeId.ClientID %>");  
                lblEmployeeId.innerHTML = id;  
                var rtbFirstName = document.getElementById("<%= rtbFirstName.ClientID %>");  
                rtbFirstName.value = name;  
                  
            } 

The page will display the value for lblEmployeeId when the RadWindow closes, but not for rtbFirstName.  However, if I click in rtbFirstName, the value will be displayed.  I need it to display the same way as the lblEmployeeId.  Please advise.
Georgi Tunev
Telerik team
 answered on 11 Feb 2009
1 answer
155 views
Now I band my grid with a database table-product table ,and every product records have self image,but I just save the image name in the table and the images are stored in server hard disk.
How to show image in the grid rows for every record,now I use this code DataTextFormatString="<img src='YourImageUrl' />" to show image in my grid,it can not work well,just show same image every rows.

Thx.
Princy
Top achievements
Rank 2
 answered on 11 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?