Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
119 views
I have a grid with 2 text boxes, 1 for a youtube link, the other for its description.  When I paste the link into the textbox and click the save button, I get a javascript error and the page crashes.  Heres the grid code

<telerik:GridTemplateColumn UniqueName="YouTubeLink" HeaderText="YouTube Link"  SortExpression="YouTubeLink">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "YouTubeLink")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadTextBox ID="RadTextBoxLink" Runat="server" Skin="Vista" Width="400px" MaxLength="2000" TextMode="MultiLine" Rows="10">
                                                    </telerik:RadTextBox>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
 and this is the link im trying to save

<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/xT4Kw3A0pHI?fs=1&;hl=en_GB"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/xT4Kw3A0pHI?fs=1&;hl=en_GB" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

Im basically setting up a data entry screen where users can save various youtube links for subsequent display on their website, surely this is possible ?  Can anyone help me out ?
Daniel
Telerik team
 answered on 23 Dec 2010
3 answers
100 views
I have a radGrid on my page and a user control containing a radWindow which contains a radTabStrip. When a row of the radGrid is double-clicked I open the radWindow and load the first tab of the radTabStrip. Clicking on one of the tabs in the tabstrip causes a postback to load that tab. When the postback occurs, the currently selected row in the radGrid is lost! This only happens if I ajaxify the grid. I've tried got the tabstrip and its multipage ajaxified as per your examples and it works fine. The AjaxManagerProxy in the user control looks like this:

<telerik:RadAjaxManagerProxy runat="server" ID="rampTicketDetail">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rtsTicketDetail">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rtsTicketDetail" LoadingPanelID="ralpTicketDetail" />
                <telerik:AjaxUpdatedControl ControlID="rmpTicketDetail" LoadingPanelID="ralpTicketDetail" />
                <telerik:AjaxUpdatedControl ControlID="hfTicketDetailParams" LoadingPanelID="ralpTicketDetail" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="rmpTicketDetail">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rmpTicketDetail" LoadingPanelID="ralpTicketDetail" />
                <telerik:AjaxUpdatedControl ControlID="hfTicketDetailParams" LoadingPanelID="ralpTicketDetail" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

As I said, that works great, but I'd like to be able to perform an action from one of the tabs that will affect the selected row of the grid. I can successfully get the selected row of the grid as long as it is not ajaxified, but I apparently, according to your examples, need to ajaxify the grid and the AjaxManagerProxy in order to rebind the grid when the radWindow is closed. However, as soon as I add the AjaxManagerProxy to the page containing the radGrid and set it up, the currently selected row is lost on postback. Here is the AjaxManagerProxy for the page containing the grid:

<telerik:RadAjaxManagerProxy runat="server" ID="rampMainContent">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rampMainContent">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cpRadGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="cpRadGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cpRadGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

I've also tried adding the user control to the above AjaxManagerProxy, both as an updated control of the grid and as an updater of the grid, but neither of those options work either. FYI: the user control does implement INamingContainer.
Iana Tsolova
Telerik team
 answered on 23 Dec 2010
1 answer
66 views
IT appears that the Panel Bar  On Expand is NOT firing after the panel has been expanded? Anyone else experience this? Any work around?
Shinu
Top achievements
Rank 2
 answered on 23 Dec 2010
1 answer
91 views
Hi,

I am using a Radtabstrip with 2 tabs in which I am showing 2 user control and both are having Radgrid and I am trying to add ajax manger to it. One of my user control is already having RadAjaxManagerProxy. When I click on tabs, the user control without ajax manger is coming but the one with ajax manager doesn't come up.
Is this because the grid is having multiple ajax manager?
Pavlina
Telerik team
 answered on 23 Dec 2010
1 answer
161 views
We need to upgrade our existing Telerik.Web.UI.dll to the latest release because IE9 users get 'undefined' when clicking on the radbuttons and the new Telerik.Web.UI.dll seems to take care of that issue.  The last time we deployed a new Telerik.Web.UI.dll to our production servers, every customer had to clear their cookies/cache before they were able to use our site properly.  We would like to avoid the disruption to our site, not to mention the thousands of calls to our technical support line.  Is there a way to avoid this?  What is the proper way to deploy the new Telerik.Web.UI.dll?
Sebastian
Telerik team
 answered on 23 Dec 2010
1 answer
74 views
I am having an issue where the progress area does not display when uploading very large files.  From the same page I attempt to upload a 300MB file and the progressarea will display correctly, but if submitting a very large file like 3Gb file to the same page no progress indicator is displayed.  

I have brought my code down to the basics as shown below and still the exact same results.

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
   </telerik:RadScriptManager>
 
   <telerik:RadUpload ID="RadUpload1" runat="server" />
   <telerik:RadProgressArea ID="RadProgressArea1" runat="server" />
   <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
   <asp:Button ID="Button1" runat="server" Text="Submit" />

The web.config is set correctly for large file sizes as when pressing submit with a very large file selected will still upload the file without error, only the progress area is not displayed.

Any help would be appreciated..

Thanks,
Bobby
Genady Sergeev
Telerik team
 answered on 23 Dec 2010
3 answers
130 views
I have this simple case where I'm using a simple automatic editing functionality of the RadGrid but the only filed that is allowed in edit mode is more like a memo and I need it's height and width expanded. I'm not using any templates here. Kindly see attached screen.

<asp:Panel runat="server" ID="PanelGrid" Width="630px">
  <fieldset id="fieldGrid" style="width: 608px;">
    <legend>Notes History</legend>
    <telerik:RadGrid ID="RadGridJobs2" runat="server" AutoGenerateColumns="False" AllowPaging="True" GridLines="None"
      Width="608px" Skin="Office2007" SkinID="RadGrid_Paging_Page20_NoExport_Add" AllowAutomaticDeletes="false"
      AllowAutomaticInserts="True" DataSourceID="LinqDataSourceNotes" OnUpdateCommand="RadGridJobs2_UpdateCommand">
      <MasterTableView DataKeyNames="OID" DataSourceID="LinqDataSourceNotes" GridLines="None" CommandItemDisplay="Top">
        <Columns>
          <telerik:GridBoundColumn DataField="NoteDetails" HeaderText="Note" SortExpression="NoteDetails" UniqueName="columnNoteDetails"
            Visible="false" />
          <telerik:GridTemplateColumn UniqueName="columnNewNote" HeaderText="Note History">
            <ItemTemplate>
              <table cellspacing="0" cellpadding="0" width="100%" border="0" class="TableNoBorders">
                <tr>
                  <td>
                    <%# "<div><span style='font-weight: bold; '>By </span><span style='font-style: italic; '>" + Eval("User.FirstName") + " " + Eval("User.LastName") + "</span><span style='font-weight: bold; '> on </span><span style='font-style: italic; '>" + Eval("NoteDate", "{0:dd-MMM-yyyy hh:mm tt}") + "</span></div>"%>
                  </td>
                </tr>
                <tr>
                  <td>
                    <%# "<div style='font-weight: bold; '>Note: </div>" + Eval("NoteDetails")%>
                  </td>
                </tr>
              </table>
            </ItemTemplate>
          </telerik:GridTemplateColumn>
          <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="10px" ItemStyle-Width="10px" />
          <telerik:GridClientDeleteColumn ButtonType="ImageButton" HeaderStyle-Width="10px" ItemStyle-Width="10px"
            Visible="false" />
        </Columns>
        <CommandItemSettings AddNewRecordText="New Note" />
        <EditFormSettings>
          <EditColumn ButtonType="ImageButton" />
        </EditFormSettings>
      </MasterTableView>
    </telerik:RadGrid>
  </fieldset>
</asp:Panel>

protected void RadGridJobs2_UpdateCommand(object source, GridCommandEventArgs e) {
  var editableItem = ((GridEditableItem)e.Item);
  var editNoteID = (long)editableItem.GetDataKeyValue("OID");
 
  //retrieve entity form the Db
  var editNote = DbContext.Notes.Where(nut => nut.OID == editNoteID).FirstOrDefault();
  if (editNote != null) {
    try {
      //update entity's state
      editableItem.UpdateValues(editNote);
 
      //submit changes to Db
      DbContext.SubmitChanges();
 
    } catch (Exception ex) {
 
    }
  }
}
Iana Tsolova
Telerik team
 answered on 23 Dec 2010
1 answer
70 views
hello
I have radwindow which through which I select a row and click on a link button to open another radwindow.
In that radwindow I update a column & save the changes.I've used a radlist box to do so.
But what i want to do is when the user makes changes to the column & if he clicks on 'X' (close option)of the window, he should be asked to
either wait & save the column (by keeping the current window open)or close the curent window without saving the changes.

I figured a way out to display a message using 'confirm' of javascript but i am not able to keep the window open.

So can anybody help me out

Thanks in advance
 Soham Patel
Georgi Tunev
Telerik team
 answered on 23 Dec 2010
4 answers
141 views


Hi Everyone

I am having trouble with a RequiredField Validator for a ComboBox in Edit Form.

This is the scenario:

I have a grid with 3 columns:
1 TemplateColumn with a ComboBox as its EditItemTemplate
2 GridNumericColumns

 

I’ve placed OnBlur and OnFocus events on the two NumericColumnEditors.

I’ve Placed a Compare Field Validator for the comboBox

I’ve also disabled the ComboBox when it is in the Edit form.

 

Now, this works fine when I am in the Insert Form but when I hit the edit command  I get this error:

 

htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.


This is the JSCode:


var oldValue;
function Focus(sender, eventArgs)
{
     oldValue = sender.get_value();
}
              
function Blur (sender, eventArgs)
{
    if ( sender.get_value() < 0)
    {
         radalert('El valor no puede ser negativo',200,100,'Alerta');
         sender.set_value(oldValue);
    }                                    
}

Markup:

<Columns>
      
    <telerik:GridTemplateColumn UniqueName="LINEA" HeaderText="Linea ISA" AllowFiltering="False">
        <ItemTemplate>
            <asp:Label ID="LIN" runat="server" Width="80px">
                   <%# DataBinder.Eval(Container.DataItem, "LINEA")%>
            </asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
            <telerik:RadComboBox DataTextField="EQUIPO" DataValueField="EQUIPO" EnableLoadOnDemand="True"
                ID="RadCmbBx_Linea" runat="server" MarkFirstMatch="True" OnSelectedIndexChanged="RadCmbBx_Linea_SelectedIndexChanged"
                AutoPostBack="true">
            </telerik:RadComboBox>
            <asp:CompareValidator ValueToCompare="Select..." Operator="NotEqual" ControlToValidate="RadCmbBx_Linea"
                ErrorMessage="You must select a city!" runat="server" ID="Comparevalidator1" />
        </EditItemTemplate>
    </telerik:GridTemplateColumn>
      
    <telerik:GridNumericColumn DataField="ENERGIA_ACTIVA_HOY" UniqueName="ENERGIA_ACTIVA_HOY" HeaderText="Energia Hoy" />
      
    <telerik:GridNumericColumn DataField="ENERGIA_REACTIVA_HOY" UniqueName="ENERGIA_REACTIVA_HOY" HeaderText="Energia Hoy ReActiva" />
      
</Columns>

CodeBehind:

protected void RgridLineasISA_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && (e.Item.IsInEditMode))
    {
        RadComboBox comboLinea = e.Item.FindControl("RadCmbBx_Linea") as RadComboBox;
        comboLinea.DataSource = new OES.Business.Equipo().ListLineasISA(); 
        comboLinea.DataBind();
        comboLinea.Items.Insert(0, new RadComboBoxItem("Select..."));
  
        if ((e.Item as GridEditableItem).IsInEditMode && (e.Item as GridEditableItem).IsDataBound && e.Item.ItemIndex != -1)
        {
            comboLinea.SelectedValue = ((OES_LineasISA)e.Item.DataItem).LINEA.ToString();
            comboLinea.Enabled = false;
    }
}
  
    protected void RgridLineasISA_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && (e.Item.IsInEditMode))
        {
            GridNumericColumnEditor editorEnerActHoy = (GridNumericColumnEditor)e.Item.EditManager.GetColumnEditor("ENERGIA_ACTIVA_HOY");
            editorEnerActHoy.NumericTextBox.ClientEvents.OnBlur = "Blur";
            editorEnerActHoy.NumericTextBox.ClientEvents.OnFocus = "Focus";
  
            GridNumericColumnEditor editorEnerReactHoy = (GridNumericColumnEditor)e.Item.EditManager.GetColumnEditor("ENERGIA_REACTIVA_HOY");
            editorEnerReactHoy.NumericTextBox.ClientEvents.OnBlur = "Blur";
            editorEnerReactHoy.NumericTextBox.ClientEvents.OnFocus = "Focus";
        }
    }


The exception is due to the CompareValidator, if I remove it then it works, but I need it in order to validate the ComboBox selected item.

How can I get rid of this execption?

Thanks!
Miguel

Nikolay Rusev
Telerik team
 answered on 23 Dec 2010
1 answer
101 views
Hi,

I wonder if there is anyone who knows how to detect an IFrame breakout condition.

Under the example http://demos.telerik.com/aspnet-ajax/window/examples/default/defaultcs.aspx :

If one selects 'Open New Window' with a URL that has IFRAME breakout detection then the site opens in the main window instead of the newly created RadWindow. I understand there isn't really a way to prevent this however I'm wondering if there's a way to detect it and prevent the main page loading this URL. I would prefer an alert message that tells the user one will navigate away from the page.

The javascript below is not the ideal solution as this confirmation is called on every page refresh, back button etc.
window.onbeforeunload = function () {
       return "This will take you away?";
}

An example of a site with IFRAME breakout detection is  www.k1664.com



Thanks
Georgi Tunev
Telerik team
 answered on 23 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?