using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page 
{
    private string SelectParameter="";
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
        if (e.DetailTableView.Name == "Orders")
        {
            SqlDataSource2.SelectParameters[0].DefaultValue = SelectParameter;
        }
    }
    protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
    {
        SelectParameter = ((GridDataItem)RadGrid1.SelectedItems[0]).GetDataKeyValue("CustomerID").ToString();
        ((GridDataItem)RadGrid1.SelectedItems[0]).FireCommandEvent("ExpandCollapse", "");
        
    }
}
