Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
250 views
I am trying to use both the AutoComplete and LoadOnDemand features of the RadComboBox. I have a huge list of popular bands (about 20,000 entries in the database), and I want users to be able to select multiple items from the list by typing a few characters of the band's name.

Please help!

Thanks
Paul


The code I have now is:

<telerik:RadComboBox runat="server" ID="radSimilarArtists" EnableLoadOnDemand="true"
                            EnableVirtualScrolling="true" EnableTextSelection="true" Width="300" MarkFirstMatch="True"
                            AutoCompleteSeparator="," ShowMoreResultsBox="true" AllowCustomText="false" ShowDropDownOnTextboxClick="false"
                            OnItemsRequested="radSimilarArtists_ItemsRequested" Skin="Default" />

And the code behind

  protected void radSimilarArtists_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        MegaService megaClass = new MegaService();
        string textEntered = e.Text;


        DataTable data = megaClass.getSimilarArtists(textEntered).Tables["similarartists"];
        int itemOffset = e.NumberOfItems;
        int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
        e.EndOfItems = endOffset == data.Rows.Count;

        for (int i = itemOffset; i < endOffset; i++)
        {
            radSimilarArtists.Items.Add(new RadComboBoxItem(data.Rows[i]["name"].ToString(), data.Rows[i]["id"].ToString()));
        }

        e.Message = GetStatusMessage(endOffset, data.Rows.Count);
    }
    private static string GetStatusMessage(int offset, int total)
    {
        if (total <= 0)
            return "No matches";

        return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
    }
Simon
Telerik team
 answered on 11 Dec 2009
5 answers
159 views
Hi! I have RadComboBox inside an UpdatePanel. On its selected index change event, i populate other controls inside same update panel and that works fine. But when I make selection from popup window (using ajax control toolkit and modal popup extender), same set of controls (radcombobox too) should be populated, but in that moment (when popup is closed) my combobox is not populated and it's shown only a small part of it.
<asp:UpdatePanel ID="upPartner" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">  
    <ContentTemplate> 
        <table id="tblMain" runat="server" style="width: 100%;" cellpadding="0" cellspacing="0">  
            ...  
            <tr> 
               <td style="width: 75%;">  
                                  
                                <telerik:RadComboBox ID="comboName" runat="server" AllowCustomText="true" Width="75%" 
                                    AutoPostBack="true" Skin="Vista" OnSelectedIndexChanged="comboName_SelectedIndexChanged">  
                                    <ItemTemplate> 
                                        <asp:Label ID="lblItemText" runat="server" CssClass="StandardInput"></asp:Label> 
                                    </ItemTemplate> 
                                </telerik:RadComboBox> 
                            </td> 
                        </tr> 
...  
</ContentTemplate> 
</asp:UpdatePanel> 

I don't know what causes that, update panel or ajax control toolkit or something else?
Thanks, Ana
Simon
Telerik team
 answered on 11 Dec 2009
4 answers
291 views
I am using the RADcombobox for the autosuggest feature. I have a webservice with a webmethod, say, 'MyMethod' which is being used to populate the combobox with the auto suggested values.

If I type something in the Radcombobox input area, the webmethod is called. If I try to navigate away from this page by clicking any other links or buttons on this page, before the webmethod returns with values, I get an error - "Server Method MyMethod failed".

No other error messages. Please advise.
Simon
Telerik team
 answered on 11 Dec 2009
1 answer
149 views
In the Application_Error event of my global.asax I log all untrapped errors and then redirect to an error page.  I need to know whether the page that threw the error is a rad window?  If it is I'll handle it differently. 
So in my case I have
Form1.aspx which does a javascript:window.radopen("popup.aspx", "Popup").  It's the Popup that throws the error.  How can I tell in the application_error event that this was thrown from a radopen?
Georgi Tunev
Telerik team
 answered on 11 Dec 2009
1 answer
127 views
im having a composite control with radcombobox inside, the radcombobox include a radgrid (but the same problem happend when i put a radtree instead of it). the problem is that when opening the combobox, theres a javascript error alert: "Script control '' is not registered script control. script control must be registered using registerscriptcontrol before..."

another problem is that when postback to ComboBox_ItemsRequested, OnPreRender is not called & i dont see the radgrid inside the drop down area of the combobox.

i suppose those three porblems are related.

here is the code:

public

 

class BOBComboBox : CompositeControl {
RadComboBox  ComboBox;
protected override void CreateChildControls()

 

 

 {

 

 

  ComboBox =

new RadComboBox();

 

 

 

 ComboBox.ItemsRequested +=

new RadComboBoxItemsRequestedEventHandler(ComboBox_ItemsRequested);

 

 

 

  ComboBox.EnableLoadOnDemand =

true;
  Controls.Add(ComboBox);

 

 

 

  base.CreateChildControls();
}

void
ComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)

 

 

 

 

 {

 

 

    RadGrid RadGrid = new RadGrid();

 

 

 

 

   RadComboBoxItem RadComboBoxItem = new RadComboBoxItem();

 

 

     RadComboBoxItem.Controls.Add(RadGrid);

     ComboBox.Items.Add(RadComboBoxItem);

 }

 

 



protected
override void OnPreRender(EventArgs e)

 

 

 

{

 

   if (ComboBox != null)

 

 

   { 

 

        RadAjaxManager manager = RadAjaxManager.GetCurrent(this.Page);

        manager.AjaxSettings.AddAjaxSetting(ComboBox, ComboBox);

   }

 

    base.OnPreRender(e);

}

}

 

 

 

 

 

 

 

 

Simon
Telerik team
 answered on 11 Dec 2009
1 answer
954 views
Hi Telerik Team,

I had created a application which will export RAD Grid to CSV File. however i cannot export data with proper formatting which i have given to Grid. My requirement is set the background color of Header to Red. It is properly working if i export data to Excel Sheet. how ever my requirement is export data to CSV with proper Formatting

Here is what i have used

         rgExport.DataSource = timesheetList;
                rgExport.DataBind();
                rgExport.ExportSettings.FileName = NextJobPLConstants.TIMESHEET_EXPORT_FILE;

                
                rgExport.ExportSettings.ExportOnlyData = true;
                rgExport.ExportSettings.IgnorePaging = true;
                rgExport.ExportSettings.OpenInNewWindow = true;
                rgExport.MasterTableView.ExportToCSV();
                rgExport.Rebind();



protected void rgExport_ItemCreated(object sender, GridItemEventArgs e)
    {

     


        if (e.Item is GridHeaderItem)
        {
            GridHeaderItem headerItem = (GridHeaderItem)e.Item;
            headerItem.Style["font-size"] = "12px";
            headerItem.Style["font-style"] = "Verdana";
            headerItem.Style["color"] = "black";
            headerItem.Style["background-color"] = "#99CC00";
            headerItem.Style["border-width"] = "1";
            headerItem.Style["border-style"] = "Solid";
            headerItem.Style["border-color"] = "black";
            headerItem.Style["height"] = "50px";
            headerItem.Style["vertical-align"] = "bottom";
            headerItem.Style["horizontal-align"] = "center";
            foreach (TableCell cell in headerItem.Cells)
            {
                cell.Style["text-align"] = "center";
                cell.Style["font-weight"] = "bold";

            }
        }

        if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            dataItem.Style["background-color"] = "#CCFFFF";
            dataItem.Style["border-width"] = "1";
            dataItem.Style["border-style"] = "Solid";
            dataItem.Style["border-color"] = "black";
            dataItem.Style["font-style"] = "Verdana";

        }
        
    }

Please help me in this matter.

Thanks,

Amol




Daniel
Telerik team
 answered on 11 Dec 2009
1 answer
251 views
 Hi,
 Please can you tell my how I can access the appointment clicked date in a RadScheduler. It is not the Selected date, as this seems to be the same no matter what date I click. You would have thought that this was simple, but apparently not.

Below is the html for my scheduler and the onclick event


 <telerik:RadScheduler ID="RadSchedAbsence"
               runat="server" AllowEdit="False" AllowInsert="False" AllowDelete="False"  Height="550px"
                  Culture="English (United Kingdom)" DataEndField="event_end" DataKeyField="id"
                  DataSourceID="sds_absence_for_scheduler" DataStartField="event_start" DataSubjectField="absence_detail"
                  SelectedView="MonthView" Width="600px" Visible="False" Skin="Vista" OnAppointmentClick="RadSchedAbsence_AppointmentClick" ReadOnly="True" >
                  <TimelineView UserSelectable="False" />
                  <WeekView UserSelectable="False" />
                  <DayView UserSelectable="False" />
              </telerik:RadScheduler>

// On appointment click event

          Servizio.Rota rota = new Servizio.Rota();

        DataTable dtAbsences ;

        dtAbsences = rota.GetAbsencesForDay(Convert.ToInt32(ddl_absenceType.SelectedValue), this.RadSchedAbsence.SelectedDate.ToString("yyyy-MM-dd"));
        //this.sds_absence_by_date.SelectParameters["absence_type_id"].DefaultValue = ddl_absenceType.SelectedValue;
        //this.sds_absence_by_date.SelectParameters["selected_date"].DefaultValue = this.RadSchedAbsence.SelectedDate.ToString("yyyy-dd-MM");

        RadGrid1.DataSource = dtAbsences;

        DataView returnedDataView = (DataView)sds_absence_by_date.Select(DataSourceSelectArguments.Empty);

        RadGrid1.DataBind();

Princy
Top achievements
Rank 2
 answered on 11 Dec 2009
1 answer
132 views
Hallo Telerik-Team,

I need to have a custom paging under my RadGrid like 1 2 3 4 5 6 7 ... without using PagerStyle Mode="NumericPages"></PagerStyle>.

Is there any example how to do this.

regards
Christian
Shinu
Top achievements
Rank 2
 answered on 11 Dec 2009
3 answers
155 views
Hello mates,
I have a little question, just couldn't figure the solution...

The web application have a structure like;
-interface.aspx (Contains Ajaxmanager)
----manageitems.ascx (dynamicly added to interface with loadUserControl approach - not ajaxified-contains ajaxproxy)
-------itembase.ascx  (added to manageitems.ascx as referance - ajaxified inside radajaxpanel)


my save button in the itembase.ascx and when save succeed, triggers a event as saveComplete..
manageitems.ascx contains a grid.

my scenario requires after saveComplete event triggered refresh the grid in the manageitems.ascx, but nothing happens when I ajaxified them.  But not ajaxified version works.

What you suggest for this scenario?

TIA.








Pavlina
Telerik team
 answered on 11 Dec 2009
1 answer
91 views
Hi,

I have a grid with a RadEditor in it.
Everything works fine - except when I use spell checking.
After this my filter "textboxes" are no longer focusable.

Example:
I filter for XXXX - contains - works fine
I edit the record and use spell checking.
---No matter what I do after this (update or cancel)...
When edit mode is ended the filter TextBox is no longer focusable
....
I can use the filter button and select "No filter" - this clears the TextBox.
But I'm still not able to focus it or enter text.

After a page refresh the things work again.

Regards
Manfred
Yavor
Telerik team
 answered on 11 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?