Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
155 views

Hi,

I have a radgrid with a MasterTableView that has a GridTemplateColumn. Insidt the GridTemplateColumn is an asp.net radiobuttonlist. How can I initialize the selected index from the database before the details page displays? The radiobuttonlist selectedIndex cannot be bound declaratively on the aspx page

Thanks
Dan

Dan
Top achievements
Rank 1
 answered on 25 Aug 2010
1 answer
273 views
Hi,

I am using two instances of same user control, but this user control does not work properly.
when i am using single instance of this user control it works properly.
In this user control, i have used rad window and RadAjaxManagerProxy control.
In single instance scenario, rad window works properly means it was close properly on cancel button and
shows ajaxloadingpanel on OK button during processing, but when i am using the same user control with multiple instances then rad window does not work properly.
I have added source code of this user control and aspx page.
Please suggest me the solution.



thanks



This is source of "Picker.ascx" user control


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Picker.ascx.cs" Inherits="Picker" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
 
    <AjaxSettings >
        <telerik:AjaxSetting AjaxControlID ="gvPeoplePicker">
            <UpdatedControls >
                <telerik:AjaxUpdatedControl ControlID ="gvPeoplePicker" LoadingPanelID ="AjaxLoadingPnl" />
            </UpdatedControls>
        </telerik:AjaxSetting>
         
        <telerik:AjaxSetting  AjaxControlID ="btnOK">
            <UpdatedControls >
                <telerik:AjaxUpdatedControl ControlID ="gvPeoplePicker" LoadingPanelID ="AjaxLoadingPnl" />
            </UpdatedControls>
        </telerik:AjaxSetting>
         
        <telerik:AjaxSetting  AjaxControlID ="btnOK">
            <UpdatedControls >
                <telerik:AjaxUpdatedControl ControlID ="txtBoxPicker" />
            </UpdatedControls>
        </telerik:AjaxSetting>
         
    </AjaxSettings>
     
</telerik:RadAjaxManagerProxy>
 
 
<div nowrap>
    <table>
        <tr>
            <td>
                <telerik:RadTextBox ID="txtBoxPicker" runat="server">
                </telerik:RadTextBox>
            </td>
            <td>
                <asp:Button ID="btnOpenPicker" runat="server" Text="..."  OnClientClick="return false;" />
            </td>
        </tr>
    </table>
</div>
 
 
<telerik:RadAjaxLoadingPanel ID="AjaxLoadingPnl" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
 
<telerik:RadWindow ID="WndPicker" runat="server" OpenerElementID ="<%# btnOpenPicker.ClientID %>"
    Height="520" Width ="858" Behaviors ="Close,Move" Modal ="true" VisibleStatusbar ="false" 
    ReloadOnShow ="true"  ShowContentDuringLoad="false" DestroyOnClose ="true">
   <ContentTemplate >
       <table width="100%">
           <tr>
               <td nowrap style="border-bottom: solid 1px lightgray; height: 40px; vertical-align: middle">
                   <table>
                       <tr>
                           <td valign="middle" style="vertical-align: middle">
                               <asp:Image ID="imagePeople" runat="server" ImageUrl="~/Images/1278314238_people.png"
                                   Height="30px" Width="30px" />
                           </td>
                           <td valign="middle" style="vertical-align: middle">
                                <asp:Label ID="lblMsg" runat="server" Text="Search for people from the database."
                                   Font-Names="Arial" Font-Size="8.5pt" ForeColor="Gray"></asp:Label>
                           </td>
                       </tr>
                   </table>
               </td>
           </tr>
       </table>
        
       <table width="100%">
           <tr>
               <td nowrap>
                   <telerik:RadGrid ID="gvPeoplePicker" runat="server" ShowHeader="true" EnableLinqExpressions="false"
                       AutoGenerateColumns="false" GridLines="Horizontal" AllowFilteringByColumn="true"
                       Width="100%" AllowPaging ="false" >
                       <MasterTableView ShowHeadersWhenNoRecords="true">
                           <Columns>
                               <telerik:GridBoundColumn HeaderText="Employee ID" UniqueName="EmployeeID" DataType="System.Int32">
                               </telerik:GridBoundColumn>
                                
                               <telerik:GridBoundColumn HeaderText="Department">
                               </telerik:GridBoundColumn>
                                
                               <telerik:GridBoundColumn HeaderText="Branch" DataType="System.String">
                               </telerik:GridBoundColumn>
                                            
                               <telerik:GridBoundColumn HeaderText="Nationality" DataField="Nationality" DataType="System.String">
                               </telerik:GridBoundColumn>
                                
                               <telerik:GridBoundColumn HeaderText="Gender" DataField="Gender" DataType="System.String">
                               </telerik:GridBoundColumn>
                           </Columns>
                       </MasterTableView>
                       <ClientSettings>
                           <Scrolling AllowScroll="true" ScrollHeight="300px" UseStaticHeaders="true" />
                           <Resizing AllowColumnResize="true" />
                       </ClientSettings>
                   </telerik:RadGrid>
               </td>
           </tr>
           <tr>
               <td>
                     
               </td>
           </tr>
           <tr>
               <td align="right">
                   <asp:Button ID="btnOK" runat="server" Text="OK" Width="70px" OnClick="btnOK_Click" />
                     
                   <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="CloseWnd();return false;" />
                    
               </td>
           </tr>
           <tr>
               <td>
                        
               </td>
           </tr>
       </table>
   </ContentTemplate>
</telerik:RadWindow>
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
<script language ="javascript" type ="text/javascript"  >
     
    function CloseWnd() {
        $find("<%=WndPicker.ClientID%>").close();
        return false;
    }
 
</script>
</telerik:RadCodeBlock>


This is code behind code of "Picker.ascx.cs"

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data ;
using System.Data.SqlClient  ;
using Telerik.Web .UI ;

public partial class Picker : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        gvPeoplePicker.DataSource = string.Empty;
    }

    protected void btnOK_Click(object sender, EventArgs e)
    {
        System.Threading.Thread.Sleep(2000);
        txtBoxPicker.Text = "Result.";

        ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "", "CloseWnd();", true);
    }
}


Source of "Default.aspx" file. This aspx page contain single instance of user control.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    
<%@ Register src="Picker.ascx" tagname="Picker" tagprefix="uc1" %>
    
<!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">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    
    <div>
    Single Instance
    <uc1:Picker ID="Picker1" runat="server" />
    
     </div>
     
     <br />
     <br />
     
    <asp:Button ID="Button1" runat="server" Text="Page 2" onclick="Button1_Click" />
    </form>
</body>
</html>

Code behind code of "Default.aspx.cs" file.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default2.aspx");  
    }
}


code of "Default2.aspx" file. This page contain multiple instance of same user control.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.519.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register src="Picker.ascx" tagname="Picker" tagprefix="uc1" %>
<!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">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    
    <div nowrap>
    User Control (1st Instance) <uc1:Picker ID="Picker1" runat="server" />
    </div>
    
    <br />
    
    <div nowrap>
        User Control (2nd Instance) <uc1:Picker ID="Picker2" runat="server" />
    </div>
    </form>
</body>
</html>






Fiko
Telerik team
 answered on 25 Aug 2010
3 answers
133 views
Hello there.

I need a point/push in the right direction.

I have a radgrid that is quite wide (well, the width and number of columns is dependent upon preferences but that's another matter) i.e., it has the potential for being up to 35 columns across...phew!!

Can someone recommend how I can go about styling, amending the rad grid so that the columns are grouped. Is it even possible?

So for example, I have the t1 with the following.

Col1, Col2, Col3, Col4.

Is it possible to show the table so that Col1 & Col2 are grouped (i.e. not shown in their entirity) but still showing Col 3 & Col 4.

Any helps or pushes in the right direction, greatly appreciated.
Dimo
Telerik team
 answered on 25 Aug 2010
1 answer
112 views
i am having issues with the ToolTipManager and the AjaxManager.  I followed the example below:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax

However, the only way i can get my page to work is to set EnableAjax=false on the AjaxManager.  thus, everything seems to be wired up correctly, but the tooltip does not fire when ajax is enabled.

any suggestions on what i should be checking here?

thanks, rick..
Fiko
Telerik team
 answered on 25 Aug 2010
3 answers
134 views
I have a asp.net page built using radtabstrips, radmultipage and pageviews. I use an RadAjaxManager for updating my controls. I would like to place a radupload control on one of my pages, but I can not get the control to fire the validatingfile event when I upload the file. I have tried going into the ajax manager and setting the upload control as both the initiatior and the handled control, but this does not work.

If I move the control to the very bottom of the page where it is outside of all other controls, the event fires. It stops working anytime I place it inside of a multipage. Even if I wrap this in a panel and use the ajax manager to hide and show the panel, the upload quits working here also.

Any ideas on how to get this control to work inside of the page?
Cori
Top achievements
Rank 2
 answered on 25 Aug 2010
4 answers
134 views

The following example : http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandradasyncupload/defaultcs.aspx?product=upload
does not appear to work as expected.
If you attempt to upload an invalid file type, you correctly get the error message, but removing the invalid file does not remove the error message, and you can no longer upload a valid file.

Try this:
Click on Add New Record
Select a word doc to upload.
the doc will appear with an red exclamation next to it and an error message appears below.
Remove the file, and attempt to upload a valid gif file, nothing happens. the form continues to think an invalid file is uploaded.
T. Tsonev
Telerik team
 answered on 25 Aug 2010
1 answer
101 views
I have the following code :
<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
   </telerik:RadScriptManager>
  
   <div>
     <telerik:RadAjaxPanel ID="AjaxPanel1" runat="server" LoadingPanelID="LoadingPanel1">
       <div style="float: left; margin: 38px 0s 0 120px; border: solid 1px grey; width: 300px;
           height: 152px;">
           <telerik:RadRotator ID="RadRotator1" runat="server" Width="220px" Height="135px"
               ItemHeight="135" ItemWidth="110" CssClass="positionCenter" ScrollDuration="500"
              >
              <WebServiceSettings Path="RotatorWebService.asmx" Method="GetRotatorData" />
           </telerik:RadRotator>
       </div>
        
   </telerik:RadAjaxPanel>
   </div>
   </form>

Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Web
Imports System.Web.Script.Services
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Web.UI
Imports Telerik.Web.UI
Imports System.Web.UI.WebControls
Imports System.IO
Imports System.Reflection
Imports System.Threading
Imports System.Xml
  
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class RotatorWebService
    Inherits System.Web.Services.WebService
  
    'Private data As DataTable
    Private itemCount As Integer = 5
  
    <WebMethod()> _
Public Function GetRotatorData(ByVal itemIndex As Integer) As RadRotatorItemData()
        If itemIndex >= 11 Then
            Return Nothing
        End If
        Dim result As New List(Of RadRotatorItemData)()
        Dim m_xmlr As XmlTextReader
        'Create the XML Reader
          
  
  
        For i As Integer = itemIndex To itemIndex + (itemCount - 1)
            Dim item As New RadRotatorItemData()
  
            m_xmlr = New XmlTextReader("C:\generated_files\bitems.xml")
            m_xmlr.WhitespaceHandling = WhitespaceHandling.None
            m_xmlr.Read()
  
            m_xmlr.Read()
  
            While Not m_xmlr.EOF
                m_xmlr.Read()
  
                If Not m_xmlr.IsStartElement() Then
                    Exit While
                End If
                Dim genderAttribute = m_xmlr.GetAttribute("book")
                m_xmlr.Read()
                Dim src = m_xmlr.ReadElementString("src")
                Dim link = m_xmlr.ReadElementString("link")
                Dim ii = m_xmlr.ReadElementString("i")
                If (ii = i) Then
                    Dim img As New Image()
                    Dim imgUrl As String = src
                    imgUrl = imgUrl.Replace("~/", HttpContext.Current.Request.ApplicationPath + "/").Replace("//", "/")
                    img.ImageUrl = imgUrl
  
                    img.Width = Unit.Pixel(110)
                    img.Height = Unit.Pixel(135)
                    Dim sw As New StringWriter()
                    Dim writer As New HtmlTextWriter(sw)
                    img.RenderControl(writer)
                    writer.Flush()
                    item.Html = sw.ToString()
                    result.Add(item)
                End If
            End While
            m_xmlr.Close()
  
  
             
        Next
        Return result.ToArray()
    End Function
  
End Class

and the error i get when i run the  page is attached as an image
Fiko
Telerik team
 answered on 25 Aug 2010
10 answers
141 views
I have a rotator that displays a list of stock quotes from a web service I have set up. This service acts as a proxy to an external, third party service that provides us with financial data.

Since our site is under development, I am using their test servers for data. This has revealed the problem with external services... everything comes to a screeching halt while waiting for data from the service. At worst, if the service times out, the page never loads at all. When everything is in production, we should not have these problems, but "should" is not good enough for me.

I've seen through other answers to questions that the Rotator does not support client-side loading. Since this control seems to be oriented towards the use of feeds, I would think that supporting some sort of asynchronous loading would be pretty high on the priority list.

Could you let us know if there are plans to support this... or is there a way to do this that I am overlooking?

Thanks! You guys rock :)
Fiko
Telerik team
 answered on 25 Aug 2010
12 answers
242 views
Good morning:

Has anyone found a good solution for remembering the parameters that were set in the last grid a user worked with?  We're using a pretty simple grid, with filtering, sorting, and paging enabled.  When a user clicks away from the grid page to edit a record on a different page for instance, we'd like to be able to load the page the next time they return to the same grid they were working with when they left, with the sorting, filtering, and paging applied correctly.

We do this with some custom repeater controls we built by using a series of querystring variables, which I guess we could do again here.  Any thoughts you guys have would be helpful.

Thanks; happy Good Friday.

Brad
Pavlina
Telerik team
 answered on 25 Aug 2010
0 answers
95 views
Hello Guys,
I encountred a diffcult spot usig RadScheduler.
I use the scheduler with two resources
    1. Users - a resource of 150 entries (its ok working with it)
    2. Clients - a resource 0f 13,000 entries

When Using the RadScheduler with the client  resource of 13,000 entries it slows down drastically  almost to a halt.
This preformence is unacceptable.
I tried using the advanced form and interfere in the resource control.ascx but it is very complicated there.
i have to use the users and clients as resources because i need grooping and reoccurence and alerts and all the  advanced features.

Did anyone incountered in such a problem? Does anyone  have any solution for that?


 Thanks,
Regards
 Eitan
Roni Lev
Top achievements
Rank 1
 asked on 25 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?