Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
152 views
I am trying to add a couple styles to the [Sitefinity] RadEditor "content area" so my anchor tags are highlighted (via background-color css). I'm using the <cssFiles> section of EditorToolsFile.xml to do this and it works great in Firefox/Chrome - but isn't working at all in IE8 or IE7. I've tried deleting my cache, restarting IIS etc but no matter what I try, it seems nothing my external CSS file declares is being rendered/obeyed by IE.

Can anyone help/advise on this?
Rumen
Telerik team
 answered on 06 Apr 2010
1 answer
96 views
Hi,
I have problem with paging in ASP.NET AJAX RadGrid (2009.1). When radgrid is not on first page and I call Rebind() with some narrowing query (result is only one page of records), RadGrid will stuck on non-existent page (eg. Page 11 of 1, Items 110 of 1, Total records 1) and shows NoMasterRecords message.

I must press "go to first page" and then RadGrid starts work correctly. I tried to set RadGrid1.MasterTableView.CurrentPageIndex = 0 after Rebind, but with no luck.

Can you help me? Thank you.

Zdenek

Protected Sub RadToolBar1_ButtonClick(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick 
 
            Case "search"                     
                    RadGrid1.Rebind() 
                    RadGrid1.MasterTableView.CurrentPageIndex = 0 
 End Select 
 
End Sub 
 
Protected Sub ldsLocality_Selecting(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles ldsLocality.Selecting 
 
 
            Dim myLocalities = From loc In dc.Localities Order By loc.Customer.Name, loc.Name Select loc 
 
            'Search 
            Dim serachString As String = String.Empty 
            Dim searchTextBox As RadTextBox = CType(CType(RadToolBar1.FindButtonByCommandName("searchText"), RadToolBarButton).FindControl("txtSearch"), RadTextBox) 
            If searchTextBox IsNot Nothing AndAlso searchTextBox.Text <> String.Empty Then 
                myLocalities = myLocalities.Where(Function(q) _ 
                                                q.CustomerID.ToString.Contains(searchTextBox.Text.Trim) Or _ 
                                                q.Comment.Contains(searchTextBox.Text.Trim) Or _ 
                                                q.Comment2.Contains(searchTextBox.Text.Trim) Or _ 
                                                q.Name.Contains(searchTextBox.Text.Trim)) 
            End If 
 
            e.Result = myLocalities 
        End Sub 
Tsvetoslav
Telerik team
 answered on 06 Apr 2010
2 answers
226 views
Hi:

I need to solve this issues on the combobox:

1) When I first load my page, the radcombobox doesnt load any item, it loads them just after the first callback on the page, a callback fired by another control different to the radcombobox. In the first try it shows just the "loading" message but it doesnt return any item.

2) How can I use the onselectindexchanged in the radcombobox using the loadondemand funcionality? I need to load a labels and textboxes after the selectedvalued is changed on the radcombobox, but this event is never fired.

3) I have a master page, in which I have defined a RadScriptManager, RadAjaxLoadingPanel, RadAjaxPanel

4) Inside the RadAjaxPanel, I have a contentplaceholder.

5) In my content pages I have defined a radcombobox like this:
<telerik:RadComboBox ID="cmbUC" runat="server" Height="230px" Width="230px" 
                                                            DropDownWidth="215px" EmptyMessage="Select an UC" HighlightTemplatedItems="true"  
                                                            EnableLoadOnDemand="true" OnItemsRequested="cmbUC_ItemsRequested" ShowWhileLoading="true"
                                                            <HeaderTemplate> 
                                                                <table style="width: 200px" cellspacing="0" cellpadding="0"
                                                                    <tr> 
                                                                        <td style="width: 40px;"
                                                                            Plates</td> 
                                                                        <td style="width: 160px;"
                                                                            UC</td> 
                                                                    </tr> 
                                                                </table> 
                                                            </HeaderTemplate> 
                                                            <ItemTemplate> 
                                                                <table style="width: 200px" cellspacing="0" cellpadding="0"
                                                                    <tr> 
                                                                        <td style="width: 40px;"
                                                                            <%# DataBinder.Eval(Container, "Text")%> 
                                                                        </td> 
                                                                        <td style="width: 160px;"
                                                                            <%# DataBinder.Eval(Container, "Attributes['uc']")%> 
                                                                        </td> 
                                                                    </tr> 
                                                                </table> 
                                                            </ItemTemplate> 
                                                        </telerik:RadComboBox> 
                                                        <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="cmbUC" 
                                                            ErrorMessage="!" CssClass="validator"
                                                        </asp:RequiredFieldValidator>   

In the server side:
    protected void cmbUC_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) 
    { 
        Tbl01UCCollection _uccollection = new Tbl01UCCollection(); 
 
        _uccollection = cTbl01UC.UnidadCargaCollectionLoadFilter(Convert.ToInt32(Session["sesCompany"]), e.Text); 
 
        foreach (Tbl01UC _uc in _uccollection) 
        { 
            RadComboBoxItem item = new RadComboBoxItem(); 
 
            item.Text = _uc.Plates; 
            item.Value = _uc.Rowid.ToString(); 
 
            item.Attributes.Add("uc", _uc.Descripcion); 
 
            cmbUCItems.Add(item); 
 
            item.DataBind(); 
        } 
    } 
Simon
Telerik team
 answered on 06 Apr 2010
2 answers
133 views
Hey!

I have a question to the binding mechanism and what is better for the performance of my site. I created a website with currently about 6 RadGrids and I bound these grids with different ObjectDataSources. Now the performance is not very well, it takes about 7 seconds until the whole page is loaded and in the database there are only a few rows.

Is there a way to improve this performance and is it a better choice to bind the RadGrids manually in the code behind class?

Thanks for any help!

Simon
Top achievements
Rank 1
 answered on 06 Apr 2010
1 answer
109 views

I am using a RadWindow to show a wizard style dialog.  On the page I have a RadMultiPage and on each pageview I have the controls  and navigation buttons.

The first pageview contains two RadListBoxes.  The first one has autopostback set to true and on the Check event I populate the second listbox.  I have these ajaxified as follows:

<telerik:AjaxSetting AjaxControlID="rlbList1">  
    <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="rlbList1" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList2" /> 
        <telerik:AjaxUpdatedControl ControlID="lblErrorText" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 

This works fine, when I click an item in the first list the second list is updated correctly through the callback.

The issues come in when I press the "Next" button on this pageview.  I have it ajaxified as follows:
<telerik:AjaxSetting AjaxControlID="btnNext">  
    <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="btnNext" LoadingPanelID="rlpDisable" /> 
        <telerik:AjaxUpdatedControl ControlID="btnCancel" LoadingPanelID="rlpDisable" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList1" /> 
        <telerik:AjaxUpdatedControl ControlID="rlbList2" />                          
        <telerik:AjaxUpdatedControl ControlID="rmpMain" /> 
        <telerik:AjaxUpdatedControl ControlID="lblPage1ErrorText" /> 
        <telerik:AjaxUpdatedControl ControlID="lblPage2ErrorText" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 


This is the code I have in the Next click event method, Page_Load and Init only have code that runs on the initial load.

if (rlbList2.CheckedItems.Count == 0)  
{  
    lblErrorText.Text = "At least one item must be selected.";  
}  
else 
{  
    //Populate items on the second page using selected items on first page  
    _PopulateListOnPage2(rlbList2.CheckedItems.Select(p => p.Value).ToArray());  
    rmpMain.SelectedIndex = 1;  


This causes two "a is undefined" errors in javascript.  If I remove the rlbList# controls from the ajax this stops the javascript errors. 

The other issue is that if an error occurrs and I don't change the mulpage selectedindex, then the buttons disappear.  I've tried it without the loading panel showing over the buttons and the same thing occurs.  Also, if I leave the listboxes in the updated controls collection these will also disappear if the selected pageview doesn't change (I receive the 'a is undefined' errors though). 

But if I switch to the next pageview and come back to this one then everything shows correctly. 

If I remove the Ajax manager then everything works correctly through the postbacks.  So to get around this I removed the Ajax manager and wrapped the MultipPage with a RadAjaxPanel and now everything seems to work correctly.  I would rather not do this though because the loading panel shows over the whole ajax panel control instead of just the controls I want to disable.  Is there something I'm missing with how the ajax manager works with the RadMultiPage or why would my controls be disappearing?


Yavor
Telerik team
 answered on 06 Apr 2010
1 answer
200 views
(I was surprised that "custom" and "attributes" returned nothing in the search!)

I'm following the "Custom resources and attributes" section of the RadScheduler tree
(http://www.telerik.com/help/aspnet-ajax/schedule_designcustomresourcesandattributes.html)

and am trying to add an attribute.

There's a seemingly throw-away line at the bottom that says "If you enable custom attribute editing, be sure that your insert and update statements accept a parameter with the name of the custom attribute."

Since I'm using a custom "MyDbScheduleProvider" to do all the work, can someone post an example of how I would alter the GetAppointments, Insert, and Update functions to accomidate the new attribute?

Thanks!

Peter
Telerik team
 answered on 06 Apr 2010
2 answers
201 views
Hi,
        I am using radalert in javascript as below.

radalert("Saved Successfully.", 400, 150,

"Title");

 

window.location.href =

"Common.aspx";

Here the problem is before i click on OK button shown in Radalert, it is getting redirected to Common.aspx.
How to avoid this? I want to remain in the same page till i click on OK.

Note: This doesnt happen in default alert.

Thank You.

 

Swapna M
Top achievements
Rank 1
 answered on 06 Apr 2010
1 answer
179 views
Hi,

I have users pasting content into a radEditor in a content management system. Unfortunately the tools they are pasting from have some funny ideas about what constitutes valid HTML.

In one case, the user pasted this:

<ul> 
        <li> 
            <div style="text-align: left;"
                BLAH BLAH BLAH BLAH<span style="font-family: arial; font-size: 10px;">6 
                    <div> 
                    </div> 
                    <li> 
                        <div style="text-align: left;"
                        </div> 
                    </li> 
                </span> 
            </div> 
        </li> 
    </ul> 

You will notice that there is an <li> tag inside a <span> inside another <li> tag.

<understatement> This caused a problem. </understatement>

After this content had been saved to the database, the UpdatePanel where it was displayed could no longer successfully execute postbacks. Attempts to save the object hosting this content via a button in the panel consistently threw a JSON serialization error (Invalid JSON Primitive: .) From what I can gather, the updatePanel tried to package this invalid content up as part of its AJAX request, and the deserializer on the server blew up when presented with it. After removing the offending markup (extra <li>) in the database, the panel returned to normal operation and save attempts succeeded.

So, my question is, how can I validate user-pasted garbage to ensure that the JSON deserializer will be able to handle it? Is there an option on the editor or a recommended approach? And, when encountering invalid pasted content, is there a way to strip the offending markup?

Thanks in advance,

Jordan


Dobromir
Telerik team
 answered on 06 Apr 2010
1 answer
157 views
I use a radotator with a DataSet DataSource. The dataset contains a table with 3 columns.

I can detect the current item using the get_currentItem() method. How do i get the value of a DataItem Column ClientSide?
Fiko
Telerik team
 answered on 06 Apr 2010
6 answers
162 views
Hello,

I am using the RAD Editor to post articles. We would like the HTML formatting to be retained. But when we save it to the database the HTML tags are converted to blocks

e.g. <BR /> is converted to [BR/] which causes the formatting to be completely lost.

Can anyone please assist?

Thanks
Bala
Rumen
Telerik team
 answered on 06 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?