Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
151 views
Hi,
I have a detailsview with a radcombobox in the emptytemplate.  I want to validate this (I am using load on demand).  It seems I need to validate via javascript, but can not get this to working with examples you gave in other forums.  I want to prevent the users from typing in an incorrect code in the combo box - one that does not exist and pass validation.  Here's what I tried:
        function validateCombo(source, args)    
        {    
           args.IsValid = false;  
           var elements = document.getElementsByTagName('*');  
           var count = elements.length;  
           var targetId = 'rcbCAGE';  
           var i;  
           for (i = 0; i < count; i++) {  
                var element = elements[i];  
                var pos = element.id.indexOf(targetId);  
                if(pos >= 0 && element.type == 'text' ) {  
                    //found rad combo element  
                   var text = element.get_text();    
                   var item = element.findItemByText(text);    
                   if (item)    
                   {    
                       args.IsValid = true;    
                   }    
                }  
        } 

The line var text = element.get_test() throws an error that the method is not valid.

Here's a snippet of the HTML page:

        <asp:DetailsView ID="dvCageCode" DataKeyNames="CageCodeID" runat="server" AutoGenerateRows="False" 
            DataSourceID="CAGEData" Height="50px" Width="337px"   
            OnItemCommand="dvCageCode_ItemCommand"   
            OnItemCreated="dvCageCode_ItemCreated"   
            ondatabound="dvCageCode_DataBound"   
            onitemupdating="dvCageCode_ItemUpdating"   
            oniteminserting="dvCageCode_ItemInserting"   
            OnItemInserted="OnItemInserted" 
            OnItemUpdated="OnItemUpdated" 
            CellPadding="10" CommandRowStyle-Height="50px"   
                CommandRowStyle-VerticalAlign="Middle">  
              
<CommandRowStyle VerticalAlign="Middle" Height="50px"></CommandRowStyle> 
              
            <EmptyDataTemplate> 
                <table> 
                    <tr> 
                        <td nowrap="nowrap">Cage Code:</td> 
                        <td nowrap="nowrap">  
                            <telerik:RadComboBox ID="rcbCAGE" runat="server" EnableLoadOnDemand="true" MarkFirstMatch="false" 
                                    OnItemsRequested="rcb_ItemsRequested" OnSelectedIndexChanged="rcb_SelectedIndexChanged" AutoPostBack="true" ShowMoreResultsBox="true"  Skin="Mac" /> 
                            <asp:Label ID="lblCageRequired" runat="server" Text="*" CssClass="RequiredMark" Visible="true" /> 
                            <asp:RequiredFieldValidator ID="rValCageCode" runat="server" Text="Please select a CAGE Code" InitialValue="" ControlToValidate="rcbCAGE" ErrorMessage="*" Enabled="true" SetFocusOnError="true" ValidationGroup="Submit" Display="Dynamic" /> 
                            <asp:CustomValidator ID="cValCAGE"     
                                runat="server"     
                                ControlToValidate="rcbCAGE"    
                                ValidateEmptyText="True"    
                                ClientValidationFunction="validateCombo"    
                                ErrorMessage="Please select a CAGE Code from the list">    
                            </asp:CustomValidator>    
 
                        </td> 
                    </tr> 
                </table> 
            </EmptyDataTemplate> 
 

Thanks in advance for your help.
Gary
Rosi
Telerik team
 answered on 06 Oct 2008
1 answer
629 views

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
Line 2: <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>Line 3:  
Line 4:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


I am using Rad Controls for ASP.net ajax controls on asp.net 2.0
Assembly version = 2008.2.826.20
File Version = 2008.02.0826.20

When I host the site in local machine its works fine, but I get the above mentioned error when I upload it to production server. The production server has ASP.Net 3.5 though. I have also downloaded the specified dll files for 3.5 but that is also not working.

Please advice asap as we are working on a tight schedule.

Kindest Regards
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2008
1 answer
128 views
How would i programmatically email the contents of a grid..

if i export to excel, it sends the file to the browser...

i want to attach the grid to a system.net email class and send it out..

how to do this?


Shinu
Top achievements
Rank 2
 answered on 06 Oct 2008
1 answer
120 views
Hi there,
Is it possible to add paging into the footer of a grid? The reason I ask is I have created a UI where I have my add and editing buttons sitting inside the CommandItemTemplate. I am wanting the paging to sit ontop of my CommandItemTemplate not below.

Currently if I add Paging="true" this displays below my CommandItemTemplate which is not my desired result.

Has anyone done this before or do I need to build some custom paging function?

Thanks
Shane
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2008
5 answers
198 views
Hello

Is there a way to export to CSV all the data in a self-referencing hierarchy grid?

I am using this command to export to CSV. But this only exports the data of the Parent.
RadGrid.MasterTableView.ExportToCSV();

I tried different solution in the forums but it is still not working. Any help on this matter?

Anette
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2008
1 answer
170 views
If I have this in the ASPX

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Outlook" Width="190px" ExpandMode="MultipleExpandedItems">   
  <CollapseAnimation Duration="100" Type="None" /> 
  <ExpandAnimation Duration="100" Type="None" /> 
</telerik:RadPanelBar> 

And I try to do this from C#

var m1 = new RadPanelItem("item 1"); 
m1.Items.Add(new RadPanelItem("sub1")); 
m1.Items.Add(new RadPanelItem("sub2")); 
m1.Items.Add(new RadPanelItem("sub3")); 
RadPanelBar1.Items.Add(m1); 
 
var m2 = new RadPanelItem("item 2"); 
m2.Items.Add(new RadPanelItem("sub1")); 
m2.Items.Add(new RadPanelItem("sub2")); 
m2.Items.Add(new RadPanelItem("sub3")); 
RadPanelBar1.Items.Add(m2); 

It works fine, however when I try to add custom content rather than RadPanelItems like this:

var m1_d = new RadPanelItem("item custom"); 
m1_d.Controls.Add(new Label() { Text = "sub1", ID = "s1" }); 
m1_d.Controls.Add(new Label() { Text = "sub2", ID = "s2" }); 
m1_d.Controls.Add(new Label() { Text = "sub3", ID = "s3" }); 
RadPanelBar1.Items.Add(m1_d); 

while I see the results on the page when clicking on the header the panel bar would not collapse. From a quick look at the rendered HTML the rpExpandable CSS class is not applied in the later case (when adding labels) -- not sure if this makes a difference or not.

Thanks.

P.S. this behavior is not browser specific.
Peter Zolja
Top achievements
Rank 1
 answered on 05 Oct 2008
5 answers
354 views
Hi,

I have created a CrossTab routine which populates a RadGrid.  I always no there will be a "Project" column in the first column, but the rest are generated as crosstabs based on the date criteria.

I need to enable filtering on the Projet column, but remove it programatically from all other columns.

How do I do this?

I tried capturing the column in PreRender and looking for col.AllowFiltering but this doesnt appear to be an option?

Thanks

i
Stephen
Top achievements
Rank 1
 answered on 05 Oct 2008
2 answers
148 views
Hi,
I'm using a TreeView with ExpandMode=ServerSideCallback and it's working fine. However, in certain situations I want to reload from a certain node (and all its children), without having to reload all the other nodes which were already loaded.
A situation for example where I might need it - a popup window was opened, where some data changes can be made. Once it is saved or closed, a client-side function in my page is called, and now I want to reload some data from the server which would update a relevant node (but again, without having to reload the whole tree).
How can I achieve this?
Amit
Top achievements
Rank 1
 answered on 05 Oct 2008
2 answers
151 views
Hi,

I placed a couple of RadSliders to the RadGrid's popup edit window and now I have a problem with sliders when scrolling the popup's content. All the other content scrolls as they should but RadSlider does not scroll at all. Do I have to redraw radsliders somehow or what can I do to fix this one?

Thanks
Pete
Top achievements
Rank 1
 answered on 05 Oct 2008
6 answers
243 views
I am new to RAD controls, and have a very simple question about technique.

Previously, our Calendar form used the Calendar control that ships with VS2008.

We ran a VB server procedure to update the form.

I swapped-in the new RADCalendar control, and tried to do the minimal amount of work to get the form running.

I found that setting AutoPostback to "true", along with EnableViewState to "true", would send me back to the server, where I would read the selected date and rebuild the form.

Works fine, but defeats the advantages of a client control for browsing dates.

Still a novice in JavaScript, I think I should disable AutoPostback, trap the SelectedDate change event, then postback to update the page contents from the database.

This is probably 2-3 lines, but in a language where I am stuck on chapter one of JavaScript for Dummies - Slow Learner Edition.

Can somebody point me in the right direction? Thanks
Scott
Top achievements
Rank 1
 answered on 05 Oct 2008
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?