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

I have a form I'm working on where I would like to update 2 RadComboboxes when 1 is changed. 

What I'm finding is when I call requestItems() that it does it for the first child box, but not the second.

Has anyone figured out a way to do this?

Sample code is below:

<%@ Page Language="VB" Trace="false" %> 
<%@ 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"> 
 
<script runat="server">  
 
       
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)  
      
        Dim cmbo As New RadComboBox  
        cmbo.ID = "RadComboBox1" 
        cmbo.EnableLoadOnDemand = True 
        cmbo.Filter = RadComboBoxFilter.StartsWith  
        cmbo.AllowCustomText = False 
        cmbo.MarkFirstMatch = True 
        cmbo.EmptyMessage = "Data not found" 
        cmbo.Width = 186 
        cmbo.OnClientSelectedIndexChanging = "goLoadCountries" 
        cmbo.OnClientItemsRequesting = "buildForm" 
        AddHandler cmbo.ItemsRequested, AddressOf RadComboBox1_ItemsRequested  
 
        Dim l As New Label  
        l.ID = "Label1" 
        l.AssociatedControlID = cmbo.ID  
        l.Text = "Continent: " 
 
        divPrompts.Controls.Add(l)  
        divPrompts.Controls.Add(cmbo)  
                 
          
        ' build more combox, done after the above code so the items requested fires for #1  
        cmbo = New RadComboBox  
        cmbo.ID = "RadComboBox2" 
        cmbo.EnableLoadOnDemand = False ' this needs to be set to false to not allow the user from inputting their own values  
        'cmbo.Filter = RadComboBoxFilter.StartsWith  
        cmbo.AllowCustomText = False 
        cmbo.MarkFirstMatch = True 
        cmbo.EmptyMessage = "Data not found" 
        cmbo.Width = 186 
        cmbo.OnClientSelectedIndexChanging = "goLoadCountries" 
        cmbo.OnClientItemsRequesting = "buildForm" 
        cmbo.OnClientItemsRequested = "ItemsLoaded" 
        cmbo.Attributes.Add("parent", "RadComboBox1")  
        AddHandler cmbo.ItemsRequested, AddressOf RadComboBox1_ItemsRequested  
 
        l = New Label  
        l.ID = "Label2" 
        l.AssociatedControlID = cmbo.ID  
        l.Text = "Country: " 
 
        divPrompts.Controls.Add(l)  
        divPrompts.Controls.Add(cmbo)  
                 
          
        cmbo = New RadComboBox  
        cmbo.ID = "RadComboBox3" 
        cmbo.EnableLoadOnDemand = False 'True  
        'cmbo.Filter = RadComboBoxFilter.StartsWith  
        cmbo.AllowCustomText = False 
        cmbo.MarkFirstMatch = True 
        cmbo.EmptyMessage = "Data not found" 
        cmbo.Width = 186 
        cmbo.OnClientSelectedIndexChanging = "goLoadCountries" 
        cmbo.OnClientItemsRequesting = "buildForm" 
        cmbo.OnClientItemsRequested = "ItemsLoaded" 
        cmbo.Attributes.Add("parent", "RadComboBox1")  
        AddHandler cmbo.ItemsRequested, AddressOf RadComboBox1_ItemsRequested  
 
        l = New Label  
        l.ID = "Label3" 
        l.AssociatedControlID = cmbo.ID  
        l.Text = "City: " 
 
        divPrompts.Controls.Add(l)  
        divPrompts.Controls.Add(cmbo)  
          
          
        If Not Page.IsPostBack Then  
            'fill the continents combo  
            RadComboBox1_ItemsRequested(divPrompts.FindControl("RadComboBox1"), New RadComboBoxItemsRequestedEventArgs)  
        End If  
 
          
    End Sub  
 
    Protected Sub RadComboBox1_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)  
        Dim cmbo As RadComboBox = DirectCast(o, RadComboBox)  
        cmbo.Items.Clear()  
 
        Select Case cmbo.ID  
            Case "RadComboBox1"  
                For y As Integer = 0 To 10  
                    cmbo.Items.Add(New RadComboBoxItem(y, y))  
                Next  
            Case Else  
                cmbo.Items.Add(New RadComboBoxItem("Box 1 value: " & e.Context("RadComboBox1").ToString(), e.Context("RadComboBox1").ToString()))  
        End Select  
   
 
    End Sub  
      
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;">  
    <head id="Head1" runat="server" > 
    <title></title>  
    </head> 
    <body style="height:100%;margin:0px;" scroll="no" > 
    <form id="form1" method="post" runat="server" style="height:100%;margin:0px;">  
       <telerik:radscriptmanager ID="RadScriptManager1" runat="server">  
        </telerik:radscriptmanager> 
       
            <div id="divPrompts" runat="server" > 
              
            </div> 
 
        <script type="text/javascript">  
 
function goLoadCountries(combo, eventArqs)  
{  
    var item = eventArqs.get_item();  
    var prompt;  
 
    combo.tempVal = item.get_value();  
 
 
    for (i = 0; i < Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++) {  
        prompt = Telerik.Web.UI.RadComboBox.ComboBoxes[i];  
 
        if (prompt.get_attributes().getAttribute("parent") == combo.get_id()) {  
            prompt.set_text("Loading...");  
            prompt.requestItems(item.get_value(), false);  
 
        }  
    }  
}  
 
 
function ItemsLoaded(combo, eventArgs) {  
    if (combo.get_items().get_count() > 0)  
    {  
        combo.get_inputDomElement().className = "rcbInput";  
        var item = combo.get_items().getItem(0);  
        item.select();  
    }  
}  
 
 
function buildForm(sender, eventArgs){  
    var context = eventArgs.get_context();  
    for (i=0; i<Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++){  
        context[Telerik.Web.UI.RadComboBox.ComboBoxes[i].get_id()] = Telerik.Web.UI.RadComboBox.ComboBoxes[i].tempVal;  
    }  
}  
        </script> 
 
        </form> 
    </body> 
</html> 
 
Simon
Telerik team
 answered on 24 Jul 2009
1 answer
61 views
Hi,

I am using telerik window to perform some business logic. I want to close the window when a server side button is clicked. i am using the below code to do the same which is working on firefox and safari but not on IE 7.

could you please let me know the issue???

code:

string strClientScript = string.Format(@"
            <script type='text/javascript'>
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if(window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                var currentWindow = oWindow;
                currentWindow.Close('{0}');
            </script>", jsonText);
            lblCloseWindow.Text = strClientScript;


Thanks,
Mahesh
Svetlina Anati
Telerik team
 answered on 24 Jul 2009
1 answer
137 views
I have 2 grids on 1 page and I am trying to change the page of each grid in one client side event.  What is happening is the last call is the only one that is performed.  I have tried multiple ways of changing the page. And still get the same result.  Is this a known issue and is there a workaround.
TableView1 = $find("<%= TableView1.ClientID %>").get_masterTableView();  
TableView2 = $find("<%= TableView2.ClientID %>").get_masterTableView();  
 
function ChangePages(argument) {  
//Method 1  
TableView1.page(argument);  
TableView2.page(argument);  
//Method 2  
TableView1.set_currentPageIndex(page);  
TableView2.set_currentPageIndex(page);  
} 

Thanks
Georgi Krustev
Telerik team
 answered on 24 Jul 2009
6 answers
396 views
Hi,

I am using Prometheus v2007.3.1314.35, and have come across this error when using the RadAjaxManager and text from our ASP.NET App_GlobalResources\Resource.resx file.

Within the Resource.resx file I have a key btnSubmit with text value "Submit".
The text is displayed within the submit button correctly, & within the UpdatePanel, but if I try to use any Resource text on the page before or after the RadAjaxManager an error is thrown.

Here is the code to replicate the error.

For the page to work remove:
(Some Text outside asp:UpdatePanel "<%= Resources.Resource.btnSubmit %>")

<

asp:ScriptManager ID=ScriptManager1 runat=server />

<p />

Some Text outside asp:UpdatePanel "<%= Resources.Resource.btnSubmit %>"

<p />

 

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

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="updPanel1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="updPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="30" BackColor="#E0E0E0" InitialDelayTime="500">

<asp:Image ID="Image1" runat="server" ImageUrl="~/images/icons/loading.gif" BorderWidth="0px" AlternateText="Loading" ></asp:Image>

</telerik:RadAjaxLoadingPanel>

<asp:UpdatePanel ID="updPanel1" runat="server" UpdateMode=Conditional ChildrenAsTriggers=true >

<ContentTemplate>

<p />

<asp:Label ID=Label1 runat=server Text="Button Clicked at " />

<p />

<asp:Button ID=Button1 runat=server OnClick="Button1_Click" Text="<%$ Resources:Resource,btnSubmit %>" />

<p />

Same Text within asp:UpdatePanel "<%= Resources.Resource.btnSubmit %>"

</ContentTemplate>

</asp:UpdatePanel>

Any Ideas?
Thanks

rtk
Top achievements
Rank 1
 answered on 24 Jul 2009
1 answer
53 views
Chrome is adding extra space below nodes when loading on demand via WCF. This issue can be seen on your own demo:


Your other demos do not cause this issue, but I can't pinpoint what is causing this issue on my own version of the tree on my site using 2009.2.713.35.
Alex Gyoshev
Telerik team
 answered on 24 Jul 2009
2 answers
161 views
I open a new RadWindow. Before the window is closed i put the ClientID of a RadTextBox which is a control on the window in the argument. On my page (which opened the window) i have a handler for the ClientClose-Event. There i take the ClientID and would like to paste the Text of the RadTextBox in a other RadTextBox on my page (which opened the window). I have the problem that the variable f is not definied, the $find not work. What is wrong?

function radWindowMemo_OnClientClose(window) 
{ 
  alert(window.argument); // it shows the correct ClientID!
  var f = window.BrowserWindow.$find(window.argument); // f is not defined!
  // ... Paste f.value in other RadTextBox
} 
 


Rainer Goos
Top achievements
Rank 1
 answered on 24 Jul 2009
13 answers
206 views
c



SANNIDHI   
 Posted on Jul 11   
 

I posted this post on Jul11 there is no reply..


IS telerik will supprt Export to PDf in Multicolumn Headers??????????????????????

No support Say NO?????????????? okkkkkkkkkkkkk
Hi,  
 
     I want to export to pdf in TelerikGrid.I am using follwing code  
 
< 
 
   
 
telerik:GridBoundColumn DataField="Partner Name" UniqueName="PartnerName" HeaderText="PartnerName"   
 
   
 
 
   
 
HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="left">   
 
   
 
 
   
 
</telerik:GridBoundColumn>   
 
   
 
 
   
 
<telerik:GridBoundColumn DataField="Rank" UniqueName="Rank" HeaderStyle-HorizontalAlign="Center"   
 
   
 
 
   
 
ItemStyle-HorizontalAlign="Right" HeaderText="Rank">   
 
   
 
 
   
 
</telerik:GridBoundColumn>   
 
   
 
 
   
 
<telerik:GridBoundColumn DataField="Rank1" UniqueName="Rank1" HeaderStyle-HorizontalAlign="Center"   
 
   
 
 
   
 
ItemStyle-HorizontalAlign="Right" HeaderText="Rank1">   
 
   
 
 
   
 
</telerik:GridBoundColumn>   
 
   
 
 
   
 
<telerik:GridTemplateColumn UniqueName="Column1" InitializeTemplatesFirst="true">   
 
   
 
 
   
 
<HeaderTemplate>   
 
   
 
 
   
 
<table id="Tabfy08" cellspacing="0" style="width: 100%;">   
 
   
 
 
   
 
<tr>   
 
   
 
 
   
 
<td colspan="2" align="center">   
 
   
 
 
   
 
<b>COULMNSHEADER</b>   
 
   
 
 
   
 
</td>   
 
   
 
 
   
 
</tr>   
 
   
 
 
   
 
<tr>   
 
   
 
 
   
 
<td style="width: 50%; border-style: none;" align="center">   
 
   
 
 
   
 
<asp:Label ID="lblfy08" Text="Rank" runat="server" />   
 
   
 
 
   
 
</td>   
 
   
 
 
   
 
<td style="width: 50%; border-style: none;" align="center">   
 
   
 
 
   
 
<asp:Label ID="lblesa08" Text="Rank1" runat="server" />   
 
   
 
 
   
 
</td>   
 
   
 
 
   
 
</tr>   
 
   
 
 
   
 
</table>   
 
   
 
 
   
 
</HeaderTemplate>   
 
   
 
 
   
 
<ItemTemplate>   
 
   
 
 
   
 
<table cellspacing="0" width="100%" class="myTable">   
 
   
 
 
   
 
<tr>   
 
   
 
 
   
 
<td style="width: 50%">   
 
   
 
 
<%  
 
# Eval("Rank")%>   
 
   
 
   
 
 
</td>   
 
   
 
 
   
 
<td style="width: 50%">   
 
   
 
 
<%  
 
# Eval(" Rank1")%>   
 
   
 
   
 
 
</td>   
 
   
 
 
   
 
</tr>   
 
   
 
 
   
 
</table>   
 
   
 
 
   
 
</ItemTemplate>   
 
   
 
 
   
 
<ItemStyle HorizontalAlign="Center" />   
 
   
 
 
   
 
</telerik:GridTemplateColumn> 
 
I want to export to pdf which has template columns.  
 
For that i am using following code  
 
 
 
   
 
MYGRID.ExportSettings.ExportOnlyData =   
 
true;   
 
   
 
MYGRID.ExportSettings.IgnorePaging =   
 
 
true;   
 
   
 
MYGRID.ExportSettings.OpenInNewWindow =   
 
 
true;   
 
   
 
 
 
 
MYGRID.MasterTableView.HierarchyDefaultExpanded =   
 
true;   
 
   
 
MYGRID.ExportSettings.ExportOnlyData =   
 
 
true;   
 
   
 
MYGRID.MasterTableView.ExportToPdf();  
 
 
 In Button Click Event...............  
 
But i am not getting the result of template columns in PDF..  
 
Is Telerik Grid Support this????????????????Please Clarify this ASAP..ASAP  
 
Thanks in Advance  
SANNIDHI 
ManniAT
Top achievements
Rank 2
 answered on 24 Jul 2009
1 answer
76 views
I have a shopping cart where the Item Number has precedding zeros such as "00033" when it comes in to the grid it shows as "33".  I have a have the DataType set to System.String.  Any ideas on how I can fix this?  I have Q2 2008 Rad Grid.
Georgi Krustev
Telerik team
 answered on 24 Jul 2009
2 answers
126 views
Hi Telerik,

    I have a problem with RadColorPicker as the ICON overlaps the ASP Menu Dropdown and hides the menuitems. Below is a link of the screenshot edited for you to understand the issue. Please have a look into it.

http://img520.imageshack.us/i/radcolorpicker.png/

Also, the colorpicker tag i have given in the design page is

<telerik:RadColorPicker runat="server" ID="RadColorPicker" ShowIcon="true">

Do I have to add anything to make it look perfect (i.e.,) It does not overlap the ASP menu dropdown. Or is this a bug from your side?

Hoping to get an early reply.

Thank you in Advance.

Cheers,
Raj Maverick.

Raj Maverick
Top achievements
Rank 1
 answered on 24 Jul 2009
5 answers
149 views
Hello,

I have a RadWindow (R2) that opens up from a Link Button on another RadWindow (R1). Through javascript I set the parent window of R2 to the parent of R1 to enable R2 to expand past the bounds of R1. I want R2 to open up maximized in the parent of R1 when the user clicks the link button. I have achieved this to some extent. In R2's page load section of the code behind the page, I set a label equal to a javascript function on R2's html page to maximize the RadWindow: 

 

protected void Page_Load(object sender, EventArgs e)     
{   
    if ((Label1.Text == "<script>CloseWin();</script>")    
        || (Label1.Text == ""))     
    {  
            Label1.Text = "<script>MaximizeWin();</script>";   
    }   
else 
    {    
            Label1.Text = "";     
    }  
} 

 

 

function MaximizeWin() {   
var oWindow = GetRadWindow();   
oWindow.maximize();  
}  
function CloseWin() {    
var oWindow = GetRadWindow();    
oWindow.Close();  
}  
 

This works to maximize R2; however, after I close R2 (setting the label's text equal to a javascript function CloseWin()) and then click the link button again, R2 opens maximized for like half a second and then moves. Instead of the top left corner of R2 being in the top left of the parent page, it is now in the center of the parent page. I'm not sure why this happens when opening R2 as there is another link button on R1 that opens another Radwindow (R3) the same way, and R3 always opens up maximized and never moves after opening. I'm really confused because R3 works fine because I created R2 by copying and pasting everything I used to make R3, with the exception of the NavigateURL's of the RadWindows.

If any more info is needed, please let me know.

Thanks

Fiko
Telerik team
 answered on 24 Jul 2009
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?