Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
57 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
130 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
79 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
83 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
458 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
808 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
112 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
1 answer
128 views
 Hi,

I am adding controls dynamically in OnItemCreated event.
OnitemDataBound setting the value to same controls on the basis of hidden field present in same row.

This works fine.

But after button click event which is at the bottom page  I am getting same value.
the problem is ,in OnItemCreated controls are getting created  again.
But if i checked for already added controls its showing null.

Can you please suggest.
My code is as below.

protected void OnItemCreated(object sender, GridItemEventArgs e)
        {
            if (!IsPostBack)
            {
                RadGrid rg = (RadGrid)sender;
 
                SQWParameter oSQWParameter = (SQWParameter)ViewState["oParameter"];
 
                if (e.Item is GridDataItem)
                {
                    GridDataItem item = e.Item as GridDataItem;
                    HiddenField hdnValue = (HiddenField)e.Item.FindControl("hdnId");
                    WebControl rwControl = GetContorlByParameter(oSQWParameter);
                    item["Column2"].Controls.Add(rwControl);
                }
 
            }
        }
 
private WebControl GetContorlByParameter(SQWParameter oSQWParameter)
        {
            RadTextBox txtValue = new RadTextBox();
            RadNumericTextBox ntxtValue = new RadNumericTextBox();
            RadComboBox cmbValue = new RadComboBox();
            RadDatePicker rdpValue = new RadDatePicker();
 
            int iControlType = 0;
            int iValue = 0;
 
 
            switch (oSQWParameter.Type)
            {
                case ParameterType.Text:
                    switch (oSQWParameter.ValueType)
                    {
                        case ParameterValueType.UniqueValue:
                            iControlType = 0;
                            txtValue = new RadTextBox();
                            txtValue.ID = "rwControlValue";
                            txtValue.Text = oSQWParameter.DefaultValue.ToString();
                            txtValue.EmptyMessage = oSQWParameter.DefaultValue.ToString();
                            txtValue.Width = 120;
                            break;
                        case ParameterValueType.ValueList:
                            iControlType = 2;
                            cmbValue = new RadComboBox();
                            cmbValue.ID = "rwControlValue";
                            cmbValue.Width = 110;
                            cmbValue.Items.AddRange(GetValueListItems(oSQWParameter.ValueList));
                            break;
 
                    }
                    break;
                case ParameterType.Numeric:
                    switch (oSQWParameter.ValueType)
                    {
                        case ParameterValueType.UniqueValue:
                            iControlType = 1;
                            ntxtValue = new RadNumericTextBox();
                            ntxtValue.ID = "rwControlValue";
                            txtValue.Width = 120;
                            ntxtValue.NumberFormat.DecimalDigits = oSQWParameter.DecimalPlaces;
                            if (!oSQWParameter.Use1000Separator)
                                ntxtValue.NumberFormat.GroupSeparator = "";
                            ntxtValue.EmptyMessage = oSQWParameter.DefaultValue.ToString();
                            break;
                        case ParameterValueType.ValueList:
                            iControlType = 2;
                            cmbValue = new RadComboBox();
                            cmbValue.ID = "rwControlValue";
                            cmbValue.Width = 110;
                            cmbValue.Items.AddRange(GetValueListItems(oSQWParameter.ValueList));
                            break;
 
                    }
                    break;
                case ParameterType.Date:
                    switch (oSQWParameter.ValueType)
                    {
                        case ParameterValueType.UniqueValue:
                            iControlType = 3;
                            rdpValue = new RadDatePicker();
                            rdpValue.ID = "rwControlValue";
                            rdpValue.Width = 120;
                            rdpValue.MinDate = new DateTime(1900, 1, 1, 12, 00, 00);
                            rdpValue.DateInput.DateFormat = "MM/dd/yyyy";
                            DateTime dtValue = (DateTime)oSQWParameter.DefaultValue;
                            rdpValue.DateInput.EmptyMessage = dtValue.ToString("MM/dd/yyyy");
                            break;
                    }
                    break;
            }
 
            if (iControlType == 0)
                return txtValue;
            else if (iControlType == 1)
                return ntxtValue;
            else if (iControlType == 2)
                return cmbValue;
            else
                return rdpValue;
 
        }
 
  protected void OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = e.Item as GridDataItem;
 
                HiddenField hdnValue = (HiddenField)e.Item.FindControl("hdnValue");           
                 
                 RadTextBox rwControl = (RadTextBox)e.Item.FindControl("ntxtValue");
                  rwControl.Text = hdnValue.Value;
                             
            }
        }
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 Jan 2012
1 answer
62 views
I have radgrid with using List<Classname> for datasource.When I insert the data,new data replace with old data and old data is disappearing.How can I insert new data to the grid without losing old one? 
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 Jan 2012
3 answers
86 views
Hi all
I have a problem with FF 8 and greater version. (We have a MOSS2007/WSS3 Frontend Server, Win2003 x86)
The RadEditor Light was succesfull installed and deployed. Test with multiple Browser are ok but with Firefox 8 and greater there show a simple text box without any editing possibility. Its seems the edotor not load in FF 8 and greater versions.
Is that a known copatibility issue or is there a posibility to configure the editor so that it works with FF 8?

Greatings Ralf
Rumen
Telerik team
 answered on 04 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?