Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
242 views
Hi..

I'm migrating my old modules to new version with new telerik ajax controls and I need some advices how to do it best.
At the moment I have radajaxmanager embedded in skin (skin is always one per page, so this doesnt make any problems).
Now the problem, the typicall situation in my modules:

a) users press button and in client or server side I display radconfirm
b) if user presses yes ajaxrequest is made to call server side code,
c) server side code is executed and it displays radalert with notifaction or response.redirect is made to back to main screen.

How to do it best with new ajax controls? How to use radajaxmanager and radajaxproxy?

Thanks for all info
Regards

Maria Ilieva
Telerik team
 answered on 27 May 2008
1 answer
145 views
I have come across what I think is a rather interesting issue.  When using ITemplate to create a NestedViewTemplate the InstantiateIn method gets called on the initial page load before anything has been expanded.  Is this normal behavior?  Also, when trying to view RadGrids inside that template the NeedDataSource method is not call until after the main GridDataItem has been expanded and then collapsed.  Is there any way to have NeedDataSource for the grids inside the template fire when the main GridDataItem is expanded as opposed to collapsed?
Konstantin Petkov
Telerik team
 answered on 27 May 2008
1 answer
238 views
Here's the general layout of my grid:

  • RadGrid1
    • NestedViewTemplate
      • RadMultiPage
        • RadGrid2
    • Column 2
    • Column 3
    • etc.

I need to programmatically load RadGrid2, and the parameters that I will feed into the stored procedure will come from RadGrid1. I'm not sure how to find RadGrid2, let alone how to find the columns within RadGrid2.

Thanks. Please let me know what additional information you might need.

                        
Missing User
 answered on 27 May 2008
1 answer
78 views
Hello,

I have a radgrid with a mastertableview.  Within this mastertableview I have a NestedViewTemplate that contains a tab control.  On these tab controls I have another radgrid with a mastertableview and detailtables.  It seems as if I am losing some parent/child relationship between my first mastertableview and the other mastertableview on the tab.  It seems as if you cannot set a relationship between theses to mastertable views.

Is there anyway to keep this relationship?

Missing User
 answered on 27 May 2008
1 answer
106 views
With the new release (2008.1.515.20), a javascript exception is thrown when I enter a single quote or perecent sign in a "inplace" textfield. From further investigation, I found that this exception is only thrown if AllowKeyboardNavigation is set to true.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <div> 
            <telerik:RadGrid ID="RadGrid1" runat="server"   
                OnNeedDataSource="RadGrid1_NeedDataSource">  
                <ClientSettings AllowKeyboardNavigation="true">  
                </ClientSettings>          
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="Id" ClientDataKeyNames="Id" ShowHeader="true" EditMode="InPlace" CommandItemDisplay="top" > 
                    <Columns> 
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" />                  
                        <telerik:GridBoundColumn UniqueName="someColumn" DataField="someField" /> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid></div>  
    </form> 
</body> 
</html> 
 


using System;  
using System.Data;  
using System.Configuration;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
public partial class _Default : System.Web.UI.Page   
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
    {  
        RadGrid1.DataSource = new DataTable();  
    }  
} 


So if you try out the preceeding code, press the insert new record button and try to type a single quote or percent sign in the text field.
Pavel
Telerik team
 answered on 27 May 2008
1 answer
190 views
I'm running into this problem where I can scroll to the top of the page after a call back. I have a tab strip with a multipage below it. When I scroll to the bottom to click a button, I've put this in the button click's code-behind:

        RadTabStrip tabStrip = (RadTabStrip)Page.FindControl("RadTabStrip1");
        if (checkoutTabStrip != null)
        {
            tabStrip.SelectedIndex = 1;
            tabStrip.MultiPage.SelectedIndex = 1;
        }

        RadAjaxManager.GetCurrent(this.Page).ResponseScripts.Add("window.scrollTo(0,0);");

This seems to work and when the button is clicked, the page does scroll to the top- for a second!! Then it scrolls back to the bottom where the button was clicked. I tried turning off the scroll position thru .NET but this didn't do anything:

MaintainScrollPositionOnPostback="false"

Is there a Telerik property that's controlling this? I can't seem to make my scroll to the top stick because I don't know what, but something is coming after my scrollTo(0,0) and scrolls it back down. Any ideas on this?
Yavor
Telerik team
 answered on 27 May 2008
1 answer
1.2K+ views
Hi,

I have two buttons in each gridrow. One button(openDetail) is used to open detail page as a modal popup and another button "submit" raises itemcommand event and does some data processing.

The problem that I have is once i click submit, OpenDetail button stops working(page just refreshes but doesnt open detail page).

In Item_Created Event handler I have the following code

    int Id = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "DataId"));
               
              
               LBTN Namebtn = e.Item.FindControl("NameBTN") as BTN;
              
                Namebtn.Attributes["onclick"] = string.Format("return OpenDetail('{0}','{1}');", Id, e.Item.ItemIndex);

             

This is the OpenDetail javascript:

  function OpenDetail(id, rowIndex)
    {
       var grid = window[<%=Grid.ClientId%>];
               
        var rowControl = grid.MasterTableView.Rows[rowIndex].Control;
        grid.MasterTableView.SelectRow(rowControl, true);
                       
        window.radopen("Details.aspx?data=" + id, "Dialog");
        return false;
     }

      <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                <Windows>
                    <telerik:RadWindow ID="Dialog" runat="server" Title="Dialog" Height="400px"
                        Width="300px" Left="150px" ReloadOnShow="true" Modal="true"/>
                </Windows>
            </telerik:RadWindowManager>

Could you please tell me what I am doing wrong...

thanks..

Rosen
Telerik team
 answered on 27 May 2008
1 answer
149 views
Hello,

I have an app where I move rows between grids.  I have run into an issue because it seems like the order of grid.SelectedItems is random and not in the order of how the user clicked them  Is there a way to get grid.SelectedItems in the order of how the user clicked them?  Right now the only option is to roll my own functionality by using the row selected client event to capture the order and store it in a hidden field that I access server side to add the other grid.  I rather not do this if there is a solution or a better way accomplish this.  Any idea?

Thanks
Veli
Telerik team
 answered on 27 May 2008
3 answers
295 views
I have a RadGrid in a DNN module which the first column is a GridButtonColumn called Report.  If the user clicks Report button a Crystal Report is displayed on seperate window not within DNN.  The user can view print or export the report.

Well this worked fine until I finally got AJAX working in DNN.  I was registering a startup script after capturing in a session variable the row clicked identified.  In the RadGrid ItemCommand event I identified it was the button pressed which still works but now I can not because of AJAX register a script to run.  I tried just adding a function on the User Control but have not figured out how I can call this function from the ItemCommand event.  I read how to do Callbacks and they act like I need...the client passes back to the server information on what was requested and them the callback fires back a function on the client with passed arguments. 

It would be nice if I could make RadGrid fire a function OnClicked for GridButtonColumn but have found no way of redirecting the event to a client function.  The javascript on the client is:

<
script type="text/javascript">
    function
OpenReport(arg, context)
    {
         window.open(arg,
"_blank","width=700, height=500, scrollbars=yes, menubar=no, resizable=1");
    }
</script>

and the partial code behind for RadGrid ItemCommand is:

If e.CommandName = "Report" Then
    Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
    If dataItem("Rev").Text <> "1" Then
        Dim pagePath As String = Me.ResolveUrl("Report.aspx")
        Session(
"rptID") = dataItem("ID").Text
        Session(
"rptRev") = dataItem("Rev").Text

        ????????? DO NOT KNOW HOW TO CALL FUNCTION OpenReport ???????

    End
If
End If

Can you please lead me in the right direction?

Shinu
Top achievements
Rank 2
 answered on 27 May 2008
2 answers
192 views
I would like to add two radcombobox in the RadGrid to do the Edit and Add function, when I click the first radcomobox, the second radcomobox will bind other data depend on the first radcomobox input value. I attempt to try


  Protected Sub RadComboBox1_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
        Me.RadComboBox2.DataSource = "SqlDataSource3"
        Me.RadComboBox2.DataBind()
    End Sub

But nothing happen when the system after autopost
How can I do?
314
Top achievements
Rank 1
 answered on 27 May 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?