Click here to Skip to main content
15,894,896 members
Home / Discussions / C#
   

C#

 
Questioncan not load mscorwks.dll? Pin
George_George9-Jul-08 0:11
George_George9-Jul-08 0:11 
AnswerRe: can not load mscorwks.dll? Pin
leppie9-Jul-08 1:31
leppie9-Jul-08 1:31 
GeneralRe: can not load mscorwks.dll? Pin
George_George9-Jul-08 22:00
George_George9-Jul-08 22:00 
QuestionDatagridview Pin
benjamin yap8-Jul-08 23:48
benjamin yap8-Jul-08 23:48 
AnswerRe: Datagridview Pin
leppie9-Jul-08 0:07
leppie9-Jul-08 0:07 
GeneralRe: Datagridview Pin
benjamin yap9-Jul-08 0:34
benjamin yap9-Jul-08 0:34 
AnswerRe: Datagridview Pin
benjymous9-Jul-08 1:30
benjymous9-Jul-08 1:30 
GeneralRe: Datagridview Pin
benjamin yap9-Jul-08 2:02
benjamin yap9-Jul-08 2:02 
Okay, 1 more question

I have a form called ModifyOrder. Basically my form have 2 hashtable. I called orderTable and the other is productTable.

My orderTable stores an Order object. Below is my class for Order.cs

namespace EBMS
{
    public class Order
    {
        private string refNumber;
        private string custName;
        private string destAdd;
        private string destCity;
        private string orderDate;
        private double totalPrice;
        private Hashtable itemList;


I got a attribute which store a list of items( from the productTable) into a hashtable called itemList inside my Order class


I have a datagridview which shows all the record i have in my productTable and the first columm of the datagrid is a checkbox.

When the user enter the Order's Ref Number to be modify, the datagrid wil show all the productTable. I want the first column(checkbox) to be checked if the product exists inside the Order class itemList.


How do i go about it?

I tried this code, but it does not tick the checkbox

if (orderTable.ContainsKey(tbxSearchRefNum.Text))
{
    tbxRefNumber.Text = ((Order)orderTable[tbxSearchRefNum.Text]).RefNumber;
    tbxCustName.Text = ((Order)orderTable[tbxSearchRefNum.Text]).CustName;
    tbxCity.Text = ((Order)orderTable[tbxSearchRefNum.Text]).DestCity;
    tbxAddress.Text = ((Order)orderTable[tbxSearchRefNum.Text]).DestAdd;

    this.dataGridProduct.Rows.Clear();
    int currentRow = 0;
    foreach (Product p in productTable.Values)
    {
        this.dataGridProduct.Rows.Add();
        this.dataGridProduct.Rows[currentRow].Cells["colProductName"].Value = p.Name;
        this.dataGridProduct.Rows[currentRow].Cells["colModelNumber"].Value = p.ModelNumber;
        this.dataGridProduct.Rows[currentRow].Cells["colCategory"].Value = p.Category;
        this.dataGridProduct.Rows[currentRow].Cells["colDesc"].Value = p.Description;
        this.dataGridProduct.Rows[currentRow].Cells["colMSRP"].Value = p.MSRP;
        this.dataGridProduct.Rows[currentRow].Cells["colRetailPrice"].Value = p.RetailPrice;

        foreach (DataGridViewRow dgw in dataGridProduct.Rows)
        {
            DataGridViewCheckBoxCell datacell = dgw.Cells[0] as DataGridViewCheckBoxCell;
            try
            {
                Order newOrder = new Order();
                newOrder = (Order)orderTable[tbxRefNumber.Text];
                uint modelNumber = Convert.ToUInt32(newOrder.ItemList[p.ModelNumber]);

                if (dgw.Cells[2].Value.ToString() == Convert.ToString(modelNumber))
                {
                    this.dataGridProduct.Rows[currentRow].Cells["colSelect"].Value = true;
                }

            }
            catch (Exception exc)
            {
            }
        }
        //MessageBox.Show(dataGridProduct.Rows[currentRow].Cells["colSelect"].Value.ToString());
        currentRow++;
    }

}

QuestionGrid Combo Un-Select Pin
Syed Shahid Hussain8-Jul-08 23:36
Syed Shahid Hussain8-Jul-08 23:36 
QuestionCombobox problem Pin
Vibin Venugopal8-Jul-08 23:30
Vibin Venugopal8-Jul-08 23:30 
AnswerRe: Combobox problem Pin
Gareth H8-Jul-08 23:52
Gareth H8-Jul-08 23:52 
GeneralRe: Combobox problem Pin
Vibin Venugopal9-Jul-08 0:55
Vibin Venugopal9-Jul-08 0:55 
GeneralRe: Combobox problem Pin
Kjetil Svendsen9-Jul-08 2:34
Kjetil Svendsen9-Jul-08 2:34 
AnswerRe: Combobox problem Pin
Vimalsoft(Pty) Ltd9-Jul-08 3:02
professionalVimalsoft(Pty) Ltd9-Jul-08 3:02 
QuestionHow to detect all usb device removal? Pin
lovnin8-Jul-08 23:12
lovnin8-Jul-08 23:12 
QuestionVirtual memory problem Pin
B!Z8-Jul-08 22:25
B!Z8-Jul-08 22:25 
AnswerRe: Virtual memory problem Pin
leppie8-Jul-08 22:35
leppie8-Jul-08 22:35 
AnswerRe: Virtual memory problem Pin
S. Senthil Kumar8-Jul-08 23:03
S. Senthil Kumar8-Jul-08 23:03 
AnswerRe: Virtual memory problem Pin
Alan Balkany9-Jul-08 4:55
Alan Balkany9-Jul-08 4:55 
QuestionWhats wrong with DebuggerDisplay in Visual Studio 2008 Pin
MarkPhB8-Jul-08 22:05
MarkPhB8-Jul-08 22:05 
AnswerRe: Whats wrong with DebuggerDisplay in Visual Studio 2008 Pin
leppie8-Jul-08 22:32
leppie8-Jul-08 22:32 
GeneralRe: Whats wrong with DebuggerDisplay in Visual Studio 2008 Pin
MarkPhB8-Jul-08 22:45
MarkPhB8-Jul-08 22:45 
GeneralRe: Whats wrong with DebuggerDisplay in Visual Studio 2008 Pin
leppie8-Jul-08 22:49
leppie8-Jul-08 22:49 
QuestionHow To Use HASP Device Security Pin
Thaer Hamael8-Jul-08 21:46
Thaer Hamael8-Jul-08 21:46 
AnswerRe: How To Use HASP Device Security Pin
leppie8-Jul-08 22:31
leppie8-Jul-08 22:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.