Not lucky getting RadGrid populated. I have a RadAutoCompleteBox where user can a code used as parameter of a stored procedure and the result should populate the grid in three columns. I tried to made it as simpler as possible but my grid is not showing up anything.
My code ASPX:
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadAjaxManager
ID
=
"ajaxmanager1"
runat
=
"server"
EnableAJAX
=
"true"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAutoCompleteBox1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadAutoCompleteBox1"
LoadingPanelID
=
"radloadingpanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"lblOEValue"
LoadingPanelID
=
"radloadingpanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"radloadingpanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"btnSearch"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadAutoCompleteBox1"
LoadingPanelID
=
"radloadingpanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"lblOEValue"
LoadingPanelID
=
"radloadingpanel1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"radloadingpanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"radloadingpanel1"
runat
=
"server"
AnimationDuration
=
"0"
InitialDelayTime
=
"1000"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadAutoCompleteBox
runat
=
"server"
ID
=
"RadAutoCompleteBox1"
ClientID
=
"RadAutoCompleteBox1"
>
<!-- I supressed details because auto complete box is working fine -->
</
telerik:RadAutoCompleteBox
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
autopostback
=
"true"
>
<
MasterTableView
AutoGenerateColumns
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Description"
UniqueName
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ConditionsAndOptions"
UniqueName
=
"ConditionsAndOptions"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RetailPrice"
UniqueName
=
"RetailPrice"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:Button
id
=
"btnSearch"
Text
=
"Search"
OnClick
=
"btnSearch_Click"
autopostback
=
"true"
runat
=
"server"
/><
br
/>
<
div
style
=
"display:none"
>
<
asp:label
ClientID
=
"lblOEValue"
id
=
"lblOEValue"
ClientIDMode
=
"Static"
autopostback
=
"true"
visible
=
"true"
runat
=
"server"
></
asp:label
>
</
div
>
</
form
>
My VB code:
Protected
Sub
RadAutoCompleteBox1_EntryAdded(sender
As
Object
, e
As
Telerik.Web.UI.AutoCompleteEntryEventArgs)
lblOEValue.Text = e.Entry.Text
End
Sub
Protected
Sub
RadAutoCompleteBox1_EntryRemoved(sender
As
Object
, e
As
Telerik.Web.UI.AutoCompleteEntryEventArgs)
lblOEValue.Text =
""
End
Sub
Protected
Sub
btnSearch_Click(sender
As
Object
, e
As
EventArgs)
Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.AppSettings("myconnection"))
Dim
adapter
As
SqlDataAdapter =
New
SqlDataAdapter
Dim
myDataTable
As
New
DataTable
adapter.SelectCommand =
New
SqlCommand(
"EXEC [dbo].[] '"
+ lblOEValue.Text +
"'"
, myConn)
myConn.Open()
adapter.Fill(myDataTable)
RadGrid1.DataSource = myDataTable
myConn.Close()
End
Sub
What am I missing here?