Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
221 views

Hi,
I have 2 radcomboboxes on my page. One for country and one for city. On the selected index changed event of the country dropdowni want to fill my city dropdown, which requires a database hit. I tried the following code, but it is causing postback, and working in ajax.

master page:

 

 

 

<div>

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server">

 

 

<Windows>

 

 

<telerik:RadWindow ID="RadWindow1" Height="500px" Width="600px"

 

 

KeepInScreenBounds="true" OnClientShow="OnPopupShow" Behaviors="Close,Pin,Maximize,Reload,Move"

 

 

OnClientClose="OnPopupClose" ReloadOnShow="false" ShowContentDuringLoad="false" Modal="true" runat="server">

 

 

</telerik:RadWindow>

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

<Scripts>

 

 

<asp:ScriptReference Name="" Assembly="" Path="~/Common/Scripts/Gateway.js" />

 

 

</Scripts>

 

 

</telerik:RadScriptManager>

 

 

 

</div>


Content page - on which Ajax is required:

 

 

<telerik:RadAjaxManager ID="AjaxManagerId" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="Country" EventName="SelectedIndexChanged">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="City" LoadingPanelID="loadingPanel" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="loadingPanel" runat="server">

 

 

<asp:Image ID="loadingImage" runat="server" ImageAlign="Middle" ImageUrl="~/Images/Loading.gif">

 

 

</asp:Image>

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<td>

 

Client Country

 

</td>

 

 

<td>

 

 

<telerik:RadComboBox ID="Country" runat="server" Width="150px" OnSelectedIndexChanged="Country_SelectedIndexChanged"

 

 

AutoPostBack="true" Height="170px">

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

<td>

 

Client City

 

</td>

 

 

<td>

 

<%

-- <asp:TextBox ID="ClientCity" runat="server" Width="110px"></asp:TextBox>--%>

 

 

<telerik:RadComboBox ID="City" runat="server" Width="110" AllowCustomText="true"

 

 

MarkFirstMatch="true" ShowToggleImage="false" MaxHeight="170px">

 

 

</telerik:RadComboBox>

 

 

</td>

Please suggest what can be done to ajaxify filling of the child radcombobox.

 

Kalina
Telerik team
 answered on 12 May 2010
1 answer
74 views
Sorry for what is probably an elementary question. First day using Radchart.  I've been searching for an answer, but haven't found anything yet.

I'm dynamically creating the charts because the # of charts will change. Here's the function I'm using:

    Protected Sub CreateChart(ByVal sQuestionId As StringByVal chtChart As RadChart) 
        Dim csSeries As New Telerik.Charting.ChartSeries 
 
        csSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.SeriesName 
 
        chtChart.Skin = "Inox" 
        chtChart.SeriesOrientation = ChartSeriesOrientation.Horizontal 
 
        oConn.Open() 
        Try 
            oCmd = New SqlCommand("Survey_ReportingByQuestionId", oConn) 
            oCmd.CommandType = CommandType.StoredProcedure 
            oCmd.Parameters.Clear() 
            oCmd.Parameters.AddWithValue("@QuestionId", sQuestionId) 
 
 
            If oRdr.HasRows Then 
                Do While oRdr.Read 
                    Dim csiSeriesItem As New Telerik.Charting.ChartSeriesItem 
                    csiSeriesItem.YValue = oRdr.Item("AnswerCount"
                    csiSeriesItem.Name = oRdr.Item("Answer"
 
                    csSeries.AddItem(csiSeriesItem) 
                Loop 
            End If 
 
        Catch ex As Exception 
 
        Finally 
            oConn.Close() 
        End Try 
 
        chtChart.AddChartSeries(csSeries) 
    End Sub 

The "answers" are things like True/False, A/B/C/D, etc.  How can I use those to label the X axis instead of the default numbers that the chart generates?  The only way I've seen to do it is through databinding, which I'm not doing.

Any help would be greatly appreciated!



Vladimir Milev
Telerik team
 answered on 12 May 2010
1 answer
66 views
When you use grouping in RadGrid in combination with IE8 (Regular), it isn't working properly (no cursor on header) and you can only group one column. When you choose compatible mode it's working fine. Is there any workaround available?

Thanks.
Nikolay Rusev
Telerik team
 answered on 12 May 2010
5 answers
120 views
Hi,

Is there any way of getting the http error code when this result fires?  In my application (asp.net mvc) I am returning a 403 Forbidden code when the forms authentication for the user times out.

In my other ajax calls to the app, the code is available and I am redirecting the users to the login page if appropriate. An example of this would be the ClientNodeDropping event

//handles node dropping event. 
function clientNodeDropping(sender, eventArgs) { 
  //Get source and destination nodes. 
  var srcNode = eventArgs.get_sourceNode(); 
  var destNode = eventArgs.get_destNode(); 
  //Get values needed to update a folder or reports location. 
  var srcId = srcNode.get_value(); 
  var srcType = srcNode.get_attributes().getAttribute("nodeType"); 
  var destId; 
  var destType; 
  try { 
    destId = destNode.get_value(); 
    destType = destNode.get_attributes().getAttribute("nodeType"
  } 
  catch (e) { 
    destId = 0; 
    desttype = "Folder"
  } 
  //Check that destination node is not of "Report" nodeType. 
  if (destType != "Report") { 
    $.ajax({ 
      type: "POST"
      url: "/Reports/MoveNode/"
      data: ({ sourceId: srcId, destinationId: destId, srcNodeType: srcType, destNodeType: destType }), 
      dataType: "json"
      success: function(response) { 
        if (response.Success) { 
          clientNodeDroppingSuccess(srcNode, destNode, srcType, destType); 
        } 
        else { 
          alert(response.Errors[0]); 
          eventArgs.set_cancel(true); 
        } 
      }, 
      error: function(xhr, state, errorThrown) { 
        switch (xhr.status) { 
          case 403: 
            window.location = window.location
            break
          default: 
            alert("Sorry, that action could not be performed at this time."); 
            eventArgs.set_cancel(true); 
            break
        } 
      } 
    }); 
  } 

How can I achieve this with the OnClientNodePopulationFailed event?

Thanks,
Nick
Atanas Korchev
Telerik team
 answered on 12 May 2010
1 answer
103 views
I'm having an issue with rad menu throwing a JavaScript error when I mouse over an item in a non ie browser.

The error I'm getting is below.
 
Error: j is null
Source File: /Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a3bbfe379-348b-450d-86a7-bb22e53c1978%3aea597d4b%3bTelerik.Web.UI%2c+Version%3d2010.1.415.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a710a7ed7-bdf5-4c33-88f0-6cb83da7e591%3a16e4e7cd%3af7645509%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41
Line: 2552

The server is IIS6 with .net 3.5 sp1 and ajax extensions 2.0 installed.  There is nothing special or dynamic about the menu on the page, it's all hard coded for a proof of concept.

You can see example here.  It all works fine locally in all of the browsers. 
http://bit.ly/9roeqA
Yana
Telerik team
 answered on 12 May 2010
2 answers
72 views
At the moment I am setting the visibilty of controls on the itemdatabound event handler after detecting if row is in insert/edit mode.

if (e.Item is GridEditFormItem && e.Item.IsInEditMode) 
     (e.Item.FindControl("txtUserName"as WebControl).Enabled = false


This seems quite cumbersome to me, is there a better way to do it?

Thanks

Luis

Luis Silva
Top achievements
Rank 1
 answered on 12 May 2010
3 answers
114 views
Hi,

I am experiencing the following problem. I have an editable grid with grouping. If the grid is collapsed and if I expand a group and then make a click to edit the item, then the User Control Edit Form is opened for the selected item (expected behaviour) and the grid expands (not expected behaviour). How can I prevent that the grid expands in this case?

Regards,
Mark
Yavor
Telerik team
 answered on 12 May 2010
1 answer
237 views

How to set the value to display in 2 decimal point? The code below can't show the decimal point.

 

RadChart_Overall.Series(0).DefaultLabelValue =

 

"#%"

 

 

 

 

Ves
Telerik team
 answered on 12 May 2010
5 answers
144 views
I am trying to figure out why my Windows7 style looks the way it does.  I used VSB to create a new style and selected Windows7.  I did not change anything.  I saved the .zip and imported into my project.

Here is my ASPX.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" 
    Theme="Texon" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
 
 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" 
            GridLines="None" AllowFilteringByColumn="True" AllowSorting="True"   
            ShowGroupPanel="True">  
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ip_id" DataSourceID="SqlDataSource1">  
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="ip_id" DataType="System.Int32" HeaderText="ip_id" 
                        ReadOnly="True" SortExpression="ip_id" UniqueName="ip_id">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ip_addr" HeaderText="ip_addr" SortExpression="ip_addr" 
                        UniqueName="ip_addr">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ip_first_seen" DataType="System.DateTime" HeaderText="ip_first_seen" 
                        SortExpression="ip_first_seen" UniqueName="ip_first_seen">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ip_last_seen" DataType="System.DateTime" HeaderText="ip_last_seen" 
                        SortExpression="ip_last_seen" UniqueName="ip_last_seen">  
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">  
                <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 
        </telerik:RadGrid> 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NetworkMonitorConnectionString %>" 
            SelectCommand="SELECT * FROM [tbl_ip_addresses]"></asp:SqlDataSource> 
    </div> 
    </form> 
</body> 
</html> 
 

Here is my web.config
<appSettings> 
    <add key="Telerik.Skin" value="Texon"/>  
    <add key="Telerik.EnableEmbeddedSkins" value="False"/>  
  </appSettings> 

I have also attached what mine looks like compared to what the embedded skin look like once it is rendered.  I am using Q3 2009 controls.

Any guidance is appreciated.
BaiH
Top achievements
Rank 1
 answered on 12 May 2010
2 answers
100 views
Hi,
    I have requirement in telerik Rad grid.
Scenario: My Grid default page size should be 50.So the other options available are 10,20.In total it will be 10,20,50.I want to add 100 to these options.That is i want drop down options like this 10,20,50,100.
How can I acheive this please help me.
Sambhav Jain
Top achievements
Rank 1
 answered on 12 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?