3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 11 Sep 2008, 05:24 AM
Hello Albert,
Try out the following code snippet to achieve the required.
ascx:
ascx.cs:
Princy.
Try out the following code snippet to achieve the required.
ascx:
<MasterTableView> |
<DetailTables> |
<telerik:GridTableView Name="Detail" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"> |
<Columns> |
<telerik:GridBoundColumn DataField="SupplierID" HeaderText="SupplierID" SortExpression="SupplierID" |
UniqueName="ID"> |
</telerik:GridBoundColumn> |
</Columns> |
</telerik:GridTableView> |
</DetailTables> |
</MasterTableView> |
ascx.cs:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "Detail") |
{ |
GridDataItem dataitem=(GridDataItem)e.Item; |
string strtx = dataitem["ID"].Text; |
} |
} |
Princy.
0
Albert
Top achievements
Rank 1
answered on 11 Sep 2008, 06:31 AM
Thanks but that wont work. Here's a sample code on an ascx file name test1
<%@ Register src="test2.ascx" tagname="Test" tagprefix="control" %>
<telerik:RadGrid
<MasterTableView
<DetailTables>
<telerik:GridTableView>
<NoRecordsTemplate>
<control:Test ID="Test" runat="server" />
</NoRecordsTemplate>
....
How Do I reference the Grid on the test1.ascx from the test2.ascx?
<%@ Register src="test2.ascx" tagname="Test" tagprefix="control" %>
<telerik:RadGrid
<MasterTableView
<DetailTables>
<telerik:GridTableView>
<NoRecordsTemplate>
<control:Test ID="Test" runat="server" />
</NoRecordsTemplate>
....
How Do I reference the Grid on the test1.ascx from the test2.ascx?
0
Anwar at NVizionSoft
Top achievements
Rank 1
answered on 11 Sep 2008, 10:42 AM
I am having the same issue... I have a button I am including in the NoRecordsTemplate which says "Add New Service Plan", but I want to be able to hide this button when I don't want the user to be able to perform this operation. Wondering how to access the control from my server side code.