Hello Yavor,
Basically, in order to achieve your task, you need to set properly the Label.
For example, the code below:
WebUserControl.ascx
<asp:Label ID="Label1" Text="BERGS" Visible="true" runat="server"></asp:Label> |
<radG:RadGrid ID="RadGrid1" AllowPaging="True" DataSourceID="AccessDataSource1" runat="server" HorizontalAlign="NotSet"> |
<MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID" DataSourceID="AccessDataSource1"> |
<EditFormSettings> |
<EditColumn CancelImageUrl="~/RadControls/Grid/Skins/Default/Cancel.gif" EditImageUrl="~/RadControls/Grid/Skins/Default/Edit.gif" |
InsertImageUrl="~/RadControls/Grid/Skins/Default/Insert.gif" UniqueName="EditCommandColumn" |
UpdateImageUrl="~/RadControls/Grid/Skins/Default/Update.gif"> |
</EditColumn> |
</EditFormSettings> |
<Columns> |
<radG:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" |
SortExpression="CustomerID" UniqueName="CustomerID"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" |
UniqueName="CompanyName"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" |
UniqueName="ContactName"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" SortExpression="ContactTitle" |
UniqueName="ContactTitle"> |
</radG:GridBoundColumn> |
<radG:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address" |
UniqueName="Address"> |
</radG:GridBoundColumn> |
</Columns> |
<ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False"> |
<HeaderStyle Width="19px" /> |
</ExpandCollapseColumn> |
<RowIndicatorColumn UniqueName="RowIndicator" Visible="False"> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
</MasterTableView> |
<FilterMenu HoverBackColor="LightSteelBlue" HoverBorderColor="Navy" NotSelectedImageUrl="~/RadControls/Grid/Skins/Default/NotSelectedMenu.gif" |
SelectColumnBackColor="Control" SelectedImageUrl="~/RadControls/Grid/Skins/Default/SelectedMenu.gif" |
TextColumnBackColor="Window"></FilterMenu> |
</radG:RadGrid> |
<asp:AccessDataSource ID="AccessDataSource1" runat="server" |
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address] FROM [Customers] WHERE ([CustomerID] = ?)" DataFile="~/App_Data/Nwind.mdb" > |
<SelectParameters> |
<asp:ControlParameter ControlID="Label1" DefaultValue="ALFKI" Name="CustomerID" PropertyName="Text" |
Type="String" /> |
</SelectParameters> |
</asp:AccessDataSource> |
will render as shown in the image attached to this messahe. In short, when you set the datasource of the second grid properly, it will only include the records specified by the label.
I hope this information helps!
Greetings,
Yavor
the
telerik team