Results 1 to 1 of 1

Thread: datagrid problem [* Unresolved *]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2001
    Posts
    1,331

    datagrid problem [* Unresolved *]

    I have a problem I hope you have help me with. I am using a datagrid for displaying products from a customer's shopping list. The shopping list is downloaded into a datagrid.

    Table name: ShoppingList
    Field names: ProductCode, ProductName, Price

    Using the following code that works ok.
    SqlConnection cnn = new SqlConnection("server=.; Database=ShoppingService; Integrated security = true");
    SqlCommand cmd = cnn.CreateCommand();
    SqlDataAdapter da = new SqlDataAdapter();
    DataSet ds = new DataSet();

    cmd.CommandType = CommandType.Text;
    cmd.CommandText = "SELECT ProductName, Price FROM ShoppingList";

    da.SelectCommand = cmd;
    da.Fill(ds,"ShoppingList");

    grdShoppingList.SetDataBinding(ds,"ShoppingList");

    However, I have used the table styles so that I have a quantity and select columns. Qantity to be a comboBox and select to be check box.
    This is so that the customer can select the quantity from the combox and check the select the checkbox when they have selected this product to buy.
    The problem that is does the display the combo box and checkbox columns when loaded from the database, if I commet out the database code then it
    will display them.

    I need to display what in the database with the extra columns designed in code to display the quantity, and select columns.
    My datagrid should have the following columns. Product, Price, Quantity (comboBox), Select (checkBox).

    Product and price display if I load from the database.
    Quantity and select, if I commet out the database code.

    I need both.

    Hope you can help me with this problem. I have attacted my sample project, so you can better understand. I have also attached the web page that I have modified for my program to be able to insert the combo box and check out. I have commetted out the parts of this code I did not need.

    Thank you very much in advance.

    Happy New Year,

    Steve
    Attached Files Attached Files
    Last edited by steve_rm; Jan 4th, 2006 at 03:54 AM.
    steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width