redirect/pass data from a datagrid to another webform

liunx

Guest
Hello,

How can l get the value of the combo box item in a datagrid that the user selects. This information needs to be sent to another webform I normally use request.QueryString["quantity"].ToString(), but can't get it to work.

I am having a big problem with this.

My code:

<aspataGrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 360px; POSITION: absolute; TOP: 304px"
runat="server" AutoGenerateColumns="False" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3" GridLines="Vertical">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></SelectedItemStyle>
<AlternatingItemStyle BackColor="#DCDCDC"></AlternatingItemStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#000084"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="ProductCode" HeaderText="Product Code"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Quantity">
<ItemTemplate>
<aspropDownList id="cboQuantity" runat="server" Width="55px"></aspropDownList>
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn HeaderText="Selection" Text="Select Product" CommandName="SelectProduct"></asp:ButtonColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="Black" BackColor="#999999" Mode="NumericPages"></PagerStyle>
</aspataGrid>



The code l have for filling in the combo box is as follows:

private void FillCombo()
{
int k = 0;
int j = 1;
DropDownList cmb ;
for (k = 0; k < DataGrid1.Items.Count - 1; k++)
{
cmb = (DropDownList)DataGrid1.Items[k].FindControl("cboQuantity");
for (j= 1; j <= 50; j++)
{
cmb.Items.Add(j.ToString());
}
}
}


The user selects from the combo box and then clicks on the select button column. I want be able to send the combo box value to another web form.

Thanks in advance,

Steve
 
Back
Top