Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
676 views
Dear community,

i want to make a preselection on a combobox based on custom attributes on clientside, each time i enter new values to numeric Text boxes.

I have created the attributes on ItemDataBound

Protected Sub cbxKonfektion_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles cbxKonfektion.ItemDataBound
       Dim dataItem As DataRowView = CType(e.Item.DataItem, DataRowView)
       e.Item.Attributes("Gewicht_UG") = dataItem("Gewicht_UG")
       e.Item.Attributes("Gewicht_OG") = dataItem("Gewicht_OG")
       e.Item.Attributes("KGR_UG") = dataItem("KGR_UG")
       e.Item.Attributes("KGR_OG") = dataItem("KGR_OG")
   End Sub

Now i want to compare my custom attributes with two other textboxes each time i have entered a new value in the textbox

As far as i know, there is no method FindItemsByAttribute, right ?

So how to check if my textboxvalue are in the range of the attribute values on clientside, and find the first match.

Any suggestion how to do this task.

Kind regards

Martin Gartmann


Martin Gartmann
Top achievements
Rank 2
 answered on 03 Sep 2010
5 answers
167 views
When right click mouse, it is possible to actually add an appointment to the calendar.   Knowing that we do not want the user to be able to add an actual appointment to the calendar,  we would like to  change it where it allows you to click the calendar day and time with your mouse- and it launched the “add new”  screen, actually we would like "New Appointment" link to another page, when user click this "Add New Appointment", it will directly to another page. Is it possible to do it? Also we would like only show "New Appointment" and disable the rest of 3 choices when right click mouse on the calendar.

Thanks
Veronica
Telerik team
 answered on 03 Sep 2010
3 answers
260 views
Hi,

I am able to play video in telerik rad editor webpart, however when i place this telerik rad editor control in my article page [custom page layout] with video embeded in telerik rad editor control along with content and save the page. It does not save the video [code to integrate video in telerik rad editor control], however it saves the content placed along with the video.

Please Suggest.

Ketan
Stanimir
Telerik team
 answered on 03 Sep 2010
2 answers
110 views
Hi,

I'm trying to come up with a generic approach in setting the data resources for the combo box.  Instead of always setting the following properties:

prioritylist.DataSource = "";
           prioritylist.DataValueField = ARConstants.PriorityListName;
           prioritylist.DataTextField = ARConstants.PriorityListId;            
           prioritylist.DataBind();
           prioritylist.Items.Insert(0, new ListItem("", "0"));
           prioritylist.SelectedIndex = 0;

In my code behind, I'd like to pass the control and since I always know that my datasource will alway have id and name.  I want the call to be a single instance.

I have a controller class call DDLController that does the following:
public void LoadLookup(Page page, DropDownList ddlPriority, DropDownList ddlRM, DropDownList ddlBSE, DropDownList ddlDataType)
       {
           LoadPriorityList(page,ddlPriority);
           LoadRFMList(page, ddlRM);
           LoadBSEList(page, ddlBSE);
           LoadSystemList(page, ddlDataType);
       }
       private void LoadPriorityList(Page page,DropDownList prioritylist)
       {
           prioritylist.DataSource = "";
           prioritylist.DataValueField = ARConstants.PriorityListName;
           prioritylist.DataTextField = ARConstants.PriorityListId;            
           prioritylist.DataBind();
           prioritylist.Items.Insert(0, new ListItem("", "0"));
           prioritylist.SelectedIndex = 0;
       }
       private void LoadRFMList(Page page, DropDownList rfmlist)
       {
           rfmlist.DataSource = "";
           rfmlist.DataValueField = ARConstants.RFMId;
           rfmlist.DataTextField = ARConstants.RFMName;            
           rfmlist.DataBind();
           rfmlist.Items.Insert(0, new ListItem("", "0"));
           rfmlist.SelectedIndex = 0;
       }
As you can see above I created 2-3 separate methods that will render the different combo box.  However this methodology seems to redunant where I want to render the control only once.  I'm not really sure how to make this generic.  Any help on this design would be very helpful.

Thanks,
Joe
Top achievements
Rank 1
 answered on 03 Sep 2010
10 answers
944 views
EDIT - title is misleading - sorry - there is just a single repeater in the template column.

Hi,

I have a repeater inside a GridTemplateColumn with the datasourceid set declaratively.

<telerik:GridTemplateColumn UniqueName="tcRoles">
         <ItemTemplate>
         <ul>
            <asp:Repeater ID="rpRoles" runat="server" DataSourceID="ods_UsersInRoles">
            <ItemTemplate><li>
                <asp:Label ID="lblRoleName" runat="server" Text='<%#Eval("role_name") %>' /> (<asp:Label ID="lblApplicationName" runat="server" Text='<%#Eval("application_name") %>'/>)</li>
            </ItemTemplate>
            </asp:Repeater>
            </ul>
            <asp:ObjectDataSource ID="ods_UsersInRoles" runat="server"
        SelectMethod="GetByUserID"
        TypeName="mhs.bll.UsersInRoles">
        <SelectParameters>
            <asp:Parameter Name="user_ID" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>   
        </ItemTemplate>
        </telerik:GridTemplateColumn>

I am getting an error that the repeater cannot find the datasource:

The DataSourceID of 'rpRoles' must be the ID of a control of type IDataSource.  A control with ID 'ods_UsersInRoles' could not be found.

This logic works using standard GridView - is there something I am missing when using RadGrid?

I am setting the user_ID parameter in code behind on the RadGrid ItemDataBound event.

Thanks
Tom
Tsvetoslav
Telerik team
 answered on 03 Sep 2010
1 answer
117 views
Hi,

I am trying to use the RAD editor in a list, with some customizations of the toolbars. We have the editor installed, and the feature is activated on the site. The editor does show up correctly on the page. However, as a test I made one small change to the ListToolsFile.xml file which I found here: C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.6.0.0__1f131a624888eeed\Resources\.

I did an iisreset but the change does not show up... what am I missing?

Thanks,
Alon
Stanimir
Telerik team
 answered on 03 Sep 2010
4 answers
234 views
My client requests the radcombobox must have the same look with the regular asp:TextBox. Like square-corner and no dropshadow. May you kindly give me some tips to format the control.

Thank you.
Duke
d-cpt
Top achievements
Rank 2
 answered on 03 Sep 2010
2 answers
97 views
Hi,

I am using the sitemap control - with the 'Black' skin.
When I add an image it puts a purple border around it - is there a way of removing this?

Thanks in advance
Andrew
Top achievements
Rank 1
 answered on 03 Sep 2010
4 answers
103 views
Hey all I have a page with a bunch of accordion panels with controls in them, what I need is when they submit a form on one control I need the radgrid on a different control to refresh how do I do this?

thanks!
Panels:
<div>
                    <h3>
                        <a href="#">Create Groups</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelCreateGroups" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:CreateGroup ID="CreateGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div>
                    <h3>
                        <a href="#">Edit Questions</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelEditQuestions" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:EditQuestionsGroup ID="EditQuestionsGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div>
                    <h3>
                        <a href="#">Edit Group Questions</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelEditGroupQuestions" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:EditGroup ID="EditGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
Radoslav
Telerik team
 answered on 03 Sep 2010
1 answer
138 views
Hi there,

I am using the RadEditor for Moss 2007 of version 5_8_1.
i have a Custom button in tool bar. Once the user is selecting anytext in the editor and click on this button i am populating this text to the pop up. In pop up i am getting some text  and i have a Insert Button in the popup. Using this Button i am trying to insert the text in the editor.

I am using like

window.opener.RTE_GetSelection("' + editor.get_id() + '").pasteHtml(popup); \n'

But i am getting error that window.opener.RTE_GetSelection is null. what should i do here to insert the text as html markup in the editor.
i have attached the full code here. let me know if anyone having anyidea.

Telerik.Web.UI.Editor.CommandList["CustomCommand1"] = function(commandName, editor, args) {

    //this is the function that generates the "Popup" dialog.

    var selection = editor.getSelection();

    
    //get the selected text:
    var selectedText = selection.getText();
    //get the selected HTML:
    var selectedHTML = selection.getHtml();
    //get the currently selected HTML element
    var selElement = editor.getSelectedElement(); //or selection.getParentElement()
    //alert(editor);
    //alert("The selected text is: " + selectedText + ".\nThe selected HTML is: " + selectedHTML + ".\nThe selected HTML element is " + selElement.tagName + ".");
    //alert(editor.get_id());

    //this is the function that generates the "Popup" dialog.
    //alert("Inside embedPopup");
    // RTE_SaveSelection(editor);
    //var fieldValue = RTE_GetSelection(editor).text;

    var generator = window.open('', 'Parameters', 'height=300,width=300,scrollbar=no,menu=no,toolbar=no,status=no,location=no');
    generator.document.write('<html><head><title>Please input details</title>' +
    '<script type="text/javascript">function insertPopup() { \n' +
    'var popupText = document.getElementById("popupText").value; \n' +
    'var popupHeading = document.getElementById("popupHeading").value; \n' +
    'var popupDescription = document.getElementById("popupDescription").value; \n' +
    'var bValid = true; \n' +
    'var sErrorMessage = ""; \n' +
    'if (popupText == "") { \n' +
    '    sErrorMessage = "No text selected to create popup."; \n' +
    '    bValid = false; \n' +
    '} \n' +
    'else if (popupHeading == "") { \n' +
    '    sErrorMessage = "Please enter a heading for the popup."; \n' +
    '    bValid = false; \n' +
    '} \n' +
    'else if (popupDescription == "") { \n' +
    '    sErrorMessage = "Please enter a description text for the popup."; \n' +
    '    bValid = false; \n' +
    '} \n' +
    'if (sErrorMessage != "") \n' +
    '{ \n' +
    '    alert (sErrorMessage); \n' +
    '} else if (bValid) { \n' +
    '    var popup = "<span class=\\\"ept-contentdetail-body-hover-popup\\\" onmouseover=\\\"showBalloonTip(\'<b>"; \n' +
    '    popup = popup + popupHeading; \n' +
    '    popup = popup + "</b><br />"; \n' +
    '    popup = popup + popupDescription; \n' +
    '    popup = popup + "\',200)\\\" onmouseout=\\\"hideBalloonTip()\\\">"; \n' +
    '    popup = popup + popupText; \n' +
    '    popup = popup + "</span>"; \n' +
    '    if (!window.opener || window.opener.closed) { \n' +
    '        alert("Your popup could not be inserted because the editor page has been closed."); \n' +
    '    } else { \n' +
    '       alert("'+editor.get_id()+'");' +
    '        //window.opener.document.getElementById("' + editor + '_toolbarIframe").focus(); \n' +
    '         window.opener.RTE_GetSelection("' + editor.get_id() + '").pasteHtml(popup); \n' +
    '       //var editor="ctl00_ctloo_PlaceHolderMainParent_PlaceHolderMain_Content_ctl00_RadHtmlField1"; \n' +
    '    } \n' +
    '   alert("outside if");' +
    '    window.opener.RTE_RestoreSelection("' + editor + '"); \n' +
    '    window.close(); \n' +
    '} \n' +
    '}' + "<\/script>" +
    '</head><body style="margin:10px; font-family: verdana; font-size: 10px;">' +
    '<strong>Create Popup For:</strong> <input id="popupText" name="popupText" type="text" value="' + selectedText + '" readonly style="border: 1px black solid; width: 200px; font-family: verdana; font-size: 10px;"/><br/><span style="color: gray">(Hover would be created on this text)</span>' +
    '<br/> <br/>' +
    '<strong>Popup Heading:</strong> <input id="popupHeading" name="popupHeading" type="text" style="border: 1px black solid; width: 200px; font-family: verdana; font-size: 10px;"/><br/><span style="color: gray">(Enter the hover heading here)</span>' +
    '<br/> <br/>' +
    '<strong>Popup Description:</strong><br/>' +
    '<textarea id="popupDescription" name="popupDescription" style="width: 250px; height: 100px; border: 1px black solid; font-family: verdana; font-size: 10px;"></textarea>' +
    '<br/><span style="color: gray">(Enter the hover description here)</span><br/>' +
    '<input type="hidden" id="field" value="' + editor + '">' +
    '<br/> <br/><button style="font-family: verdana; font-size: 10px;" onclick="insertPopup()">Insert</button>' +
    '&nbsp;&nbsp;<button style="font-family: verdana; font-size: 10px;" onclick="window.close()">Close</button>' +
    '</body></html>');

    generator.document.close();


Thanks
Amit Kumar
Stanimir
Telerik team
 answered on 03 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?