Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
617 views
I have a RadGrid with an EditForm containing a RadComboBox.  The RadComboBox has a datasource set to a string[] (DataSource='<%# GetSampleValues() %>').  When creating and editing a record, the combobox displays the correct strings in the dropdown list.  When Editing an existing record, the selected string before expanding the combobox is not displaying the appropriate value.

<rad:RadComboBox ID="rcb_SampleValues" runat="server" AllowCustomText="false" 
   DataSource='<%# GetSampleValues() %>'  
   Text='<%# Bind("SampleValueString") %>' 
   Value='<%# Bind("SampleValueString") %>' 
   MaxLength="255"  
   Width="100" > 
</rad:RadComboBox> 


public enum SampleValues 
     SampleValue1, 
     SampleValue2 
}

public class Samples 
     public int ID { get; set; } 
     public string Name { get; set; } 
     public SampleValues SampleValue { get; set; } 
     public string SampleValueString { get; set; } 
}


public void Page_Load(object sender, EventArgs e)
{
BindGridData();
}

public void BindDataGrid()
{
Samples[] samples = GetObjectsFromDataAccessLayer()
radGrid.DataSource = samples;
}
public static string[] GetSampleValues() 
     return Enum.GetNames(typeof(SampleValues)); 

I am binding the RadComboBox to an array of strings which are generated off of an Enum - but the same problem happens when I bind the RadCombobBox to a set of objects and set the DataTextMember and DataValueMember.  I have a sample application that I can send to someone that would like to see it.

Any ideas on what is not being done to make the comboBox NOT set to the intended value when the record is loaded?
kevin floyd
Top achievements
Rank 1
 answered on 03 Jun 2010
1 answer
89 views
Hello experts,

I am new to telrik controls. I have been struggling with this past few days now.

I have a master grid that shows lets say DEPARTMENTinformation.

Then I want to have a child grid that will list all the COURSES under that dept.

I want the courses to be drag and droppable within the same grid so that we can change the priority or the order of showing.

I have implemented a grid inside a grid and enabled drag and drop on the inside grid. Then I have tried to incorporate the code behind functionality to drag and drop but I cant get the OnNeedDatasource to work right on the child grid. Once I can do that, I may be able to something like this according to the drag and drop example :

        protected void grdPendingOrders_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            grdPendingOrders.DataSource = PendingOrders;
        }


I am not sure if I am going the right direction, so I am ready to try a different approach altogether... Please provide some directions...

Thanks.
Bobby.
Daniel
Telerik team
 answered on 03 Jun 2010
1 answer
82 views
HI,

Is there a way to use the validation functionality of the RadInputManager for the RadTextBox?


Regards
Ravi
mcamail2002@gmail.com



Tsvetina
Telerik team
 answered on 03 Jun 2010
1 answer
242 views

Hi,


<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

        </telerik:RadScriptManager>

 

<telerik:RadTextBox ID="txtName" runat="server">

                        </telerik:RadTextBox>

<telerik:RadInputManager ID="RadInputManager1" runat="server">

                                

                <telerik:TextBoxSetting BehaviorID="NameBehavior" EmptyMessage="Empty!"

                ErrorMessage="Error!" Validation-IsRequired="true"

                Validation-ValidationGroup="ValidationSummary1">

                    <TargetControls>

                        <telerik:TargetInput ControlID="txtName" />

                    </TargetControls>

                </telerik:TextBoxSetting>

  </telerik:RadInputManager>

<asp:Button ID="Button1" runat="server" ValidationGroup="ValidationSummary1" Text="Postback" class="qsfButton"></asp:Button>


Validation is not working.Could we use validation summay control to show message in popup.

Regards

Ravi

mcamail2002@gmail.com

Tsvetina
Telerik team
 answered on 03 Jun 2010
1 answer
107 views
Hi all,
Actual, I'm using RadAjax control Q3 2009, and I use RadUpload component for my DNN module (DNN version 5.0) to Upload file with validate file size before upload by set value for MaxFileSize property of RadUpload Component.

But I have problem, RadUpload work good with validate file size when upload on FireFox ( with localhost address and share web address), but It run not stable on IE8 (with localhost address, sometime it can validate, sometime it can't. With share web address it does not completely work.)

I had read a help article Uploading Large Files to config in Webconfig file, You can see below:

<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="2097151" requestLengthDiskThreshold="2097151" executionTimeout="3600000" />

but it also don't change. I don't know the reason why, because my Browser or because I don't know to config for RadUpload.

I'm using .NET FW 2.0, IIS 5.1. Everybody can help?, plz give me any idea for my problem....
Thanks so much.
Genady Sergeev
Telerik team
 answered on 03 Jun 2010
2 answers
80 views
Hello,

I am not able to collapse more than one group, if i try to collapse a second group, the first group expand.

How can i collapse more than one group ? Is-it a property ?

Thanks
Gabriel Boulianne
Top achievements
Rank 1
 answered on 03 Jun 2010
1 answer
78 views
The RadEditor Hyperlink should support graphic content. I see only documents are allowed. Kindly patch. Thank you.
Dobromir
Telerik team
 answered on 03 Jun 2010
2 answers
138 views
is there a way that i can override this?  it appears to be an IE only setting.  but align="center" has very different meaning than align="middle".  align="middle" is not even a valid value.  stupid IE.  the middle attribute is only applicable for the valign attribute.  If i have html code with align="center" it is immediately converted to align="middle" when the content is loaded in IE.  I am using the latest 2010 non-beta release of the Rad Controls.

My RadEditor definition code looks like this:

                        <telerik:RadEditor ID="EMailContentEditor" runat="server" Skin="Web20" Width="100%" ContentFilters="None"
                          ConvertToXhtml="false" ConvertFontToSpan="false"
                            EditModes="Design,Html" Height="600px" OnClientCommandExecuting="OnClientCommandExecuting"
                             OnClientLoad="OnClientLoad">
                            <CssFiles>
                                <telerik:EditorCssFile Value="/EditorBody.css?1" />
                            </CssFiles>
                            <Symbols>
                                <telerik:EditorSymbol Char="\u20AC" />
                                <telerik:EditorSymbol Char="\u00A2" />
                                <telerik:EditorSymbol Char="\u00A3" />
                                <telerik:EditorSymbol Char="\u00A5" />
                                <telerik:EditorSymbol Char="\u00A4" />
                                <telerik:EditorSymbol Char="\u00A9" />
                                <telerik:EditorSymbol Char="\u00AE" />
                                <telerik:EditorSymbol Char="\u2122" />
                                <telerik:EditorSymbol Char="\u00B1" />
                                <telerik:EditorSymbol Char="\u2260" />
                                <telerik:EditorSymbol Char="\u2248" />
                                <telerik:EditorSymbol Char="\u2264" />
                                <telerik:EditorSymbol Char="\u2265" />
                                <telerik:EditorSymbol Char="\u00F7" />
                                <telerik:EditorSymbol Char="\u00D7" />
                                <telerik:EditorSymbol Char="\u221E" />
                                <telerik:EditorSymbol Char="\u00BD" />
                                <telerik:EditorSymbol Char="\u00BC" />
                                <telerik:EditorSymbol Char="\u00BE" />
                                <telerik:EditorSymbol Char="\u00B2" />
                                <telerik:EditorSymbol Char="\u00B3" />
                                <telerik:EditorSymbol Char="\u2026" />
                                <telerik:EditorSymbol Char="\u2013" />
                                <telerik:EditorSymbol Char="\u2014" />
                                <telerik:EditorSymbol Char="\u25B6" />
                                <telerik:EditorSymbol Char="\u00E9" />
                                <telerik:EditorSymbol Char="\u2022" />
                                <telerik:EditorSymbol Char="\u271D" />
                            </Symbols>
                            <Modules>
                                <telerik:EditorModule Name="RadEditorHtmlInspector" Enabled="true" Visible="false" />
                                <telerik:EditorModule Name="RadEditorDomInspector" Enabled="true" Visible="true" />
                            </Modules>
                            <Tools>
                                <telerik:EditorToolGroup>
                                    <telerik:EditorTool Name="ModuleManager"></telerik:EditorTool>
                                </telerik:EditorToolGroup>
                            </Tools>
                            <FontNames>
                                <telerik:EditorFont Value="Arial" />
                                <telerik:EditorFont Value="Courier New" />
                                <telerik:EditorFont Value="Garamond" />
                                <telerik:EditorFont Value="Georgia" />
                                <telerik:EditorFont Value="MS Sans Serif" />
                                <telerik:EditorFont Value="Sego UI" />
                                <telerik:EditorFont Value="Tahoma" />
                                <telerik:EditorFont Value="Times New Roman" />
                                <telerik:EditorFont Value="Verdana" />
                            </FontNames>
                        </telerik:RadEditor>

and the referenced load scripts look like this:
                        <script language="javascript" type="text/javascript">

                            var beforePostbackHandler = function() {

                                var editor = $find("<%= EMailContentEditor.ClientID %>");
                                var colorArray = document.getElementById("<%= colorArray.ClientID %>");
                                var setCookie = document.getElementById("<%=setCookie.ClientID %>");
                                setCookie.value = "1";
                                colorArray.value = editor.get_colors();
                            }

                            function OnClientCommandExecuting(editor, args) {
                                var name = args.get_name();
                                var val = args.get_value();
                            }

                            function OnClientLoad(editor) {
                                editor.get_filtersManager().add(new SymbolsCustomFilter());
                                editor.get_filtersManager().add(new ImageAlignmentCustomFilter());
                            }

                            SymbolsCustomFilter = function() {
                                SymbolsCustomFilter.initializeBase(this);
                                this.set_isDom(false);
                                this.set_enabled(true);
                                this.set_name("RadEditor Symbol Filter");
                                this.set_description("RadEditor custom symbols replacement filter");
                            }

                            SymbolsCustomFilter.prototype =
                            {
                                getHtmlContent: function(content) {
                                    //Make changes to the content and return it    
                                    //Convert all symbols to their numeric HTML entities    
                                    newContent = content.replace(/\u20AC/g, "&euro;");
                                    newContent = newContent.replace(/\u00A2/g, "&cent;");
                                    newContent = newContent.replace(/\u00A3/g, "&pound;");
                                    newContent = newContent.replace(/\u00A5/g, "&yen;");
                                    newContent = newContent.replace(/\u00A4/g, "&curren;");
                                    newContent = newContent.replace(/\u00A9/g, "&copy;");
                                    newContent = newContent.replace(/\u00AE/g, "&reg;");
                                    newContent = newContent.replace(/\u2122/g, "&trade;");
                                    newContent = newContent.replace(/\u00B1/g, "&#177;");
                                    newContent = newContent.replace(/\u2260/g, "&#8800;");
                                    newContent = newContent.replace(/\u2248/g, "&#8776;");
                                    newContent = newContent.replace(/\u2264/g, "&#8804;");
                                    newContent = newContent.replace(/\u2265/g, "&#8805;");
                                    newContent = newContent.replace(/\u00F7/g, "&divide;");
                                    newContent = newContent.replace(/\u00D7/g, "&times;");
                                    newContent = newContent.replace(/\u221E/g, "&#8734;");
                                    newContent = newContent.replace(/\u00BD/g, "&frac12;");
                                    newContent = newContent.replace(/\u00BC/g, "&frac14;");
                                    newContent = newContent.replace(/\u00BE/g, "&frac34;");
                                    newContent = newContent.replace(/\u00B2/g, "&sup2;");
                                    newContent = newContent.replace(/\u00B3/g, "&sup3;");
                                    newContent = newContent.replace(/\u2026/g, "&#8230;");
                                    newContent = newContent.replace(/\u2013/g, "&#8211;");
                                    newContent = newContent.replace(/\u2014/g, "&#8212;");
                                    newContent = newContent.replace(/\u25B6/g, "&#9658;");
                                    newContent = newContent.replace(/\u2022/g, "&#8226;");
                                    newContent = newContent.replace(/\u00E9/g, "&eacute;");
                                    newContent = newContent.replace(/%5B%7E/g, "[~");
                                    newContent = newContent.replace(/%7E%5D/g, "~]");
                                    newContent = newContent.replace(/\u271D/g, "&#10013;");

                                    var tempImagePath = '<%=ConfigurationManager.AppSettings["baseImagePath"].ToString() %>';
                                    var libReplace = new RegExp("src=\"/ImageLibrary/", "g");
                                    newContent = newContent.replace(libReplace, "src=\"http://" + tempImagePath + "/ImageLibrary/");

                                    libReplace = new RegExp("src=\"../ImageLibrary/", "g");
                                    newContent = newContent.replace(libReplace, "src=\"http://" + tempImagePath + "/ImageLibrary/");
                                    
                                    return newContent;
                                }
                            }

                            SymbolsCustomFilter.registerClass('SymbolsCustomFilter', Telerik.Web.UI.Editor.Filter);   

                            ImageAlignmentCustomFilter = function() {
                                ImageAlignmentCustomFilter.initializeBase(this);
                                this.set_isDom(true);
                                this.set_enabled(true);
                                this.set_name("RadEditor Image Alignment Filter");
                                this.set_description("RadEditor custom image alignment filter");
                            }

                            ImageAlignmentCustomFilter.prototype =
                            {
                                getHtmlContent: function(content) {
                                     var images = content.getElementsByTagName("IMG");
                                      
                                     for(var i=0;i<images.length;i++)
                                     {
                                        var image = images[i];
                                        
                                        if (image.style.cssFloat)
                                        {
                                           image.setAttribute("align",image.style.cssFloat);
                                           //image.style.cssFloat = "";
                                        }
                                        else if (image.style.styleFloat) // styleFloat for IE
                                        {
                                           image.setAttribute("align", image.style.styleFloat);
                                        }
                                     }
                                     
                                    return content;
                                }
                            }

                            ImageAlignmentCustomFilter.registerClass('ImageAlignmentCustomFilter', Telerik.Web.UI.Editor.Filter);   

                            //]]>
                        </script>

Mark Kucera
Top achievements
Rank 1
 answered on 03 Jun 2010
1 answer
145 views
 HI, I'm trying to validate values on a radgrid when I do an insertion.

The validation all works fine on the ItemCommand Event below, however if the value I want to insert already exists I wish to cancel the insertion and close the edit box. The insertion is cancelled however the edit/insert box remains open.
I use the
RadGrid1.MasterTableView.ClearEditItems();
                RadGrid1.Rebind();
to clear the edititems however the editmode stays open e.KeepInEdit mode is not available at this stage, how do I close the edit boxes

Thanks
Robert


if (baseline.BaselineExists(id, Convert.ToInt32(dayDateId), start, end, baselineType))
            {
                if (e.CommandName == RadGrid.PerformInsertCommandName)
                {
                    gridMessage = "this baseline cannot be inserted. Reason: a baseline already exists for this day and time";

                }
                else
                {
                    gridMessage = "baseline " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"] + " cannot be updated. Reason: a baseline already exists for these times";
                }
                e.Canceled = true;
                RadGrid1.MasterTableView.ClearEditItems();

                RadGrid1.Rebind();
                return;
Princy
Top achievements
Rank 2
 answered on 03 Jun 2010
1 answer
68 views
Hi,

In IE8 the image drag handles are visible above the Apply Style dropdown.
In FF this is not the case.

Howto handle this?

BR,
Marc
Rumen
Telerik team
 answered on 03 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?