Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
109 views
hello all,
I have a customized advanced edit form that displays a number of resources in drop down lists. I need to enable/disable these drop down lists based on user selections. Ive attempted to do this with jQuery but for whatever reason, when the change event is fired, it does not disable the drop downs.
here is the code:

<script type="text/javascript">
    (function ($) {
        $(function () {
            $('.rsAdvChkWrap').hide();
            $("[id$='_ResActivity_ResourceValue_Input']").bind('change', function () {
 
                if ($("[id$='_ResActivity_ResourceValue_Input']").val() !== 'ILT - Instructor Led Training') {
                    //alert('not equal');
                    $("[id$='_ResCourse_ResourceValue_Input']").attr('disabled', 'disabled');
                    $("[id$='_ResLocation_ResourceValue_Input']").attr('disabled', 'disabled');
 
                } else {
                    //alert('equal');
                    $("[id$='_ResCourse_ResourceValue_Input']").removeAttr('disabled');
                    $("[id$='_ResLocation_ResourceValue_Input']").removeAttr('disabled');
                }
            });
        });
    })($telerik.$);
</script>


I know that the event is firing because when I uncomment the alert() functions, I get the alert.
 Any thoughts/recommendations are appreciated.

Thanks
Alex
Plamen
Telerik team
 answered on 04 Jan 2012
7 answers
373 views
Hi,
how can i stop the nodes in my treeview from being highlighted when the mouse rolls over.

I have seen the following suggestion:http://www.telerik.com/community/forums/aspnet-ajax/treeview/disabling-styles-hover-and-selected.aspx

This is not what I want. I want to remove the class switch rather than alter the class behaviour.

How can I prevent any switching of stylesheet classes when the mouse hovers over the node.
Plamen
Telerik team
 answered on 04 Jan 2012
1 answer
101 views
Did a search, but could not find a related post.  I have this issue in ie9 and Firefox 8, have not tried other browsers.

When the RadUpload generates its HTML/JavaScript it has an invisible 'floating' input that when clicked opens the file browser dialog.  This input is, by default, floating at a relative position of -5000px above where the control is actually located.  Most of the time, bumping it 5000 pixels pushes it off the page, the problem is that on longer pages this can overlap with other visible controls/inputs and can cause unexpected behavior since clicking on this floating input will still bring up the file dialog for that RadUpload. 

In my case, I have a RadGrid with a template that contains RadUploads which are actually overlapping on each other, essentially making it impossible to click the intended upload.

I've create a sample page to illustrate this issue shown below.  This repeats 50 upload controls with some spacing between them.  Once on the page you can see that clicking around the 'Weirdness here' text will open up a file dialog.  This becomes an issue when this phantom input overlaps another control.  You can verify in the html that the input is floating.  When hovered over, the input snaps to the correct location, but will return to -5000px immediately after.

Markup:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DeleteMe.aspx.cs" Inherits="AuctionAdmin.DeleteMe" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
 
<!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">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <asp:Repeater runat="server" ID="rptTest">
            <ItemTemplate>
                <%# Container.DataItem.ToString() /*Index number*/ %>              
                <telerik:RadUpload runat="server" ID="uploadTest" ControlObjectsVisibility="ClearButtons"></telerik:RadUpload>
                      Wierdness Here
                <br /><br /><br />
            </ItemTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>

Code behind:
public partial class DeleteMe : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        List<int> list = new List<int>();
        for(int i=0; i<100; i++) list.Add(i);
        rptTest.DataSource = list;
        rptTest.DataBind();
    }
}


Generated Html:
<div id="rptTest_ctl47_uploadTest" class="RadUpload RadUpload_Default">
    <input id="rptTest_ctl47_uploadTest_ClientState" type="hidden" name="rptTest_ctl47_uploadTest_ClientState" autocomplete="off">
    <ul id="rptTest_ctl47_uploadTestListContainer" class="ruInputs">
        <li>
            <span class="ruFileWrap ruStyled">
                <input id="rptTest_ctl47_uploadTestfile0" class="ruFileInput" type="file" name="rptTest_ctl47_uploadTestfile0"
                       size="23" style="position: absolute; left: 0px; top: -5000px;" title="Desert.jpg" alt="Desert.jpg">
                <input class="ruFakeInput" type="text" size="22" title="Desert.jpg">
                <input class="ruButton ruBrowse" type="button" value="Select">
            </span>
        <input id="rptTest_ctl47_uploadTestclear0" class="ruButton ruClear" type="button" value="Clear" name="ClearInput">
        </li>
    </ul>
</div>

Bozhidar
Telerik team
 answered on 04 Jan 2012
1 answer
41 views
Hi,

I have used the latest Q3 RadCombo with more than 2000 items in my project. The search speed in IE is too slow while comparing 2010 Q3 release. But it doesn't have any issues in Chrome and FF. When will it be fixed?

Thank you
Richard
Top achievements
Rank 1
 answered on 04 Jan 2012
1 answer
106 views
Hi,

I am using RadUpload in RadListView itemtemplate. OnClientFileSelected of radupload i am setting filename to textbox and then calling blur().

function ImageFileSelected(radUpload, eventArgs) {
        var input = eventArgs.get_fileInputField().value;
        document.getElementById('txtHSPortraitBackground_text').focus();
        $find("txtHSPortraitBackground").set_value(input.substring(input.lastIndexOf('\\') + 1));
        document.getElementById('txtHSPortraitBackground_text').blur();
    }

this causes textchanged event of textbox.

protected void txtHSPortraitBackground_TextChanged(object sender, EventArgs e)
        {
            RadListViewDataItem item = rlvWebClip.Items[0];
            RadBinaryImage RadBinaryImageUP = ((RadBinaryImage)item.FindControl("RadBinaryImageUP"));
            RadUpload rulHSPortraitBackground = ((RadUpload)item.FindControl("rulHSPortraitBackground"));

            RadBinaryImageUP.DataValue = GetFileDataInByte(rulHSPortraitBackground);
        }

Here the issue is that the uploadedfiles.count is always 0. I am not able to find out why. So please help me.
Dimitar Terziev
Telerik team
 answered on 04 Jan 2012
1 answer
55 views
<telerik:RadTabStrip ID="rtsTargusDetails" runat="server" SelectedIndex="0" MultiPageID="rmpClientTargusInfo">
                        <Tabs>
                            <telerik:RadTab Text="Targus" Width="175px" Selected="True">
                            </telerik:RadTab>
                            <telerik:RadTab Text="Exact Target" Width="175px">
                            </telerik:RadTab>
                            <telerik:RadTab Text="Login Information" Width="175px">
                            </telerik:RadTab>
                            <telerik:RadTab Text="Contacts" Width="175px">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
                </div>
                <telerik:RadMultiPage ID="rmpClientTargusInfo" SelectedIndex="0" Width="396px"
                    runat="server">
                    <telerik:RadPageView runat="server" ID="rvpTargusInfo">
                        <uc6:ClientTargusInfo ID="ucClientTargusInfo" runat="server" RenderMode="create" />
                    </telerik:RadPageView>
                    <telerik:RadPageView runat="server" ID="rvpExactTargusInfo">
                        <uc8:ClientExactTargetInfo ID="ucClientExactTargetInfo" runat="server" controlMode="Create" />
                    </telerik:RadPageView>
                    <telerik:RadPageView runat="server" ID="rvpLoginInformation">
                    <asp:Button  ID="pressbutton" Text="Name" runat="server"/>
                    </telerik:RadPageView>
                    <telerik:RadPageView runat ="server" ID="rvpContactInfo">
                      <uc2:ContactInfo ID="PrimContact" runat="server" controlMode="Create"/>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
I am unable to move around tabs when pressed tabs if the Usercontrol uc2 is placed in radPageview it gives me pop-up error of  "htmlfile: cant move focus to the control because it is invisible not enabled or of type that does not accept the focus"

error page is attached ...

Please help me to resolve this issue...
Chetan
Top achievements
Rank 1
 answered on 04 Jan 2012
1 answer
63 views
I have a tree list which lists a number of settings that can be edited by the user. At the moment I'm using a template column with a text box in it which allows the user to type in a value for the setting when they are editing it. Now I need some of the settings to be editable by a dropdownlist instead, how would I go about doing this?
Tsvetina
Telerik team
 answered on 04 Jan 2012
6 answers
385 views
Hello, I'm a customer of and am using "RadControls for ASPNET AJAX Q1 2008", specifically the RadMenu control, and am attempting to bind it to a Microsoft SQL database table. I have the following table defined (simplified):

tblPages
[Column Name], [Data Type], [Allow Nulls]
PageID, int, false -- (an identity field)
PageParentID, int, true
PageTitle, varchar(50), true
PageContent, text, true

In an ASCX, I have the following,

<telerik:RadMenu
  ID="NavMenu"
  runat="server"
  DataSourceID="NavigationSqlDataSource"
  Width="100%"
  DataFieldID="PageID"
  DataFieldParentID="PageParentID"
  DataTextField="PageTitle">  
  <CollapseAnimation Duration="200" Type="OutQuint" /> 
</telerik:RadMenu> 
<asp:SqlDataSource  
  ID="NavigationSqlDataSource" 
  runat="server" 
  ConnectionString="[OMITTED]" 
  SelectCommand="SELECT * FROM [tblPages]">  
</asp:SqlDataSource> 

I don't have any problems with the menu displaying, however, what I'm unclear about, is how to take the "PageID" from the database above and simply have the RadMenu take a click and go to something like:

~/page.aspx?id=[PAGEID]

Where [PAGEID], would of course, be an integer that could be looked up (if necissary, using my own code), which would allow me to display the content.

I just want a click on the menu to go to something like "~/page.aspx?id=[PAGEID]". Is there an event or something where I can set this to happen? Is there something built into the control (realize, I'm using the Q1 2008 version)?

Thanks for any assistance or help or even ideas you can supply.
Richard
Top achievements
Rank 1
 answered on 04 Jan 2012
3 answers
745 views
I know on grid_ItemDataBound can use
e.Item.DataItem to get the collection.

 

 also

can use  

 

GridDataItem dataItem1 = e.Item as GridDataItem;  

dataItem1["fieldname"] to get the field name.

Is it a way to get the collection just based on dataItems1?

I have a dropdown inside grid cell, on the dropdown click, I like to pass the row collection to the dropdown click. How can I do this?
On mydropdown_SelectedIndexChanged I used below:    

DropDownList ddl = (DropDownList)sender;
GridDataItem item = (ddl.Parent as GridTableCell).Parent as GridDataItem;  

 

use
string field=item["field1"];
to pass grid field to mydropdown_SelectedIndexChanged 

this way, I need to put all the field1. field 2 in the grid (maybe hidden column) in order to let mydropdown_SelectedIndexChanged  access the grid data, is there a way to send the whole grid row collection to mydropdown_SelectedIndexChanged ? something like (Myrowcollection)e.Item.DataItem that I did on ItemDataBound,but don't how to get the collection under mydropdown_SelectedIndexChanged?

Thanks

Sebastian
Telerik team
 answered on 04 Jan 2012
3 answers
102 views
Hi
I ran into the Tab Text orientation problem with Google Chrome and firefox.

I noticed the suggestion using images instead of text for the tab Titles.

My tab titles are dynamic and created at run time so that poses a challenge.

I am submitting here my solution that creates the images on the fly!!

There are a couple of problems though:
1/The images are not transparent.
2/I have tried to get the image to use the forecolor of the tabs theme, but this always seems to be 0 (black).

Can anyone help fix with these two problems?

Here is how it works:

A/   Create an aspx page that will convert the text to an image:
        (this is a pretty handy code in itself and is based on this link:http://911-need-code-help.blogspot.com/2009/02/create-text-images-on-fly-with-aspnet.html)
    Create a new page name it TextToImage.aspx 

        Here is the code behind :
        
protected void Page_Load(object sender, EventArgs e)
        {
 
            //Usage example
            //TextToImage.aspx?size=100&text=Hello%20there&color=FF22F3
 
            //-------------------------------------------
            // CAPTURE + SANITIZE QUERYSTRING PARAMETERS
            //-------------------------------------------
 
            string qText;
 
            qText = Request.QueryString["text"] + "";
            if (qText.Length == 0)
                qText = "-";
 
 
            int qSize;
            try
            {
                qSize = Convert.ToInt32(Request.QueryString["size"]);
            }
            catch
            {
                qSize = 0;
            }
 
 
            if (qSize < 8)
                qSize = 8;
 
            string qColor;
            qColor = Request.QueryString["color"] + "";
            if (qColor.Length == 0 || Regex.IsMatch(qColor, "^[0-9A-F]{6}$", RegexOptions.IgnoreCase) == false)
                qColor = "000000";
 
            //-------------------------------------------
            // CALL FUNCTION
            //-------------------------------------------
 
            RenderGraphic(qText, qSize, qColor);
 
        }
 
        private void RenderGraphic(string pText, int pSize, string pColor)
        {
 
            //-------------------------------------------
            // DECLARE VARIABLES + PRE-CALCULATE
            //-------------------------------------------
 
            Bitmap b = new Bitmap(1, 1);
            Graphics g = Graphics.FromImage(b);
            Font f = new Font("Arial", pSize);
            int w = Convert.ToInt32(g.MeasureString(pText, f).Width);
            int h = Convert.ToInt32(g.MeasureString(pText, f).Height);
 
            //-------------------------------------------
            // RENDER DRAWING
            //-------------------------------------------
 
            b = new Bitmap(w, h);
            g = Graphics.FromImage(b);
            g.Clear(Color.FromArgb(255, 255, 255, 204));//Color.FromArgb(&HFF, &HFF, &HFF, &HCC)
            //g.Clear(Color.Transparent);
 
 
            g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
            g.DrawString(pText, f, new SolidBrush(ColorTranslator.FromHtml("#" + pColor)), 0, 0);
            g.Flush();
 
            b.RotateFlip(RotateFlipType.Rotate90FlipNone);
            //-------------------------------------------
            // SAVE IN MEMORY
            //-------------------------------------------
 
            MemoryStream m = new MemoryStream();
            b.Save(m, ImageFormat.Gif);
 
            //-------------------------------------------
            // APPLY TRANSPARENCY HACK
            //-------------------------------------------
 
            byte[] n;
            n = m.ToArray();
            //n[787] = 254;
 
            //-------------------------------------------
            // SEND TO BROWSER
            //-------------------------------------------
 
            BinaryWriter o = new BinaryWriter(Response.OutputStream);
 
            o.Write(n);
            o.Close();
        }

The ASPX needs no content.

B/ The next step is to iterate through the tabs and apply the image URL:
      Here is my implemenation, my sliding zone is called 'ExploreSlidingZone' so you will need to change that to your own sliding zone name.
Call this function from code behind page_Load method.
private void TabsTextToImage()
    {
        // chrome & firefox can;t rotate text so we have to convert the tab text to image
        // and set the tabs to image only
        foreach (RadSlidingPane mypane in ExploreSlidingZone.GetPanes())
        {
            mypane.TabView = SplitterSlidePaneTabView.ImageOnly;
 
            mypane.IconUrl = "TextToImage.aspx?size=" + mypane.Font.Size + "&text=" + mypane.Title + "&color=" + mypane.ForeColor.GetHashCode();
 
        }
    }



Please see attached for a snapshot of the result.

You should see your tabs with images, but they are not transparent and do not inherit the skin properties.

So if we can solve the transparency & skin issues - we will have a result!!

Best Regards

Richard Briggs

richard
Top achievements
Rank 1
 answered on 04 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?