Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
133 views
I have a tool tip that loads over a control. The tool tip contains a few RadComboBox's. It appears possible to click inside the combobox and the event is transferred to the control below.

I created simple page with a tooltip that loads over a RadCalendar and was able to reproduce. Am I missing something here or is this a bug?  I am using  2009.1 527 (May 27, 2009) and IE 8

It also appears to work fine in compatibility View.

<asp:Label ID="Label2" runat="server" Text="Hello World!"></asp:Label> 
        <telerik:RadToolTip ID="RadToolTip1" runat="server" Height="180px" Width="235px" TargetControlID="Label2" ManualClose ="true">  
            <table> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox2" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox3" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox4" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr>             
              
            </table> 
        </telerik:RadToolTip>       
        <telerik:RadCalendar ID="RadCalendar2" runat="server" Font-Names="Arial, Verdana, Tahoma" 
            ForeColor="Black" Style="border-color: #ececec">  
        </telerik:RadCalendar>     
Georgi Tunev
Telerik team
 answered on 10 Jul 2009
1 answer
85 views
I created a custom web user control simply with a drop down box and an image.
I have a javascript on the user control to capture the click on the image and automatically fire off the drop down box (similar to your TimePicker)
Very simple.....

<

 

script language="javascript" type="text/javascript">

 

 

 

function SetFocus() {

 

 

var comboBox = $find("<%=cboTime.ClientID %>");

 

 

var input = comboBox.get_inputDomElement();

 

 

input.focus();

}

 

 

</

 

script>

 

 

 

<

 

telerik:RadComboBox ID="cboTime" Runat="server" Width="100px" AllowCustomText="true">

 

 

 

</

 

telerik:RadComboBox>&nbsp;&nbsp;<a href="JavaScript:SetFocus()"><asp:Image id = "imgClock" alt="Time" style="height:15; width:15;" runat="server" /></a>

 

 

 

 

 


I have placed 2 of the user controls on my page.

My problem is when I click on either of the images, the focus goes to the last instance of the drop down box.
I looked at the generated code and it appears that the script is in there both times and since the script is named the same, the last definition overwrites any earlier versions.

How do I uniquely define the script so that the click knows which drop down to get focus?
Also I'd like to fire the drop down instead of just focus...which event do I use?

Thanks
Greg
Veselin Vasilev
Telerik team
 answered on 10 Jul 2009
0 answers
84 views
Hi,

        I have a problem in sql, my value is 62.69 and if i split that values in "%" then 

  •     20% = 12.5380
  •     30%=18.8070
  •     50%=31.3450

    The sum of this Total will be 62.69

But i need only decimal with 2 percision then the values "%" value would be like this

  •     20% = 12.54 (rounded as 12.54  for(12.5380)
  •     30%=18.81 (rounded as 12.54  for(18.8070)
  •     50%=31.35 (rounded as 12.54  for(31.3450

        The Sum of the Total will be 62.70.

So how to handle such case, can any one help me out in this

Thanks,
Jayashree.S

 

Jayashree
Top achievements
Rank 1
 asked on 10 Jul 2009
1 answer
331 views
Hi,

I like to have a grid, which displays pictures like in your examples. in my testsite I have a small data table which contains the binary image and the name of the image. But for some reason the grid doesn't get bind properly. It shows no records, but the database contains three records. No matter if I create a dataset or use my openaccess datasource. I've changed some things in the code but the most code point to your examples:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=binaryimage



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="ProtelShop.Admin.test1" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" namespace="Telerik.OpenAccess" tagprefix="telerik" %> 
<!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">  
      
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:radscriptblock id="RadScriptBlock1" runat="server">  
            <script type="text/javascript">  
            //On insert and update buttons click temporarily disables ajax to perform upload actions  
            function conditionalPostback(sender, args)  
            {  
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");  
    
                if (args.get_eventTarget().match(theRegexp))  
                {  
                    var upload = $find(window['UploadId']);  
     
                    //AJAX is disabled only if file is selected for upload  
                    if(upload.getFileInputs()[0].value != "")  
                    {  
                        args.set_enableAjax(false);  
                    }  
                 }  
             }  
 
             function validateRadUpload(source, e) {  
                 e.IsValid = false;  
 
                 var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);  
                 var inputs = upload.getFileInputs();  
                 for (var i = 0; i < inputs.length; i++) {  
                     //check for empty string or invalid extension  
                     if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {  
                         e.IsValid = true;  
                         break;  
                     }  
                 }  
             }  
 
            </script> 
        </telerik:radscriptblock> 
      
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" clientevents-onrequeststart="conditionalPostback">  
 
    <telerik:radprogressmanager id="RadProgressManager1" runat="server"/>  
<telerik:radgrid runat="server" id="RadGrid1" onitemdatabound="RadGrid1_ItemDataBound" GridLines="None" AllowPaging="true" AllowSorting="true" OnPreRender="RadGrid1_PreRender" 
            PageSize="6">  
             <PagerStyle Mode="NextPrevAndNumeric" /> 
 
 <mastertableview  DataKeyNames="ShopImageID">  
  <columns> 
   
   <telerik:gridtemplatecolumn uniquename="Upload">  
    <itemtemplate> 
     <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %> 
                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' 
                        runat="server">  
                         
 
                        <telerik:RadBinaryImage runat="server" ID="test" DataValue='<%# Eval("Image")%>' /> 
                
                    </asp:Panel> 
      
    </itemtemplate> 
    <edititemtemplate> 
     <telerik:radupload id="RadUpload1" runat="server" /> 
    </edititemtemplate> 
   </telerik:gridtemplatecolumn> 
   </columns> 
   <editformsettings> 
     <editcolumn uniquename="EditCommandColumn1"></editcolumn> 
   </editformsettings> 
   </mastertableview> 
</telerik:radgrid> 
</telerik:RadAjaxPanel> 
        <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"   
            ContextTypeName="" EnableDelete="True" EnableInsert="True" EnableUpdate="True"   
            ObjectContextProvider="ProtelAccess.ObjectScopeProvider1, ProtelAccess"   
             TypeName="ProtelAccess.ShopImage" > 
        </telerik:OpenAccessDataSource> 
    </form> 
</body> 
</html> 
 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.OpenAccess;  
using Telerik.OpenAccess.Query;  
using Telerik.Web.UI;  
using ProtelAccess;  
using ProtelShop;  
using Telerik.Charting;  
using System.Data;  
using System.Drawing;  
using System.IO;  
using System.Drawing.Imaging;  
 
namespace ProtelShop.Admin  
{  
    public partial class test1 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            RadGrid1.DataSourceID"OpenAccessDataSource1";  
            RadGrid1.DataBind();  
    
        }  
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)  
        {  
            int itemCount = (sender as RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + (sender as RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length;  
            foreach (GridItem item in (sender as RadGrid).Items)  
            {  
                if (item is GridDataItem && item.ItemIndex < itemCount - 1)  
                {  
                    ((item as GridDataItem)["shopImageID"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;'><tr><td>"));  
                }  
            }  
        }  
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                RadUpload upload = e.Item.FindControl("RadUpload1") as RadUpload;  
                RadAjaxPanel1.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID));  
 
                  
 
 
            }  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                GridBinaryImageColumnEditor editor = ((GridEditableItem)e.Item).EditManager.GetColumnEditor("Upload") as GridBinaryImageColumnEditor;  
                TableCell cell = (TableCell)editor.RadUploadControl.Parent;  
                CustomValidator validator = new CustomValidator();  
                validator.ErrorMessage = "Please select file to be uploaded";  
                validator.ClientValidationFunction = "validateRadUpload";  
                validator.Display = ValidatorDisplay.Dynamic;  
                cell.Controls.Add(validator);  
            }  
        }  
 
 
 
    }  
}  
 

thanks
Sebastian
Telerik team
 answered on 10 Jul 2009
4 answers
515 views
Hi!

I have a radgrid which has a column that is always rendered in edit mode. The column is declared like this:
...
<
tel:GridTemplateColumn HeaderText="Tillægsværdi"  UniqueName="ShowTillaegProcent"
                            <EditItemTemplate> 
                                <tel:RadNumericTextBox ID="txtTillaegProcent" MinValue="0" MaxValue="100" DataType="System.Decimal" Type="Percent" DbValue='<%# Bind("TillaegProcent") %>' NumberFormat-DecimalDigits="2" Width="50" runat="server" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                  <%# DataBinder.Eval(Container.DataItem, "TillaegProcent")%> 
                            </ItemTemplate> 
                        </tel:GridTemplateColumn>
...

Unfortunately, this makes the grid render very, very slowly. It takes approx. 30 seconds to render about 100 records. As soon as I remove the
DbValue='<%# Bind("TillaegProcent") %>' 
- the grid renders in "normal" time. The performance impact seems to be bigger in IE7 than FF3
How can this be? Is it bad practice to use the DbValue='# Bind.....' syntax?

Best regards

Henrik M Kristensen






Pavlina
Telerik team
 answered on 10 Jul 2009
1 answer
121 views
Hi,

I used RadGrid asp.net for ajax and two radio button is there in my form , when i click  the radio button the skin is not applaying for Radgird control for the first time(page load) after refresh the grid the skin is working fine what was the problem?
Dimo
Telerik team
 answered on 10 Jul 2009
3 answers
168 views
I am using the rad editor version 6.6.3.0.

I put the below code into html view:

<object id="MediaPlayer" width=320 height=288 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components…" type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

<param name="filename" value="My_video.wmv">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">

<embed type="application/x-mplayer2" src="My_video.wmv" originalAttribute="src" originalPath="My_video.wmv" name="MediaPlayer" width=320 height=288></embed>

</object>



When I switched back to design view, the code below is truncated by the editor:

<param name="filename" value="My_video.wmv">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">

When I try to save the file and view it in internet explorer, the video file is unable to play.

Stanimir
Telerik team
 answered on 10 Jul 2009
1 answer
116 views
cannot find NestedViewSettings as it was ordered here http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx;

it seems that property doesn't exists in my version.

what i need is the way to assign to NestedViewTemplate a dataSource, different from MasterTable, preferably programmatically. 

what am i missing?
RadGrid v.2009.1.311.305
Yavor
Telerik team
 answered on 10 Jul 2009
1 answer
100 views
I have a RadGrid that I am using for website users to upload photos and related information.I am using Asp.Net membership services to identify users, and have the database configured to use the UserID (a GUID value) as the foreign key so that uploaded photos are tied to the user who uploaded them.

The grid is working without the foreign key, images being uploaded and displaying, but I have two issues/questions.

(1) When the user edits an image, if the image (or another image) is not selected in the GridBinaryImageColumn then the existing image is deleted (or overwritten with null). What I'd like to have happen is that if no image is selected, I'd like to leave the existing image there.

(2) On insert, I'd like to have the UserID saved to the appropriate column in the SQL table, but I don't want to display it. Once the user is logged in then the UserID is stored in a session variable, but what I want to do is save the UserID value to the appropriate column on an insert. I don't need to worry about it on an update.

Thanks in advance for any insight.
Georgi Krustev
Telerik team
 answered on 10 Jul 2009
1 answer
249 views
I am trying to use a standard RadContextMenu control with either a RadTreeView or the new RadListBox.  I have implemented the OnClientItemClicked event as follows:

function menuItemmClicked(sender, args) {
    var itemTarget = args.get_targetElement();
    ....
}

Is this function supposed to return an object?  Do I need to cast it?
Shinu
Top achievements
Rank 2
 answered on 10 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?