Hello
I used the instruction in the following linq
But Instead I used Linq to Sql to load the Data
I have 3 Columns Brand , Model and ProductID
When I write the first character of Brand I can get the result but I need to get the query result for Model also
For Example I will Write Microsoft it will list Microsoft or I will write Office 2007 then it will list Microsoft Office 2007
I have the following code
And This is Code Behind
How Can I do that
I used the instruction in the following linq
But Instead I used Linq to Sql to load the Data
I have 3 Columns Brand , Model and ProductID
When I write the first character of Brand I can get the result but I need to get the query result for Model also
For Example I will Write Microsoft it will list Microsoft or I will write Office 2007 then it will list Microsoft Office 2007
I have the following code
<
telerik:RadComboBox
runat
=
"server"
ID
=
"RadComboBox1"
Height
=
"190px"
Width
=
"420px"
MarkFirstMatch
=
"true"
EnableLoadOnDemand
=
"true"
HighlightTemplatedItems
=
"true"
OnItemsRequested
=
"RadComboBox1_ItemsRequested"
AutoPostBack
=
"False"
>
<
HeaderTemplate
>
<
ul
>
<
li
class
=
"col1"
>Model Name</
li
>
<
li
class
=
"col2"
>Brand</
li
>
<
li
class
=
"col3"
>Product ID</
li
>
</
ul
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
ul
>
<
li
class
=
"col1"
>
<%# DataBinder.Eval(Container.DataItem, "ModelName")%></
li
>
<
li
class
=
"col2"
>
<%# DataBinder.Eval(Container.DataItem, "Brand")%></
li
>
<
li
class
=
"col3"
>
<%# DataBinder.Eval(Container.DataItem, "ProductID")%></
li
>
</
ul
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
And This is Code Behind
Protected
Sub
RadComboBox1_ItemsRequested(
ByVal
sender
As
Object
,
ByVal
e
As
RadComboBoxItemsRequestedEventArgs)
Dim
y = (From x
In
db.table_
Where x.Manufacturer.Contains(RadComboBox1.Text)
Select
New
With
{.Products = x.ModelName +
" - "
+ x.Brand, _
.ProductID = x.ProductID, .ModelName = x.ModelName, _
.Manufacturer = x.Brand}).ToList
RadComboBox1.DataSource = y
RadComboBox1.DataTextField =
"Products"
RadComboBox1.DataValueField =
"ProductID"
RadComboBox1.DataBind()
End
Sub
Protected
Sub
RadComboBox1_ItemDataBound(
ByVal
sender
As
Object
,
ByVal
e
As
RadComboBoxItemEventArgs)
'set the Text and Value property of every item
'here you can set any other properties like Enabled, ToolTip, Visible, etc.
e.Item.Text = (
DirectCast
(e.Item.DataItem, DataRowView))(
"ModelName"
).ToString()
e.Item.Value = (
DirectCast
(e.Item.DataItem, DataRowView))(
"Brand"
).ToString()
End
Sub
End
Class
How Can I do that