Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
122 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
147 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
3 answers
80 views
Hello!   could you please direct me to a great example of how (on editing a row) to hook up a drop down on the row to a database class.  It can't be a static list on the page.  So far, I've not been able to find an example or figure this out on my own!

thanks in advance! Tim
Princy
Top achievements
Rank 2
 answered on 01 Dec 2011
1 answer
63 views
Greetings!

Is there any way you could share the code that is used in all of the Rad AJAX demos that allows the user to change the skin?

Many thanks!

Matt
Iana Tsolova
Telerik team
 answered on 01 Dec 2011
1 answer
75 views
I am virtually new to r.a.d. Controls since it has been several years.  Sorry for what is probably a simple question.  I am trying to create a hierarchical layer for reporting several normalized tables.  These tables are custom tables.  The data is very simple.  These tables describe a person (whatever is meant by "person") and will include records like basic information (Name, age, yada yada) which is the master, Phone Numbers, Email Addresses, and Mailing Addresses.

The main table is "Person" (Name, age, yada yada) which is the master.
Subtables 2-4 have variying numbers of records per person.  And, in the case of Mailing Address, have several lines of information per record.
 

Showing these as tables works using the  gridtableview.  However, I need to shrink down the content and have a simple 1 or 2 column table for each of these items. all on the same row underneath the person's basic info.  Every time I set up the tables to work and then try to reformat the data, I get a blank line instead of any information.  I have been trying to use a Panel within the NestedViewTemplate control.  It just ends up turning out blank.  I have tried this many ways and cannot figure out what I am doing wrong.

In the end the information should look like :


Person
Field1    Field2  Field3                              
email                Address                             Home Address            Phone1
email                  Alternate Address             Home Address            Phone2

The basic layout that I tried was as follows with several variations:
RadGrid   person
    NestedViewSettings
        Criteria
    NestedViewTemplate
        ASP:Panel
             RadGrid Address -- or -- GridTable View
               (and repeat for phone and Email)
Person Grid's columns                                   

Any help would be greatly appreciated!

--Larry--
Princy
Top achievements
Rank 2
 answered on 01 Dec 2011
3 answers
76 views
Is ther any way to style the update/cancel images in the RadGrid inline-edit mode so that there is more space (padding) between them?
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 answered on 30 Nov 2011
4 answers
1.1K+ views
Hello - I've actually now managed to skin the Scheduler control - however, when I go to edit an existing event in the scheduler, I get:

Telerik.Web.UI.DatePickingInput with ID='dateInput' was unable to find embedded skin with name 'PaleGreen'.

PaleGreen being my custom skin. Now - the skin actually works for the scheduler but the scheduler is obviously generating a nested control of it's own which it assumes should inherit the skin - it looks like it's not inheriting the skin properly.

Also- for a Telerik.Web.UI.DatePickingInput  which set of skin files should I add?

Thanks.
Jon Shipman
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
53 views
I am writing code that needs a box like the ComboBox but with different functionality.  Can someone tell me how to accomplish this?  (either with ComboBox or some other Rad control)

Users will type text they wish to search for in a textbox/combobox type field.  I want it to give common (preset and known) choices that match what they are typing as they type (Like ComboBox Filter function).  If what they wish to type is in the list that appears, I want the user to be able to select it.  So far, this is just like the ComboBox, but here is the hitch.  If what they type is not in the list I want to return the text they type.  I do not want to require them to select form the preselected list, I just want it to help them from what others have searched for in the past.

I hope I said this clearly enough.  I appreciate your help.

P
pjDev
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
112 views
Hi,

I need to have my own custom upload window instead of build-in one in FileExplorer control.
Can you please provide snippet of how I can cancel the default window popping and replace it with my own RadWindow.

Also, one my custom window uploads files, I will need the parent window where all files are visible to be refreshed so newly added files are visible there as well. What would be a snippet for that?

Thanks!
brian
Top achievements
Rank 1
 answered on 30 Nov 2011
2 answers
73 views
Hi
If I do server side validation by using RadInputManager and a code like this : 
radInputManager1.InputSettings[0].Validate(txtName);
                if (!radInputManager1.InputSettings[0].IsValid)
                        return false;

(radInputManager1.InputSettings[0] does a regular expression validation on txtName)

and if the posted data was invalid (by disabling javascript in client or any why that that the user bypassed the javascript validation)
Can I be sure that the validation is done correctly on the server side?
I mean , can user manipulate the regular expression or IsRequired field in a way that cause server side validation return InCorrect result too ?

Thank you very much for your feedback
reza
Top achievements
Rank 1
 answered on 30 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?