Posted on May 7, 2012 (permalink)
<
telerik:RadGrid
runat
=
"server"
ID
"grid"
AllowPaging
"true"
AllowSorting
"True"
AllowFilteringByColumn
ShowStatusBar
AutoGenerateColumns
"false"
Visible
>
ClientSettings
Selecting
AllowRowSelect
/>
ClientEvents
OnRowDblClick
"OnRowDblClick"
</
PagerStyle
Mode
"NumericPages"
Position
"Bottom"
GroupingSettings
CaseSensitive
MasterTableView
ShowHeadersWhenNoRecords
DataKeyNames
"Name"
ClientDataKeyNames
Columns
telerik:GridBoundColumn
DataField
UniqueName
HeaderText
DataType
"System.String"
AutoPostBackOnFilter
SortExpression
"FirstName"
"Firstname"
telerik:GridEditCommandColumn
ButtonType
"ImageButton"
"Edit"
protected void button_Click(object sender, EventArgs e)
{
DataTable dt;
SqlConnection conn = new SqlConnection();
SqlCommand command = new SqlCommand("fillGrid", cn);
command.CommandType = CommandType.StoredProcedure;
SqlParameter p = new SqlParameter("@param", SqlDbType.NVarChar, 50);
p.Value = var.Text;
command.Parameters.Add(p);
dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
try
conn.Open();
da.Fill(dt);
grid.DataSource = dt;
grid.DataBind();
}
catch ()
//...
finally
if (conn.State != ConnectionState.Closed)
conn.Close();
Reply
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
//code for binding the Radgrid
Button1_Click(
sender, EventArgs e)
RadGrid1.Visible =
true
;
RadGrid1.Rebind();
Posted on May 8, 2012 (permalink)
onneeddatasource
"grid_NeedDataSource"
></
asp:Button
"button1"
onclick
"button1_Click"
grid_NeedDataSource(
SqlConnection conn =
new
SqlConnection();
SqlCommand command =
SqlCommand(
"fillGrid"
, cn);
SqlParameter p =
SqlParameter(
"@param"
, SqlDbType.NVarChar, 50);
dt =
DataTable();
SqlDataAdapter da =
SqlDataAdapter(cmd);
catch
()
if
(conn.State != ConnectionState.Closed)
button1_Click(
grid.Visible =
grid.Rebind();
Back to Top
[ ASP.NET Filter Features | Documentation | Demos | Step-by-step Tutorial ]
UI controls for ASP.NET AJAX, MVC, WPF,Silverlight, Windows 8 and Windows Phone
Cross-platform Mobile Development Toolwith cloud-based architecture
Everything you need to build sites andmobile apps with JavaScript and HTML5
One easy tool for Functional, Performance,Load and Mobile software testing
Everything for your online business - contentmanagement, ecommerce, emarketing
Simple and intuitive project managementand collaboration software