Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.2K+ views

I am starting to work on a new project using AutoCompleteBox and I need to change my searches after every entry added by the client.

I am using the tutorial code that uses SQLDataSource. I tried to update the value of the property SQLDataSource.SelectCommand with a new query into the OnEntryAdded event this way:

Protected Sub RadAutoCompleteBox1_EntryAdded(sender As Object, e As Telerik.Web.UI.AutoCompleteEntryEventArgs)
        SqlDataSource1.SelectCommand = "my new query here"
End Sub

The problem is that the event is being triggered and the content of SqlDataSource1.SelectCommand is being changed but AutoCompleteBox keep using the initial hard coded query of the client side script.

Any idea?

Yan Moura
Top achievements
Rank 1
Veteran
Iron
 answered on 13 Jan 2020
1 answer
207 views

Hi , 
  I am try to bind value from server side, for that , i page load i get values in datatable and bind in searchbox, and in DataSourceSelect i filter the values when key in inside search box, but when i key in i get error "Datasoruce not set ", how to bind datasource from server side instead of code behind ?

This is my code
Code Behind
<telerik:RadSearchBox EnableAutoComplete="true" DataValueField="userid"
            DataTextField="con" ID="radsearachUsers"  runat="server"></telerik:RadSearchBox>
--------------------------------

Page_Load
 Dim sqlDA As New SqlDataAdapter("Select con,userid from users", objConnection)
            Dim objDT As New DataTable
            sqlDA.Fill(objDT)

            radsearachUsers.DataSource = objDT
            radsearachUsers.DataValueField = "userid"
            radsearachUsers.DataTextField = "con"
            radsearachUsers.DataBind()

__________________________________

 Protected Sub radsearachUsers_DataSourceSelect(sender As Object, e As SearchBoxDataSourceSelectEventArgs) Handles radsearachUsers.DataSourceSelect
        Dim objConnection As New SqlConnection
        objConnection = New SqlConnection(getconnectionstring())
        objConnection.Open()

        Dim sqlDA As New SqlDataAdapter(" Select * from users where con like '%" & e.FilterString & "%' ", objConnection)
        Dim objDT As New DataTable
        sqlDA.Fill(objDT)
     

        radsearachUsers.DataSource = objDT
        radsearachUsers.DataSourceID = getconnectionstring()
        radsearachUsers.DataTextField = objDT.Rows(0)("Con")
        radsearachUsers.DataValueField = objDT.Rows(0)("userid")
        radsearachUsers.DataBind()
    End Sub

Pls reply asap

Thanks

M Kumar
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 13 Jan 2020
1 answer
176 views

As per the documentation on .fetch():

"The fetch method makes a request to the remote service only the first time it is called"

Why???

 

If a RadGrid is client bound to RadClientDataSource,  I can call .rebind() on the grid and it will call the Select webservice again,   so there must be a way to "reset" something so that .fetch() will call the webservice every time it's called?

CDK
Top achievements
Rank 1
 answered on 10 Jan 2020
1 answer
148 views
The controls in my RadWindow use em unit for width to accommodate the browser's font-size selection by user. So I want to set the RadWindows' width in em also, but I found its not working. Any advice?
Rumen
Telerik team
 answered on 10 Jan 2020
1 answer
162 views

Hello,

trying to HorizontalAlign two (of multiple) columns in a pdf export. I've tried:

protected void btnExport_Click(object sender, EventArgs e)
{
     // bla bla
     MyGrid.MasterTableView.GetColumn("col1").ItemStyle.HorizontalAlign = HorizontalAlign.Center;
}

 

and this way:

protected void MyGrid_PreRender(object sender, EventArgs e)
{
     // bla bla
     foreach (GridColumn col in MyGrid.MasterTableView.RenderColumns)
                {
                    if (col.UniqueName == "col1") { col.ItemStyle.HorizontalAlign = HorizontalAlign.Center; }
                }
}

 

Both do not work - what's the correct way to do this?

Thx in advance - M.

Eyup
Telerik team
 answered on 09 Jan 2020
4 answers
251 views

Tried to add custom buttons to toolbar.

rightsButton = new RadToolBarButton();
rightsButton.ToolTip = CreaSoft.CommonServices.ResourceHelpers.GetGlobalResourceObject("FileExplorerControl.DirectoryRights");
rightsButton.Value = "ManageRightsFolder";
rightsButton.CommandName = "ManageRightsFolder";
 
Explorer.ToolBar.Items.Add(rightsButton);

 

Then I found it doesn't work as expected. Seems that icons are missing (ok, I didn't define any, but found now way how to do it), but based on html, it generates tooltip as css class :-) 

Then I found some strange code in Telerik_UI_for_ASP.NET_AJAX_2018_3_910_Source\Telerik.Web.UI\FileExplorer\RadFileExplorer.cs.

private void ConfigureToolbarButtons()
{
    bool isClassicMode = RenderMode == UI.RenderMode.Classic;
 
    if (!isClassicMode)
    {
        _toolbar.EnableImageSprites = true;
    }
 
    string icn = "icn";
    foreach (RadToolBarItem button in _toolbar.Items)
    {
        bool hasText = !String.IsNullOrEmpty(button.Text) && button.Text != Nbsp;
        string iconCssClass = String.Concat(icn, button.ToolTip);
        if (isClassicMode)
        {
            button.CssClass += hasText ? string.Empty : " rtbIconOnly ";
            button.CssClass += iconCssClass;
        }
        else
        {
            button.ShowText = hasText ? ToolBarShowPosition.Toolbar : ToolBarShowPosition.OverFlow;
            button.SpriteCssClass = iconCssClass;
        }
    }
}

 

So it seems to be a bug in this method. Css class should not be generated from Tooltip :-)

Please see attachments.

 

Rumen
Telerik team
 answered on 09 Jan 2020
16 answers
651 views
Picking up from the previous thread, what I'm trying to do is insert a chunk of HTML just beyond the closing tag where the cursor is sitting.

Consider the following sample:
Telerik.Web.UI.Editor.CommandList["Sidebox"] = function(commandName, editor, args) 
{ 
     editor.pasteHtml("<div style='float: right; height: 100px; witdth: 100px; background-color: red; color: yellow'>A box on the right</div>"); 
     return; 
} 
 




Assuming your cursor is sitting between an opening and closing <p> tag when the command is invoked, the HTML is also pasted between the p tags. What I would like is to have it paste just after the closing </p>.

Any advice on how to achieve this?

Thanks,
Jeff
Rumen
Telerik team
 answered on 09 Jan 2020
5 answers
224 views
Hi,

The old link to RSS release history not working, someone have the new link?

ty
Rumen
Telerik team
 answered on 09 Jan 2020
5 answers
132 views

Hi,

    When the fonts dropdown is visible and then zoom the page, its doesn't align properly. https://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

Will it be possible to keep it under under the controls that triggered it.

Thanks,

Lakpa

Rumen
Telerik team
 answered on 09 Jan 2020
8 answers
421 views
Hi, is it possible to change the name of the file before uploading to Azure?
Peter Milchev
Telerik team
 answered on 09 Jan 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?