Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
227 views
I'm not even sure this can be done, but here goes:

What I am trying to do is avoid database hits on every character entered in a Load-On-Demand RadComboBox.  When one character is entered, I go to the database and get the resulting dataset.  Any further characters entered will filter that same dataset.  The only time the database is accessed is when the first character is entered.  Is this even possible? If so, any pointers?
Ivana
Telerik team
 answered on 01 Dec 2011
4 answers
241 views
Hi Everone

Can some one tell me why i get this error
Microsoft JScript runtime error: Object doesn't support property or method 'get_items'

when i execute the following js code
var listbox = document.getElementById("<%=rlbCustomEmails.ClientID %>");
var item = new Telerik.Web.UI.RadListBoxItem();
item.set_text(email);
listbox.get_items().add(item); //I get the error here

it is searching for this control
<telerik:radlistbox runat="server" style="position: absolute; top: 290px; left: 400px;"
        height="240px" width="255px" ID="rlbCustomEmails"></telerik:radlistbox>

KobusVisagie
Top achievements
Rank 1
 answered on 01 Dec 2011
1 answer
83 views
Hi,

The look of grouping (in the data area of a grid) consists of three elements:
  • the group header
  • the cell to the left of the group header, containing icons for expanding / collapsing; let's name it "the control cell"
  • cells the the left of data rows; let's name them "filling cells"

I'm using the Simple skin and Q1 2010 version of the controls.
All these elements have initially the same, darkgray background. The control cell (and its column) is quite wide. I would like to change two aspects of their look:

  • the back color of all of them
  • the width of the control cell and the filling cells

I tried to use GroupHeaderItemStyle. Changing its BackColor changed the back color of the header and the filling cells - but the control cell remained untouched. Changing its Width changed nothing.
I tried to modify Grid.Simple.css file. I've succeeded in changing the back color of all the required elements. But I cannot make the column with the control and filling cells narrower. The MasterTableView is rendered with the "colgroup" element wich contains 20px width of this column. This is the key - is it possible to me to change this value?

Regards
Tomasz

Mira
Telerik team
 answered on 01 Dec 2011
2 answers
176 views
Hello.

I have a Grid with an EditMode="Popup". I would like to display a gif image (an animated wheel or anything else) while the popup window is loading (this takes around 1 or 2 seconds).

How can I do this?

Thanks for you help
Regards
Augusto
Augusto
Top achievements
Rank 1
 answered on 01 Dec 2011
2 answers
152 views
Dear all,
I want to write a javascript function  to check a List using CheckBOX in RADGRID below:

If there is no item is checked=> return false;
If there is one or more item(s) is checked=> return true;

Please help me to do it
Thanks alot,
Ky
Top achievements
Rank 1
 answered on 01 Dec 2011
5 answers
378 views
Hello ,

am using  RadAsyncUpload .
below is my code

 

//To validate upload control.
       function validationFailed(sender, eventArgs) {
           $telerik.$(".ErrorHolder").html("");
           $(".ErrorHolder").append("<p>Attachment exceeding the maximum total size for the file '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
       }
       //Remove Error Message.
       function RemoveErrorMessage(sender, eventArgs) {
           $(".ErrorHolder").fadeOut("slow");
       }

 


 

<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload" MultipleFileSelection="Disabled" TemporaryFolder="attachments"
                            TargetFolder="attachments" MaxFileSize="524288" OnFileUploaded="RadAsyncUpload_FileUploaded"  
                            OnClientValidationFailed="validationFailed" MaxFileInputsCount="1" OnClientFileUploadRemoved="RemoveErrorMessage">
                        </telerik:RadAsyncUpload>


 

public void RadAsyncUpload_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            Label fileName = new Label();
            fileName.Text = e.File.FileName;
            string strFileName = string.Empty;
  
            if (itotalBytes < iMaxTotalBytes)
            {
                // Total bytes limit has not been reached, accept the file
                e.IsValid = true;
                itotalBytes += e.File.ContentLength;
            }
            else
            {
                // Limit reached, discard the file
                e.IsValid = false;
            }
  
            if (e.IsValid)
            {
                string targetFolder = RadAsyncUpload.TargetFolder;
                strFileName = e.File.FileName;
                //If same file uploaded again then it will overwrite.
                e.File.SaveAs(Path.Combine(Server.MapPath(targetFolder), strFileName));
            }
        }

It creates RadUploadTestFile file by default in attachment folder.
Why so?? Can we avoid that?

Plus it creates some wired ext file which i upload ... :(

Mugdha Aditya
Top achievements
Rank 1
 answered on 01 Dec 2011
2 answers
109 views
Hi,
i'm trying to Show and Position the RadDialog on the screen ,but i can't find a way to control the position. So i want to know how can I make ti?
Thank you.
c
Top achievements
Rank 1
 answered on 01 Dec 2011
1 answer
137 views
I am trying to include an user control inside radwindow and trying to open it using readopen but unfortunately this
is not working for me.
<telerik:RadWindow runat="server" ID="RadWindow1" Skin="Vista" KeepInScreenBounds="true" VisibleOnPageLoad="false" Modal="true" Title="Search Client"
       Behaviors="Close,Maximize,Move" Width="500" Height="500">
       <ContentTemplate>
           <cti:ucSearchClient ID="searchClient" runat="server" /> 
       </ContentTemplate>
   </telerik:RadWindow>

On a button click we are trying to call the following javascript method.

function openWindow() {
            var oWnd = radopen(null, "RadWindow1");
        }

Can you please let me know is there a way to open user control using radwindow and get the selected row values into the main page?

we noticed another issue that if we are using Rad Button in place of Html or ASP.net button, it is calling javascript on pageload even before we click and throws error.

Shinu
Top achievements
Rank 2
 answered on 01 Dec 2011
0 answers
154 views
Hi All,

I am new to telerik controls. I really appreciate if you can help me in solving this issue which i have already wasted a lot of time.

Issue:

I have a content page(say Page1) which contains a radComboBox with few items. I have a search image icon to which opens a window popup( this is not radwindow, but ordinary window popup opened using window.open method, cannot use rad window as it is giving issues in the design). Now from the popup i will select an item in the grid, the selected item is an item contained in the rad combo box present in parent page. So based on the item selected in the popup i need to set the item in parent combo box.

I have tried this in the javascript method in the popup page,

var

myarray = window.dialogArguments[0]; 

 

var dd = myarray.parent.document.getElementById("ctl00_ContentBody_radComboPaymentTerms_DropDown")
dd.set_text(selectedvalue);

but this didnt work. it gives an error 'object doesn't support this prop'.

please let me know if there is any other way to solve this issue.

 


Thanks in advance,
Sooraj.S
Sooraj
Top achievements
Rank 1
 asked on 01 Dec 2011
4 answers
203 views

Hi Telerik,

I'm encountering the error below when i tried to use the arrow to in my radgrid to move the page to the next/previous page. The weird thing is when i move the page by clicking on the page number instead of the arrow im not encountering the error. Below is a sample code that recreates the error i'm encountering.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

ASPX:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication9.WebForm1" %>
  
<%@ 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">
  
<head runat="server">
    <title></title>
</head>
<body >
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server" />
        <asp:Label ID="lbl_Notification" runat="server" Font-Bold="true" Font-Size="Large" Text="No Row right clicked" />
        <br />
        <telerik:RadGrid ID="RadGrid1" runat="server" 
            AllowFilteringByColumn="true"
            AutoGenerateColumns="false"
            AllowPaging="true" 
            AllowSorting="true" 
            ShowGroupPanel="true" 
            OnNeedDataSource="RadGrid1_NeedDataSource" 
            OnItemDataBound="RadGrid1_ItemDataBound"
            PageSize="15">
            <MasterTableView GroupLoadMode="Client" TableLayout="Fixed" >
                <Columns>
                    <telerik:GridBoundColumn DataField="item1" HeaderText="Item1" />
                    <telerik:GridBoundColumn DataField="item2" HeaderText="Item2" />
                    <telerik:GridBoundColumn DataField="item3" HeaderText="Item3" />
                    <telerik:GridBoundColumn DataField="item4" HeaderText="Item4" />
                    <telerik:GridBoundColumn DataField="item5" HeaderText="Item5" />
                </Columns>
            </MasterTableView>
            <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" 
                AllowDragToGroup="True" AllowColumnsReorder="True" EnableRowHoverStyle="True" />            
            <FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
    </form>
</body>
</html>

C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Collections.ObjectModel;
  
namespace WebApplication9
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //If i remove the binding on page load the error with regards to the post back is not encountered 
            //when clicking the arrow and the number. However the label is not properly updated and the radcontextmenu is no longer 
            //available on right click after postback.
            RadGrid1.Rebind();
        }
  
        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            ObservableCollection<GridItem> items = new ObservableCollection<GridItem>();
            for (int i = 0; i < 20; i++)
                items.Add(new GridItem(i + 1));
  
            RadGrid1.DataSource = items;
        }
  
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.DataItem != null && e.Item.DataItem.GetType() == typeof(GridItem))
            {
                var menu = new RadContextMenu();
                menu.Targets.Add(new ContextMenuElementTarget() { ElementID = e.Item.ClientID, });
  
                RadMenuItem menu1 = new RadMenuItem("Menu1");
                menu1.Value = (e.Item.ItemIndex + 1).ToString();
                menu1.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
                RadMenuItem menu2 = new RadMenuItem("Menu2");
                menu2.Value = (e.Item.ItemIndex + 1).ToString();
                menu2.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
                RadMenuItem menu3 = new RadMenuItem("Menu3");
                menu3.Value = (e.Item.ItemIndex + 1).ToString();
                menu3.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
                RadMenuItem menu4 = new RadMenuItem("Menu4");
                menu4.Value = (e.Item.ItemIndex + 1).ToString();
                menu4.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
                RadMenuItem menu5 = new RadMenuItem("Menu5");
  
                RadMenuItem subItem1 = new RadMenuItem("subMenu1") { Value = (e.Item.ItemIndex + 1).ToString() };
                subItem1.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
  
                RadMenuItem subItem2 = new RadMenuItem("subMenu2") { Value = (e.Item.ItemIndex + 1).ToString() };
                subItem2.Attributes["Column1"] = (e.Item.DataItem as GridItem).item1;
  
                menu5.Items.Add(subItem1);
                menu5.Items.Add(subItem2);
  
                menu.Items.Add(menu1);
                menu.Items.Add(menu2);
                menu.Items.Add(menu3);
                menu.Items.Add(menu4);
                menu.Items.Add(menu5);
                menu.ItemClick += new RadMenuEventHandler(menu_ItemClick);
                RadGrid1.Controls.Add(menu);
            }
        }
  
        void menu_ItemClick(object sender, RadMenuEventArgs e)
        {
            lbl_Notification.Text = e.Item.Text + "selected from the radcontextmenu for\nRow " + e.Item.Value + "\n with Column1= " + e.Item.Attributes["Column1"];
        }
    }
  
    public class GridItem
    {
        public string item1 { get; set; }
        public string item2 { get; set; }
        public string item3 { get; set; }
        public string item4 { get; set; }
        public string item5 { get; set; }
  
        public GridItem(int rowNum)
        {
            item1 = "dsadas" + rowNum;
            item2 = "dsadas" + rowNum;
            item3 = "itdsadsaem" + rowNum;
            item4 = "idsadsatem" + rowNum;
            item5 = "itedsadam" + rowNum;
        }
    }
}

C#
Shinu
Top achievements
Rank 2
 answered on 01 Dec 2011
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?