Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
188 views
I just noticed something strange while I was testing for an unrelated issue.

I have a RadTreeView that loads content into a RadTabStrip/Mulitpage. In one of the tabs I have a RadUpload control. The tree and the tabstrip are Ajaxified.

When I click on a node in the TreeView it loads the relevant content in the tabs. However, I have just noticed while monitoring my application with Fiddler that after the inital load I get multiple (infinite?) calls to: http://servername:8070/Telerik.RadUploadProgressHandler.ashx?RadUrid=784e5751-9181-4e49-bb82-44cd26a3f791&RadUploadTimeStamp=1281621267773&

These keep on going until I kill the browser. At the point in which this is happening no file has been selected for upload. The upload tab isn't even visible at this point.

Have I set my RadUpload up incorrectly? Why is this happening?

Thanks,
Scott.
Hristo Valyavicharski
Telerik team
 answered on 07 Jan 2015
3 answers
103 views
 I have an independent Radpager in my page with no grid or listview. I have an asp placeholder inside the fields of this pager which all the linkbuttons (numbers) will be added to this placeholder dynamically. I want to add the PageButtonCount to this placeholder to prevent increasing the with of raddatapager. becaz now each linkbutton is being added to the placeHolder and causes that to show all numbers. Please help me asap. I need to hide some of those pages like the PageButtonCount in this placeholder.


<telerik:RadDataPager ID="RadDataPager1" runat="server" >                            
     <Fields>                                           
 <asp:ImageButtonID="prev"ImageUrl="previous.jpg"/> 
<asp:PlaceHolderID="Placeholder1" runat="server"/>  
<asp:ImageButtonID="Next"ImageUrl="Next.jpg"/>                                             <                                    </Fields>                                    </telerik:RadDataPager>
Daniel
Telerik team
 answered on 07 Jan 2015
1 answer
275 views
I have a RadDataForm:
 
        <telerik:RadDataForm runat="server" ID="RadDataForm1"
            DataKeyNames="IdCompra"
            DataSourceID="dsCompraDivisasEncabezado"
            Skin="Windows7"
            OnDataBound="RadDataForm1_DataBound"
            OnItemInserting="RadDataForm1_ItemInserting"
        >

            <EditItemTemplate>
                <fieldset class="rdfFieldset rdfBorders" style="width:550px;">
                    <legend class="rdfLegend">Compra de Divisas</legend>
                    <div class="rdfRow">
                        <asp:Label ID="lblIdCompania" runat="server" CssClass="rdfLabel rdfBlock" Text="Id CompaƱia:"></asp:Label>
                        <telerik:RadComboBox runat="server" ID="rcbCompania" 
                            DataSourceID="dsCompanias" 
                            DataTextField="CompaniaDescripcion"
                            DataValueField="IdCompania" 
                            AutoPostBack="true"
                            OnSelectedIndexChanged="rcbCompania_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </div>

                    <div class="rdfRow">
                        <asp:Label ID="lblIdPlanta" runat="server" CssClass="rdfLabel rdfBlock" Text="Planta:"></asp:Label>
                        <asp:Label ID="lblIdPlantaValor" runat="server" CssClass="rdfFieldValue" Text='<%# String.Concat(Eval("IdPlanta"), " - ",Eval("PlantaDescripcion"))%>' />
                    </div>
                </fieldset>
            </EditItemTemplate>

            <InsertItemTemplate>
                <fieldset class="rdfFieldset rdfBorders" style="width:550px;">
                    <legend class="rdfLegend">Compra de Divisas</legend>
                    <div class="rdfRow">
                        <asp:Label ID="lblIdCompania" runat="server" CssClass="rdfLabel rdfBlock" Text="Id CompaƱia:"></asp:Label>
                        <telerik:RadComboBox runat="server" ID="rcbCompania" 
                            DataSourceID="dsCompanias" 
                            DataTextField="CompaniaDescripcion"
                            DataValueField="IdCompania" 
                            AutoPostBack="true"
                            OnSelectedIndexChanged="rcbCompania_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </div>

                    <div class="rdfRow">
                        <asp:Label ID="lblIdPlanta" runat="server" CssClass="rdfLabel rdfBlock" Text="Planta:"></asp:Label>
                        <asp:Label ID="lblIdPlantaValor" runat="server" CssClass="rdfFieldValue" Text='<%# String.Concat(Eval("IdPlanta"), " - ",Eval("PlantaDescripcion"))%>' />
                    </div>
                </fieldset>
            </InsertItemTemplate>

The next procedure works when RadDataForm is in edit mode:

protected void rcbCompania_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)

        {
            RadComboBox rcbCompania = (RadComboBox)sender;
            Label lblIdPlantaValor = (Label)RadDataForm1.Items[0].FindControl("lblIdPlantaValor");

            string strMensaje = "";
            DataTable dtCompania = CompaniaConsulta("Divisas", "ID", rcbCompania.SelectedValue, out strMensaje);

            lblIdPlantaValor.Text = dtCompania.Rows[0]["IdPlanta"].ToString() + "-" + dtCompania.Rows[0]["PlantaDescripcion"].ToString();
        } but when it is in Insert mode it says: RadDataForm1.Items.Count = 0.  How can i find the control?






Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
1 answer
41 views
Hello,

I am having an issue where i am using the modal style editing for my grid.

For update and delete i am using a linkbutton column which is properly bringing up the modal and will close any existing modal before that. However if the new record modal is already up, that one will not get closed by the edit/delete linkbutton.

The new record button does however close an existing edit/delete modal.

On grid_ItemCommand am i doing a grid.MasterTableView.ClearEditItems for all three commands, and it does indeed take the grid out of edit mode, however the modal doesn't close for the edit and delete commands.

Any ideas ?

Thanks,

Max T.
Viktor Tachev
Telerik team
 answered on 07 Jan 2015
1 answer
78 views
I have discovered that the solution offered for moving a custom dialog box from its' automatically centered position does not work.

Well, it does work, but when you successfully complete the dialog box (i.e. hitting a submit button), the RadWindow dialog reappears with no rhyme or reason and, furthermore, you can't close it or click any of the buttons.

...
<body>
    <form id="form1" runat="server">
    <table>
...
        <tr id="trFileName" runat="server">
            <td><asp:Label ID="lblFile" runat="server">File name:</asp:Label></td>
            <td><asp:FileUpload ID="txtFileName" runat="server" EnableViewState="true"></asp:FileUpload></td>
        </tr>
...
    </table>
 
    <asp:TextBox ID="txtOldFile" runat="server" style="display:none;" />
    <asp:Button ID="btnSubmit" runat="server" Text="Update" OnClientClick="insertLink();" />
  
    <script type="text/javascript">
        if (window.attachEvent) {
            window.attachEvent("onload", initDialog);
        }
        else if (window.addEventListener) {
            window.addEventListener("load", initDialog, false);
        }
 
        var workLink = null;
 
        function getRadWindow() {
            if (window.radWindow) {
                return window.radWindow;
            }
            if (window.frameElement && window.frameElement.radWindow) {
                return window.frameElement.radWindow;
            }
            return null;
        }
 
        function initDialog() {
            var clientParameters = getRadWindow().ClientParameters; //return the arguments supplied from the parent page
            getRadWindow().moveTo(50, 50); // <----- Commenting this line does not result in the window reappearing.
            //window.removeEventListener("load", initDialog, false); // <---- Tried this with no change in behavior.
            workLink = clientParameters;
        }
 
        function insertLink() //fires when the Insert Link button is clicked
        {
            //create an object and set some custom properties to it     
            var file = document.getElementById("<%=txtFileName.ClientID%>");
            var path = file.value;
            var ext = path.substring(path.lastIndexOf(".") + 1, path.length).toLowerCase();
 
            if (ext == null || ext == "") {
                workLink.href = document.getElementById("<%=txtOldFile.ClientID%>").value;
            } else {
                workLink.href = ext;
            }
 
            getRadWindow().close(workLink); //use the close function of the getRadWindow to close the dialog and pass the arguments from the dialog to the callback function on the main page.
        }
    </script>
  
    </form>
</body>
</html>

I'm guessing this KB was published quite a long time ago and has changed in future releases of Telerik AJAX.  Can you tell me if there's a way for me to fix this dilemma?  I have to move the dialog because I have a footer where the dialog hides under if the browser window is too small.

Thanks again!
Ianko
Telerik team
 answered on 07 Jan 2015
4 answers
95 views
Hi,

I have a set of 3 line series on my chart which is databound using a datatable. This works well and I have the 3 line series displayed as expected. 

What I'm trying to do now is to introduce new columns in my datatable which will inform if a given point in a series is special, in which case I want to highlight it (i.e. change the color of that point). I was thinking I can achieve this by adjusting the color while looping through SeriesItems. However, SeriesItems is empty.

Right after binding, I inspect the series and I see 3 series as expected. But when I inspect the SeriesItems (or Items), they are empty.

Both object below are empty after binding, yet the chart displays fine.
Chart.PlotArea.Series[0].Items

(Chart.PlotArea.Series[0] as LineSeries).SeriesItems

Any ideas?

Thanks,
A

Danail Vasilev
Telerik team
 answered on 07 Jan 2015
1 answer
169 views
Hi,
I have a radgrid with checkbox(Template columns) column. By default the checkboxes are selected (written in Itemdatabound) and row is in green color. If the user deselects the checkbox then the row should be in default color.
I wrote the following javascript for checkbox click event.

function GridCheckboxChecked(obj1, rowid) {
                    
                    //ensure that the outer grid dataItem are generated
                    var grid = $find("<%= rgReceivers.ClientID %>");
                    grid.get_masterTableView().get_dataItems();

                    var griditem = $find(rowid);
                    griditem.set_selected(obj1.checked);
                    var girdrow = $('#' + rowid)[0];

                    if (obj1.checked) {
                       
                        $(girdrow).removeAttr("style");
                        $(girdrow).attr("style", "background-color:#C9F1C9");
                    }
                    else {
                        $(girdrow).removeAttr("style");
                    }
                }


It works fine. But if any other ajax request is performed in the screen, all the rows are coming back in Green color again.

I found that there is no method available to track the client side changes for radgrid.
So I reapplied the changes in the radgrid when ajax postback. For that I wrote the following in document.ready function

$(document).ready(function () {
                   
                    var grid = $find("<%= rgReceivers.ClientID %>");
                    console.log(grid);
                    
                    if (grid != null) {
                        var dataItems = grid.get_masterTableView().get_dataItems();

                        for (var i = 0; i < dataItems.length; i++) {
                           // re apply the changes
                        }
                    }
                });

When the page loaded first , it founds the grid object. But for the proceeding ajax calls, the grid object is showing as null.

Following are my ajax settings (applied on page load event)
    
      RadAjaxManager mgr = RadAjaxManager.GetCurrent(Page);
        mgr.AjaxSettings.Clear();
        mgr.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(mgr_AjaxRequest);
        mgr.AjaxSettings.AddAjaxSetting(mgr, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnsendbox, rgReceivers, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnsendbox, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(rgReceivers, pnlContent);
        mgr.AjaxSettings.AddAjaxSetting(rgReceivers, rgReceivers, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnClear, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(btnSave, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(chkCBN, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(cmbRecalNos, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));
        mgr.AjaxSettings.AddAjaxSetting(chkAll, pnlContent, (RadAjaxLoadingPanel)(this.Page.Master as MasterPage).FindControl("RadAjaxLoadingPanel2"));


Why the grid object is showing as null for the ajax postbacks even though it is on the page. How to find the radgrid on ajax postbacks?
Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
1 answer
151 views
I have a RadGrid control inside a RadAjaxPanel. In my jquery code, I make an ajax request to add a new record to RadGrid. It's added sucessfuly. However, it doesn't show up on the page even though I update RadAjaxPanel through the code below.

var panel = <%= ajaxPanel.ClientID %>; 
panel.ajaxRequest('<%= ajaxPanel.UniqueID %>','');

I see that RadAjaxPanel is updated but new record isn't there.I have to refresh the whole page to have the new record show up. Is there any way to do it without refresh?
Maria Ilieva
Telerik team
 answered on 07 Jan 2015
1 answer
62 views
Hi,

Is there any method to persist the client side changes after ajax like .trackChanges() and .commitChanges() for combobox?
Konstantin Dikov
Telerik team
 answered on 07 Jan 2015
6 answers
146 views
      As the form is in ContentPlaceHolder of ContentPlage I ikplement the logic like this........     


      ContentPlaceHolder contentPage = Page.Master.FindControl("ContentPlaceHolder2") as ContentPlaceHolder;
            RadButton radbutton1 = (RadButton)contentPage.FindControl("RadButton1"); 


after this the result in radbutton1  is null as it doesnt find the control RadButton1....

please help me in this
Gopi
Top achievements
Rank 2
 answered on 07 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?