All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
<
telerik:RadTextBox
ID
=
"RadTextBox1"
runat
"server"
>
</
telerik:RadButton
"RadButton1"
Text
"Generate Gird"
OnClick
"RadButton1_Click"
telerik:RadGrid
"RadGrid1"
AllowPaging
"true"
AllowSorting
AllowFilteringByColumn
Width
"100%"
PagerStyle
AlwaysVisible
></
asp:ObjectDataSource
"ObjectDataSource1"
TypeName
"Class1"
OnSelecting
"ObjectDataSource1_Selecting"
SelectParameters
asp:Parameter
Name
"textvalue"
Type
"String"
/>
protected
void
RadButton1_Click(
object
sender, EventArgs e)
{
RadGrid1.DataSourceID =
;
ObjectDataSource1.SelectMethod =
"GetData"
}
ObjectDataSource1_Selecting(
sender, ObjectDataSourceSelectingEventArgs e)
//passing the parameter value from code
e.InputParameters[
] = RadTextBox1.Text;
public
class
Class1
DataTable GetData(
string
textvalue)
String connectionstring = WebConfigurationManager.ConnectionStrings[
"NorthwindConnectionString"
].ConnectionString;
SqlConnection sqlconn =
new
SqlConnection(connectionstring);
SqlDataAdapter adapter =
SqlDataAdapter();
adapter.SelectCommand =
SqlCommand(
"SELECT text from Details WHERE id LIKE '"
+ textvalue +
"%'"
, sqlconn);
DataTable data =
DataTable();
sqlconn.Open();
try
adapter.Fill(data);
return
data;
finally
sqlconn.Close();