K
KT
How do you pass/get a control from another grid. In the Grid below, I'd
like to get the plate_id (which is the datakeynames value) to use on other
grids selectcommand on the page.
First Gridview looks like this:
<asp:GridView ID="GridViewPlate" SelectedIndex="0" runat="server"
AutoGenerateSelectButton="true" DataSourceID="SqlDataSource2"
DataKeyNames="plate_id" >
<Columns>
<asp:BoundField DataField="plate_id" HeaderText="plate_id"
SortExpression="plate_id" />
<asp:BoundField DataField="mfg_num" HeaderText="mfg_num"
SortExpression="mfg_num" />
<asp:BoundField DataField="order_date" HeaderText="order_date"
ReadOnly="True" SortExpression="order_date" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStringsrintstreamDB %>"
SelectCommand="pr_Plate_Lookup_BySearchValue"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" Name="mfg_num"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
like to get the plate_id (which is the datakeynames value) to use on other
grids selectcommand on the page.
First Gridview looks like this:
<asp:GridView ID="GridViewPlate" SelectedIndex="0" runat="server"
AutoGenerateSelectButton="true" DataSourceID="SqlDataSource2"
DataKeyNames="plate_id" >
<Columns>
<asp:BoundField DataField="plate_id" HeaderText="plate_id"
SortExpression="plate_id" />
<asp:BoundField DataField="mfg_num" HeaderText="mfg_num"
SortExpression="mfg_num" />
<asp:BoundField DataField="order_date" HeaderText="order_date"
ReadOnly="True" SortExpression="order_date" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStringsrintstreamDB %>"
SelectCommand="pr_Plate_Lookup_BySearchValue"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="txtSearch" Name="mfg_num"
PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>