locked
WM 6.5 mobile Datagrid RRS feed

  • Question

  • Hi,

    I'm new to WM 6.5 app development.

    I would like to place the value entered in a textbox into a datagrid cell of a selected row.

    Can anyone please show me how i can go about it.

    Thanks.

    Monday, November 25, 2013 10:14 AM

Answers

All replies

  • Thanks,

    I tried to create a textbox column on my WM 6.5 data grid where i can input the Quantity but it does not seem to work.

    i use a DataTable to bing my grid

    DataGridTableStyle ts = new DataGridTableStyle();
                    ts.MappingName = "Products";



                    // ProductID 
                    DataGridColumnStyle ProductID = new DataGridTextBoxColumn();
                    ProductID.MappingName = "ProductID";
                    ProductID.HeaderText = "ProductID";
                    //**************************************
                    //Hide ProductID
                    ProductID.Width = -1; //Make with -1
                    //**************************************
                    ts.GridColumnStyles.Add(ProductID);
                    gvProducts.TableStyles.Add(ts);

                    // Product Description name column style
                    DataGridColumnStyle cDescription = new DataGridTextBoxColumn();
                    cDescription.MappingName = "Description";
                    cDescription.HeaderText = "Description";
                    cDescription.Width = 100;
                    ts.GridColumnStyles.Add(cDescription);


                    // Product Price name column style
                    DataGridColumnStyle cProdPrice = new DataGridTextBoxColumn();
                    cProdPrice.MappingName = "ProductPrice";
                    cProdPrice.HeaderText = "Price";
                    cProdPrice.Width = 37;
                    ts.GridColumnStyles.Add(cProdPrice);


                    // Stock on Hand Quantity
                    DataGridColumnStyle cSOHQty = new DataGridTextBoxColumn();
                    cSOHQty.MappingName = "SOHQuantity";
                    cSOHQty.HeaderText = "SOH";
                    cSOHQty.Width = 28;
                    //cSOHQty.ReadOnly = false;
                    ts.GridColumnStyles.Add(cSOHQty);

                     txtControl.Text = gvProducts[gvProducts.CurrentRowIndex, -1].ToString();


                     //Order Quantity name column style
                    DataGridColumnStyle cOrderQty = new DataGridTextBoxColumn();
                    cOrderQty.MappingName = "OrderQuantity";
                    cOrderQty.HeaderText = "Qty";
                    cOrderQty.Width = 30;                
                    ts.GridColumnStyles.Add(cOrderQty);

    Monday, November 25, 2013 1:40 PM
    • Marked as answer by Eileen ni Monday, December 9, 2013 2:48 AM
    Monday, November 25, 2013 5:45 PM