This is a migrated thread and some comments may be shown as answers.

RadSearchbox is missing.

5 Answers 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saira
Top achievements
Rank 1
Saira asked on 06 Mar 2013, 06:05 AM
Hi,
In my visual studio intellisense radsearchbox is missing. i m using telerik 2012 dll. please help.

Thank you.
Saira.

5 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Mar 2013, 06:10 AM
Hello Saira,

In Visual Studio, the intellisense is missing because the particular RadControl is not available with the Telerik 2012 DLL version. Please upgrade your Telerik RadControls to Q1 2013 version.

Thanks,
Princy.
0
Saira
Top achievements
Rank 1
answered on 07 Mar 2013, 08:18 AM
Thanks princy. i updated and its working fine. I want to know how to bind the searchbox using WCF.
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Mar 2013, 08:27 AM
Hello Saira,

You need to specify the path to the service and the name of the service method in the WebServiceSettings' Path and Method properties. Please have a look at the following code that demonstrate how to bind RadSearchBox through WCF service.

ASPX:
<telerik:RadSearchBox runat="server" ID="RadSearchBox1">
    <DropDownSettings Height="400" Width="300" />
    <WebServiceSettings Path="LoadEntriesWCF.svc" Method="GetResults" />
</telerik:RadSearchBox>

C#:
[OperationContract]
public static SearchBoxItemData[] GetResults(SearchBoxContext context)
{
    DataTable data = GetData(context.Text);
 
    List<SearchBoxItemData> result = new List<SearchBoxItemData>();
 
    for (int i = 0; i < data.Rows.Count; i++)
    {
        SearchBoxItemData itemData = new SearchBoxItemData();
        itemData.Text = data.Rows[i]["ProductName"].ToString();
        itemData.Value = data.Rows[i]["ProductId"].ToString();
 
        result.Add(itemData);
    }
 
    return result.ToArray();
}
 
private static DataTable GetData(string filterString)
{
    SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
    SqlCommand command = new SqlCommand("SELECT [ProductId], [ProductName] FROM [Products] WHERE [ProductName] LIKE '%' + @filterString + '%' ORDER BY [ProductId]");
    command.Parameters.AddWithValue("@filterString", filterString);
    command.Connection = connection;
    SqlDataAdapter adapter = new SqlDataAdapter(command);
 
    DataTable data = new DataTable();
    adapter.Fill(data);
    return data;
}

Hope this helps,
Princy.

0
Saira
Top achievements
Rank 1
answered on 12 Mar 2013, 07:57 AM
Hello Princy,

How to set the width and height of the searchbox popup?
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Mar 2013, 08:32 AM
Hello Saira,

I believe you want to set the width and height of the RadSearchBox drop-down instead of popup. Please try the following mark-up to set the width and height of the drop-down.

ASPX:
<telerik:RadSearchBox runat="server" ID="RadSearchBox2">
    <DropDownSettings Width="100px" Height="200px" />
</telerik:RadSearchBox>

Thanks,
Princy.
Tags
General Discussions
Asked by
Saira
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Saira
Top achievements
Rank 1
Share this question
or