Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
211 views
Hi

I am using an edit form template within a radgrid. My edit form template is used to update Customer records. One of the fields in my customer table is TitleID which is a foreign key to the Titles table. This table contains records such as Mr, Mrs Miss etc. The form template contains a drop down list of these titles which is populated from the database. The SelectedValue property of the dropdown list is set to the TitleID of the current record. This is achieved like so

 <asp:DropDownList ID="cboTitle" runat="server" DataTextField="Title" DataValueField="TitleID" 
SelectedValue='<%# Bind("ContactTitleID") %>'     DataSource='<%# (GetTitles()) %>'>  
                </asp:DropDownList><br /> 

This code works fine for automatic updates. However when i try to perform an insert I get an error binding to the drop down list

'cboTitle' has a SelectedValue which is invalid because it does not exist in the list of items.  
Parameter name: value  

I understand what is causing this error. Naturally for an empty record the value for Bind("ContactTitleID") is an empty string whereas this is not one of the items in the drop down list of titles.

How can i overcome this whilst still performing automatic inserts and updates? I can populate the drop down list of titles and the selected value in the ItemDataBound event but then the SelectedValue property of the of the cboTitles dropdown list is not passed to the ContactTitleID field because this control is not bound to this field.

I think this problem is avoided in standard grids because they have different templates for inserts and updates.

Many thanks
Jhess
Top achievements
Rank 1
 answered on 25 Jan 2012
1 answer
110 views
Hello Telerik team,
 We have discovered an issue with the RadEditor in a RadMultiPage or a RadSplitter (RadControls For Asp.NET Ajax, version 2011.3.1305.40) . In our scenario, we are attaching a click event handler to the editor as soon as it loads. The click handler fires correctly when the editor is not nested within a splitter or a multipage. We require to have the editor within a RadPageView in a RadSplitter, so please advise us on how to fix this issue.
Below there is some test code we have used:
<telerik:RadCodeBlock ID="rcb" runat="server">
       <script type="text/javascript">
           //TEST SCENARIO1 - editor in RadMultiPage
           function EditorOnClientLoad(editor, args) {
               editor.attachEventHandler("onclick", function (e) {
                   alert('Editor clicked!');
               });
           }
            //TEST SCENARIO2 - editor in RadSplitter
           function Editor1OnClientLoad(editor, args) {
               editor.attachEventHandler("onclick", function (e) {
                   alert('Editor1 clicked!');
               });
           }
       </script>
   </telerik:RadCodeBlock>
 
 <%--TEST SCENARIO1--%>
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Office2007" MultiPageID="RadMultiPage1"
       SelectedIndex="0">
       <Tabs>
           <telerik:RadTab runat="server" Text="Description" Value="Description" PageViewID="RadPageView1">
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="Content" Value="Content" PageViewID="RadPageView2">
           </telerik:RadTab>
       </Tabs>
   </telerik:RadTabStrip>
   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="430px">
       <telerik:RadPageView ID="RadPageView1" runat="server">
           <div id="div1" runat="server" >
               <div id="div2" runat="server" >
                   ....
               </div>
           </div>
       </telerik:RadPageView>
       <telerik:RadPageView ID="RadPageView2" runat="server">
           <table cellpadding="0" cellspacing="5">
               <tr>
                   <td align="right" valign="middle">
                       Message
                   </td>
                   <td valign="middle">
                       <telerik:RadEditor ID="editorMessage" runat="server" Skin="Office2007" EnableResize="false"
                           OnClientLoad="EditorOnClientLoad">
                       </telerik:RadEditor>
                   </td>
               </tr>
           </table>
       </telerik:RadPageView>
   </telerik:RadMultiPage>
 
   <%--TEST SCENARIO 2--%>
   <telerik:RadSplitter ID="rs1" runat="server" Width="800px">
       <telerik:RadPane ID="rp1" runat="server">
           <telerik:RadEditor ID="RadEditor1" runat="server" Skin="Office2007" EnableResize="false"
               OnClientLoad="Editor1OnClientLoad">
           </telerik:RadEditor>
       </telerik:RadPane>
   </telerik:RadSplitter>

None of the above test scenarios fire the click handler of the RadEditor. Moreover, in the RadMultiPage scenario, Google Chrome shows an error when clicking the second tab:
  1. Uncaught TypeError: Cannot read property 'tagName' of null
    1. Telerik.Web.UI.Editor.Selection.getParentElementTelerik.Web.UI.WebResource.axd:11064
    2. a.RadEditor.getSelectedElementTelerik.Web.UI.WebResource.axd:11542
    3. a.RadEditor.getToolValueTelerik.Web.UI.WebResource.axd:11574
    4. Telerik.Web.UI.Editor.DefaultToolAdapter.setToolStateTelerik.Web.UI.WebResource.axd:8420
    5. Telerik.Web.UI.Editor.DefaultToolAdapter._onEditorSelectionChangeTelerik.Web.UI.WebResource.axd:8571
    6. Telerik.Web.UI.RadWebControl.raiseEventTelerik.Web.UI.WebResource.axd:779
    7. a.RadEditor.onParentNodeChangedTelerik.Web.UI.WebResource.axd:11530
    8. window.$telerik.window.TelerikCommonScripts.Telerik.Web.CommonScripts.repaintChildrenTelerik.Web.UI.WebResource.axd:96
    9. Telerik.Web.UI.RadPageView.showTelerik.Web.UI.WebResource.axd:3884
    10. Telerik.Web.UI.RadMultiPage._selectPageViewByIndexTelerik.Web.UI.WebResource.axd:3945
    11. Telerik.Web.UI.RadPageView._selectTelerik.Web.UI.WebResource.axd:3874
    12. Telerik.Web.UI.RadTab._selectPageViewTelerik.Web.UI.WebResource.axd:3040
    13. Telerik.Web.UI.RadTab.selectTelerik.Web.UI.WebResource.axd:3144
    14. Telerik.Web.UI.RadTab.clickTelerik.Web.UI.WebResource.axd:3092
    15. Telerik.Web.UI.RadTabStrip._clickTelerik.Web.UI.WebResource.axd:3556
    16. Telerik.Web.UI.EventMap._onDomEventTelerik.Web.UI.WebResource.axd:2489
    17. g

As a note, we have just upgraded our RadControls from version 2011.2.915  (the click handler of the editor worked fine with this version) to the latest version.
Please provide us with a solution to this problem.
Thank you.
Rumen
Telerik team
 answered on 25 Jan 2012
10 answers
498 views
Hello,

It would be nice to be able to display an empty text in a RadTextBox in password mode.

In the sample below, I setup a RadTextBox in Password mode (line 4) with an empty message (line 5).
<telerik:RadTextBox  
    ID="rtbPassword" 
    runat="server" 
    TextMode="Password" 
    EmptyMessage="Please enter your password" 
    Width="200px" 
    /> 
Unfortunately, when the text box is displayed I cannot read the empty message since it is written as a password => I just get a series of black dots.

Does anybody has an idea to fix this?

BR, Laurent
Edward
Top achievements
Rank 1
 answered on 25 Jan 2012
1 answer
85 views
Hi,
I have a RadUpload in a RadGrid.
I lose the  RadUpload value  when the postback  is generated by RadComboBox in RadGrid.
How can don't lose the RadUpload value?

Thanks.


Shinu
Top achievements
Rank 2
 answered on 25 Jan 2012
1 answer
73 views
Dear SIr,

We are new to Telerik. we have license version of telerik. i just want to know that where to install telerik, on developer computer or on application server...

waiting for quick reply.

Thanks
Mukesh Mishra
Princy
Top achievements
Rank 2
 answered on 25 Jan 2012
0 answers
67 views
Hi,
     I am using Rad grid in my web application. I am using collections to bind it to the rad grid. i will pass values to the collection and bind it to Rad Grid for the first time if i click the button which is outside the Rad grid. When i click the button for the second time i will have a new set of records in my collection. I want this one to be added to the Rad Grid. How it can be done? Here the collection will not retain the value and so if i bind the collection to Rad Grid, i will get only the record that i have added at the last. Instead i want two record in the gird. i.e, the record that was previously in the grid and the new one that i have added to the collection during the click of the button for the second time.

One way of doing is using session or view state -- this will affect the performance which am not interested and the other is loop the grid and add it to collection and add the new records to the collection and bind it to the rad grid. Since looping is involved and as the volume of data grows, it will affect performance. Is ther any other way to accomplish this?


with Regards,
S . Surendar


Surendar S
Top achievements
Rank 1
 asked on 25 Jan 2012
3 answers
131 views
I have an ItemCommand for my grid which is "RowClick", which updates a group of labels via ajax when a row is clicked.

On the PreRender event of the grid I am selecting the first row on page load, how can I fire off the "RowClick" ItemCommand?

Thanks,
Craig Mellon
Top achievements
Rank 1
 answered on 25 Jan 2012
1 answer
37 views
HI,

I have another drop down before the field to choose the object. Is is possible.

Please see the attachment for more info.

Thanks
Praveen Tomar
Marin
Telerik team
 answered on 25 Jan 2012
0 answers
66 views
hi,

iinstalled WSS and sharepoint in my system but in services Windows sharepoint services are always stopping if i start service immediately with in 1 min service is stopping


please give me any solution


Thanks
Abu
Top achievements
Rank 1
 asked on 25 Jan 2012
1 answer
53 views
I chose a filename with an underscore in the string, e.g. "Primary_menu"; and in do so, I noticed that the colors and other properties I changed--and incidentally saved--were not actually saved, but rather ignored. I thought I may be doing something wrong or a problem with Visual Style Builder was occurring. Well, it appears that by removing the underscore to: "PrimaryMenu", caused everything to save and update properly.

This is not an issue for me, but I thought I'd ask the Forum if I missed something, the Forum had in fact encountered this, or let others know that this exists and that they simply need to do as I did--remove the underscore to proceed as expected. I hope this helps others out there from losing valuable time running down this nuisance.

-Don
Bozhidar
Telerik team
 answered on 25 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?