Posted 17 Jun 2013 Link to this post
protected
void
RadGrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.SelectCommandName && e.Item
is
GridDataItem)
GridDataItem item = (GridDataItem)e.Item;
DataTable dt1 = (DataTable)Session[
"dt"
];
//first grid datasource
DataTable dt = dt1.Clone();
DataRow dr = dt.NewRow();
dr[
"CustomerID"
] = item[
].Text;
"ContactName"
"City"
dt.Rows.Add(dr);
radgrid2.DataSource = dt;
radgrid2.DataBind();
}
Posted 18 Jun 2013 Link to this post
Posted 21 Jun 2013 Link to this post
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
AutoGenerateColumns
"false"
OnItemCommand
"RadGrid1_ItemCommand"
OnNeedDataSource
"RadGrid1_NeedDataSource"
>
MasterTableView
Columns
telerik:GridBoundColumn
DataField
"OrderID"
</
telerik:GridButtonColumn
CommandName
"Select"
Text
"select"
br
/>
"RadGrid2"
public
static
string
connection = WebConfigurationManager.ConnectionStrings[
"NorthwindConnectionString3"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(connection);
SqlCommand SqlCommand =
SqlCommand();
RadGrid1_NeedDataSource(
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
selectQuery1 =
"select top 10 OrderID from Orders"
;
SqlDataAdapter adapter1 =
SqlDataAdapter(selectQuery1, conn);
conn.Open();
DataTable dt =
DataTable();
adapter1.Fill(dt);
conn.Close();
Session[
] = dt;
RadGrid1.DataSource = dt;
sender, Telerik.Web.UI.GridCommandEventArgs e)
RadGrid2.DataSource = dt;
RadGrid2.DataBind();