Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
217 views
How do I expand the current Row's detail table when I edit the row?

I've followed the code here and used the EditCommand event, but it doesn't work. Should I use the client-side object model instead?

Peter
Top achievements
Rank 1
 answered on 18 Dec 2012
2 answers
72 views
I've basically put in a minimal tooltip on a RadGrid based on this demo:   
http://www.telerik.com/community/forums/aspnet-ajax/grid/tooltip-per-radgrid-row-example-http-demos-telerik-com-aspnet-ajax-tooltip-examples-targetcontrolsandajax-defaultcs-aspx.aspx

2 questions.

1.  Are the techniques described here still fundamentally sound?

2.  I'm binding a RadTextBox to the return from a LinqToSql query.  The textbox is in multiline mode. The field it's bound to is set in another screen using the RadEditor.  i.e. it's rich text.   I was trying to see what would happen if I entered a particularly long string. I'm still testing but apparently sending it a string containing a great deal of HTML markup causes a RadToolTipManager response error = 500.  

(This is in part a 'political' question.  The powers that be like the RadEditor and how it allows 'colorful' text.  In this case I'm wondering if it's a good idea.  For that matter I wonder if including a RadEditor in read-only mode in the popup would be practical.)
Boris
Top achievements
Rank 1
 answered on 17 Dec 2012
4 answers
89 views
Hello,

I'm trying to upgrade my current WinForms application, to a webapplication, with a RadGrid.

I have the following problem: I want to have a checkbox in each row, and when I check it, it must change a row column. After that, a save action, must only update the selected rows. 

I have a table with a lot of receipts, and a table with invoices. In the receipts table, there is a comlumn, named InvoiceID, which binds the receipt to the invoice. Now, I want to have a RadGrid, with all unbinded receipts. Then, when I select a receipt, it must update the InvoiceID with a given number. Then I want to update the table, so the receipts are binded.

Maybe i'm not clear enough. Let me know.

I hope someone can help me.

Thye
Top achievements
Rank 1
 answered on 17 Dec 2012
4 answers
118 views
Hi,

I have two frames on my webpage: Menu frame, and content frame. I have RadSpell set up on the content frame. While spell checking is in progress (dialog open), if I use Menu frame to navigate content frame to a different URL, I am getting a javascript error. Is there any way to force close the spell check dialog when page is unloaded? Maybe a javascript function I can call upon onunload..?

Thanks!
Kate
Rumen
Telerik team
 answered on 17 Dec 2012
1 answer
217 views
Hello All,
I want on my page to force user to save all data before leaving page.
I have used Radprompt with window.onbeforeunload but it will give me two pop-ups one from IE and Other from RadPrompt.
I want only window from RadPrompt.
Can anybody help me for the issue.

Sample code as :

 

<script type="text/javascript"> 

 

var needToConfirm = true;

window.onbeforeunload = confirmExit;

 

function confirmExit() {

 

var ss;

 

 

if (needToConfirm)

{

ss= radalert(

 

'Save personal information', 350, 150, 'MY Message', null, null);

 

}

}


Thanks in advc.
Marin Bratanov
Telerik team
 answered on 17 Dec 2012
3 answers
42 views
Have added 30px x 30px Image to a RadPanelItem on a RadPanelBar which looks fine until I hover over the item when transparent highlight cuts through the image.  The Height attribute does not seem to increase the size of the highlight, how is this done?

Thanks Darren
Boyan Dimitrov
Telerik team
 answered on 17 Dec 2012
4 answers
89 views
Hi there

I have a radTreeView for which I save the expansion status before postback, using the dynamically generated 'expandedNodes' cookie, as is standard. However, I want to be able replace the cookie with one I have created in my server-side PreRender handler for the radTreeView control.

I can rewrite the value of the cookie OK, the problem is when I do so, and add the new cookie using the same name, the old cookie is not replaced, and I end up with two 'expandedNodes' cookies, which evidentally confuses the radTreeView, which ignores both the cookies. I want to replace the old cookie originally generated by the control, to use the server-side version generated by my code, which as far as I am aware uses the correct technique as follows:

                    Dim cookie As HttpCookie = New HttpCookie("expandedNodes")
                    cookie.Value = newcookievalue    // Setup earlier by constructing '*' delimited expansion route
                    cookie.Expires = DateTime.Now.AddDays(1)
                    Response.Cookies.Add(cookie)

after which, at the end of the PreRender handler, the Response.Cookies collection only has 1 expandedNodes cookie, the one I have just added here. But then after the postback is complete, this cookie is ADDED rather than REPLACING the existing cookie of the same name.

How can I get the radTreeView to use the new cookie, instead of the old one? That is, how can I delete the old cookie, which currently seems to be restored by the radTreeView, in addition to the cookie my code is adding. Is this a problem involving some combination of  the ExpandMode property or the Viewstate?

What would be the best approach to this issue?

Regards

Boyan Dimitrov
Telerik team
 answered on 17 Dec 2012
1 answer
95 views
Hi,
I create a server control that create programmatically a grid  with template columns, filter templates , ecc.
Evrithing works fine, but i noticed that when i introduced the MyFilterTemplate class to generate the filter items for any column, if the item (radcombobox, raddatapicker, ecc) include a clientside event then others controls outside the grid  doesn't work propertly.
For example i have a raddatepicker with a DatePopupButton visible outside the grid , after the page load if i click the popupbutton it shows the popup fine; but after an edit/insert of a value in the grid the popupbutton don't show the popup !.
So, my question is, how a programatically definition of a filter template column with clientside events may cause undesired operation of others controls..

This is the code of my filter template class... that as i said before it works perfectly on the grid.

private class MyFilterColumn : ITemplate
        {
            private Telerik.Web.UI.RadComboBox combo;
            private RadDatePicker _rdp;
            protected CommonParameters.GridTemplateColumnType type;
            protected string fieldvalue;
            protected string fieldtext;
 
 
            public MyFilterColumn(string Fieldvalue, string Fieldtext, CommonParameters.GridTemplateColumnType Type)
            {
                fieldvalue = Fieldvalue;
                fieldtext = Fieldtext;
                type = Type;               
            }
            public void InstantiateIn(Control container)
            {
                switch (type)
                {
                    case CommonParameters.GridTemplateColumnType.ComboOnDemand:
                        {
                            combo = new Telerik.Web.UI.RadComboBox();
                            combo.ID = String.Format("RadComboBox{0}", fieldtext);
                            combo.AppendDataBoundItems = true;
                            if (fieldvalue.Length > 0)
                                combo.DataTextField = fieldtext.Substring(fieldtext.IndexOf(".") + 1, (fieldtext.Length - (fieldtext.IndexOf(".") + 1)));
                            combo.DataValueField = fieldvalue;
                            combo.EmptyMessage = "niente";
                            combo.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Tutti"));
                            combo.Enabled = true;
                            combo.DataBound += combo_DataBound;
                            combo.DataBinding += new EventHandler(combo_DataBinding);
                            combo.OnClientSelectedIndexChanged = String.Format("ClientComboFilterSelected_{0}", fieldvalue);
                            container.Controls.Add(combo);
                        }
                        break;
                    case CommonParameters.GridTemplateColumnType.Date:
                        {
                            _rdp = new RadDatePicker();
                            _rdp.ID = "rdpf" + fieldvalue;
                            _rdp.Width = new System.Web.UI.WebControls.Unit(CommonParameters.RadDatePickerWidth);
                            _rdp.DbSelectedDate = _rdpf_DataBinding((GridItem)container.NamingContainer);
 
 
                            string script = "function ClientDataPickerFilterSelected_" + fieldvalue + "(sender,args) {var tableView=$find(\""
                            + ((GridItem)container.NamingContainer).OwnerTableView.ClientID + "\"); var date= FormatSelectedDate(sender);if (date != '') {  alert('data:' + date); tableView.filter(\""
                            + fieldvalue + "\",date,\"EqualTo\");} else { tableView.filter(\"" + fieldvalue + "\",date,\"NoFilter\");  }   }";
                            // tableView.filter(\"" + fieldvalue + "\" ,date,\"NoFilter\");
                            _rdp.ClientEvents.OnDateSelected = script;
 
                            container.Controls.Add(_rdp);
 
                        } break;
                }
            }
 
            DateTime? _rdpf_DataBinding(GridItem pGriditem)
            {
 
                if ((pGriditem).OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue == string.Empty)
                {
                    return new DateTime?();
                }
                else
                {
                    return DateTime.Parse((pGriditem).OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue);
                }
 
            }
 
            void combo_DataBinding(object sender, EventArgs e)
            {
                combo.DataSource = GetData();
            }
            public IList GetData()
            {
                IList mydata;
 
                using (DMWEntities ctx = new DMWEntities())
                {
                    mydata = (from c in ctx.Cli_for
                              orderby c.Denominazione
                              select new { IdFornitore = c.IdCLiFor, c.Denominazione }).ToList();
                }
                return mydata;
            }
 
            void combo_DataBound(object sender, EventArgs e)
            {
                Page page = HttpContext.Current.Handler as Page;
                Telerik.Web.UI.RadComboBox combo = (Telerik.Web.UI.RadComboBox)sender;
                GridItem container = (GridItem)combo.NamingContainer;
                string script = "function ClientComboFilterSelected_" + fieldvalue + "(sender,args) {var tableView=$find(\""
                    + ((GridItem)container).OwnerTableView.ClientID + "\");if (tableView)alert(args.get_item().get_value());tableView.filter(\""
                    + fieldvalue + "\",args.get_item().get_value(),\"EqualTo\");}";
                ScriptManager.RegisterStartupScript(page, page.GetType(), String.Format("ClientComboFilterSelected_{0}", fieldvalue), script, true);
                combo.SelectedValue = container.OwnerTableView.GetColumn(fieldvalue).CurrentFilterValue;
            }
        }
Maria Ilieva
Telerik team
 answered on 17 Dec 2012
4 answers
524 views
I have developed a module on my website with ASP.NET that is using the RadAsyncUpload control from telerik to upload a file on the server. It works fine locally on my pc but on the server it doesn't. 

I've been using IE and it doesn't give an error...when u select to upload a file the dote becomes red instead of green.
In Chrome It jam on Uploads in progress.

What could I have missed? 

Best regards
Kate
Telerik team
 answered on 17 Dec 2012
5 answers
152 views
hi guys,
i'm loading a web page into radwindow....the my code to close the radwindow is:
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
function Close() {
    GetRadWindow().close();
}
 
and i call it form code behind with this code:

Protected Sub Imgbtnclose_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles Imgbtnclose.Click
    Me.ClientScript.RegisterStartupScript(Me.GetType, "", "Close();", True)
End Sub

now in this page there's a radupload object and a custom validator objcect that i used to see the extension error and the code is:

<asp:CustomValidator ID="CustomValidator1" runat="server"
    ClientValidationFunction="validateRadUpload"
    ErrorMessage="Extension error" Font-Bold="True" ForeColor="Red"
    OnServerValidate="CustomValidator1_ServerValidate"
    ValidationGroup="carica"></asp:CustomValidator>
 
    function validateRadUpload(source, e) {
        e.IsValid = false;
        var upload = $find("<%= RadUpload1.ClientID %>");
        var inputs = upload.getFileInputs();
        for (var i = 0; i < inputs.length; i++) {
            //check for empty string or invalid extension    
            if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                e.IsValid = true;
                break;
            }
        }
    }

all this code is ok, but when click on close button for close the radwindow, start the custom validator and start the message error. I would that when click on close button, don't start the validator code but start the code close the radwindow.

Why can i do it?

Thanks












Marin Bratanov
Telerik team
 answered on 17 Dec 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?