Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
287 views

Hi there

I have two perfectly working RadComboBoxes - one is single column, the other is a multi-column (using itemtemplate).  Both use LoadOnDemand (ItemsRequested event).

I noticed that the single column combobox highlights text as the user types, but the same does not happen for the multi-column combobox.  I've set HighlightTemplatedItems="true" but this of course only affects the highlighting of the row, not individual letters.

I checked the Q3 2010 demos on my system and they replicate the issue I am having.

But then I noticed that the demo on this site has a working version, but you have not posted the code for it on the page.  For example, type in "ca" in the product combobox and the "Ca" highlights on the two matching items.
http://demos.telerik.com/aspnet-ajax/combobox/examples/overview/defaultcs.aspx

Are you able to post the code for the example on the page above so I can see what I may be missing? Cheers :)

The code i use is as follows.

Markup

<!-- Multi-column RadComboBox -->
<!-- HighlightTemplatedItems property highlights the item row (created by itemtemplate) on mouse hover -->
<!-- OnClientKeyPressing event opens combobox drop down when text is being typed -->
<telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true" Height="170px"
    Width="580px" HighlightTemplatedItems="true" EnableLoadOnDemand="True" Filter="Contains"
    NoWrap="True" ShowMoreResultsBox="True" OnItemsRequested="RadComboBox1_ItemsRequested"
    OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" OnClientKeyPressing="(function(sender, e) { if (!sender.get_dropDownVisible()) sender.showDropDown(); })">
    <HeaderTemplate>
        <ul>
            <li class="col1">Text Property</li>
            <li class="col2">Value Property</li>
            <li class="col3">InstNumber Attribute</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1">
                <%# DataBinder.Eval(Container, "Text")%></li>
            <li class="col2">
                <%# DataBinder.Eval(Container, "Value")%></li>
            <li class="col3">
                <%# DataBinder.Eval(Container, "Attributes['InstNumber']")%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>

C#

protected void RadComboBox1_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
    int recordCount = 0;
    int itemsPerRequest = 100;  // how many items to list in combobox
    int itemOffset = e.NumberOfItems;
    int endOffset = itemOffset + itemsPerRequest;
    string searchValue = e.Text;
  
    // prevent filtering on whitespace
    if (String.IsNullOrWhiteSpace(searchValue))
        searchValue = null;
  
    // get data from database
    InstitutesData records = new InstitutesData();
    records = records.ReadRecordsComboBox(searchValue);
  
    // if there are records
    if (records != null)
    {
        // get count
        recordCount = records.Count;
  
        // add INST_NO to front of INST_NAME (custom functionality)
        for (int i = 0; i < recordCount; i++)
        {
            records[i].INST_NAME = records[i].INST_NO.ToString() + " - " + records[i].INST_NAME;
        }
    }
  
    // ensure offset isnt greater than the number of records available
    if (endOffset > recordCount)
        endOffset = recordCount;
  
    // bind data to combobox
    RadComboBox1.DataTextField = "INST_NAME";    // "123 - Number One School"
    RadComboBox1.DataValueField = "INST_NO";     // 123
    RadComboBox1.DataSource = records;
    RadComboBox1.DataBind();
  
    // populate combobox with items within offsets
    RadComboBox1.Items.Clear();
    for (int i = itemOffset; i < endOffset; i++)
    {
        RadComboBoxItem item = new RadComboBoxItem();
  
        item.Text = records[i].INST_NAME;
        item.Value = records[i].INST_NO.ToString();
        item.Attributes.Add("InstNumber", records[i].INST_NO.ToString());
  
        RadComboBox1.Items.Add(item);
  
        item.DataBind();
    }
  
    // display record count information in results box
    if (recordCount > 0)
    {
        e.Message = String.Format("Items <b>0</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, recordCount);
    }
  
    else
    {
        // display 'no data in database' message
        if (String.IsNullOrEmpty(searchValue))
            e.Message = "No data";
  
        // display 'no matches in database' message
        else
            e.Message = "No matches";
    }
}
  
protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    // do something when the selected index is changed
    string selectedValue = e.Value;
}

 

Hristo Valyavicharski
Telerik team
 answered on 01 Feb 2013
8 answers
156 views
Hi,

I have the Table Wizard dialog with CSS selector and pre-defined telerik table layouts as attached PNG.

I cannot fing this anywhere in the current documentation,
Any more information howto implement custom styles in this dropdown?

Marc
Rumen
Telerik team
 answered on 01 Feb 2013
1 answer
217 views
This works great except e.Node.Selected = False
I try disable that you can click (select) on node 1 and 2, but it may not function?
Help me :-)
Protected Sub RadTreeView1_NodeDataBound(ByVal sender As Object, ByVal e As RadTreeNodeEventArgs)
    e.Node.ToolTip = (TryCast(e.Node.DataItem, DataRowView))("NodeId").ToString() & " + " & (TryCast(e.Node.DataItem, DataRowView))("ParentNodeId").ToString()
    e.Node.ImageUrl = "../images/caTree/" & (TryCast(e.Node.DataItem, DataRowView))("ImageUrl").ToString()
    e.Node.NavigateUrl = "../admin_dbpage.aspx?id=" & (TryCast(e.Node.DataItem, DataRowView))("NodeId").ToString() & "&db=ledare" & "&url=ledare/"
    e.Node.Target = "main"
 
    If (TryCast(e.Node.DataItem, DataRowView))("NodeId").ToString() = 1 Or (TryCast(e.Node.DataItem, DataRowView))("NodeId").ToString() = 2 Then
        e.Node.AllowDrag = False
        e.Node.Selected = False
    End If
 
End Sub
Kate
Telerik team
 answered on 01 Feb 2013
1 answer
112 views
Hi there

I am using the method pageLoad(), which as you know is a function that pages with an ASP.NET ScriptManager will automatically execute after ASP.NET AJAX's client-side library initializes and then again after every UpdatePanel refresh.

I found that Chrome doesn't consistently/reliably fires pageLoad() when navigating to my webpage using the site's navigation. The method gets executed reliably when a postback happen though but not when visiting the page (could it be because it's getting cached?). This (when not executed) causes Telerik controls freeze.

IE & Firefox are fine (consistently fires pageLoad()).

I am using telerik:RadScriptManager as my ScriptManager.

Any assistance with this will be much appreciated.

Note: I am using the below in Page_Init() so that the page is not cached but still have the problem with Chrome:
                   . Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); 
                   . Response.Cache.SetNoStore();

Regards,
Muzafar
Tsvetoslav
Telerik team
 answered on 01 Feb 2013
2 answers
175 views
I have a Radgrid with a template edit form, which has update & cancel buttons. All functions work fine, except with some data records.

With those records, when I click the update button, the ItemCommand event is called with RadGrid.UpdateCommandName, but e.Canceled is already set to true, so the record is never updated. I have tried removing all validation, but that makes no difference. If I capture the the RadGrid.UpdateCommandName event and set e.Canceled to false, the record is updated no problem.

So I'd really like to know what might be causing the RadGrid to set Canceled = true?

Thanks for any info.
Jesper
Top achievements
Rank 1
 answered on 01 Feb 2013
1 answer
67 views
I was working on a radchart and it would not display in my page. I used the add httphandler to web.config link on the smart tag to create a web.config for my plugin, so I could see if I needed to add to the sites web.config. After adding the lines to the web.config the chart appeared and I deleted my plugins web.config. Now the chart smart tag and properties are gone. I am assuming that removing the web.config caused them to disappear. I was wondering if there is anything I can do to bring back the properties and smart tag.
Ves
Telerik team
 answered on 01 Feb 2013
1 answer
95 views
how do i fix this problem Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values.
Parameter Name:index;
Maria Ilieva
Telerik team
 answered on 01 Feb 2013
1 answer
86 views
Hi 

We have a requirement where we want to save phone numbers into the DB along with the formatting of (###) ###-#### .

These numbers are entered on a RadGrid, where I use a GridMaskedColumn with a Mask of (###) ###-####  so that the auto-edit form displays the mask for the user when he is entering the number.
But once the user has entered the number and presses the insert link, it the numbers w/o the formatting into the DB field.

Question: How do I set up my GridMaskedColumn (or any other type of GridColumn) so that the generated edit form will have the text field with the Mask and also insert / update the data along with the mask?

FWIW - I found that the MaskedTextBox control has a TextWithLiterals property which returns the string with the formatting, but I'm not sure how to force the edit form to save this TextWithLiterals instead of just the Text.

Any guidance will be very much appreciated.

Thanks
Vasil
Telerik team
 answered on 01 Feb 2013
1 answer
61 views
Hey at Telerik

I am trying to set the text of a radpanelitem when the item is either expanding or collapsing.

I have set the a text on the value attribute and i would like to switch the text to nothing when the item is collapsed and the text from the value attribute when the item is expanded.

I use the method set_text, but it doesn't seem to work.

I have attached a sample project showing my problem here.
http://kort2.lifa.dk/Examples/RadPanelBarClientsideSetTextIssue.rar

I hope u can help me.

Sincerly Jan
Kate
Telerik team
 answered on 01 Feb 2013
2 answers
91 views
Hai

     How can I set my radgrid in insert mode on loading. Please help

thanks
RT
Jayesh Goyani
Top achievements
Rank 2
 answered on 01 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?