hello!
I have an ajax page with a grid and some nested grids. I'm trying to load one of the nested grids on demand and run into a "control doesn't exist in this context" message.
So my question is how do I get the label value to act as a parameter for the sqldataadapter calling a stored procedure onneeddatasource at the nested grid?
The backend contains the onneeddatasource function:
I have an ajax page with a grid and some nested grids. I'm trying to load one of the nested grids on demand and run into a "control doesn't exist in this context" message.
<RadGrid 1> <MasterTableView> <NestedViewTemplate> <Label ID="lbl_Id" ... /> <RadTabStrip> <Tabs> <RadTab Text="1" ... /> <RadTab Text="2" ... /> </Tabs> </RadTabStrip> <RadMultiPage ...> <RadPageView ID="ForTab1" ... > <RadGrid ID="NestedGrid1" OnNeedDataSource="NestedGrid1_OnNeedDataSource" ... /> </RadPageView> <RadPageView ID="ForTab2" ... > <RadGrid ID="NestedGrid2" ... /> </RadPageView> </RadMultiPage> </NestedViewTemplate> </MasterTableView> </RadGrid>So my question is how do I get the label value to act as a parameter for the sqldataadapter calling a stored procedure onneeddatasource at the nested grid?
The backend contains the onneeddatasource function:
protected void NestedGrid1_OnNeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["AConnectionString"].ConnectionString); using (SqlCommand sqlComm = new SqlCommand("StoredProcedure1", con)) { sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.Parameters.AddWithValue("@InTrId", lbl_Id.Text); SqlDataAdapter sda = new SqlDataAdapter(sqlComm); DataTable dt = new DataTable(); sda.Fill(dt); rGrid_Dex_Wc_Scans.DataSource = sda; } }