မင်္ဂလာပါ!

လှိုက်လှဲစွာကြိုဆိုပါသည်။ ယခု ပထမဆုံးအကြိမ် ရောက်ဖူးခြင်းဖြစ်ပါသလား? ဝင်ရောက် ဆွေးနွေး မေးမြန်းလိုပါလျှင် အောက်တွင်ဖော်ပြထားသော button များမှတဆင့် ဝင်ရောက် ဆွေးနွေးနိုင်သကဲ့သို့ အဖွဲ့ဝင်အသစ်အနေဖြင့်လည်း လျှောက်ထားနိုင်ပါတယ်။

MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode fonts များမှာ Mon3,Yunghkio, Myanamr3 စသည်များ အသုံးပြုနိုင်သည်။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.

how to add textbox in datagridview

I want to know how to add textbox in specific place of datagridview like in bookshop. When the user type bookid or code in textbox, other information such as price,name etc... are shown in label near textbox. Plze guide me
Thanks

Thanked by 1 illikintann

မှတ်ချက်များ

  • Registered Users

    Which bookshop you are refering to? If you have reference link or image, please show us.

    Thanked by 1 illikintann
  • Registered Users


    in this picture, I want to add textbox under bookid. When the user type bookid, I wanna show other book information under related field.
    Thz =D

    Thanked by 1 illikintann
  • edited November 2015 Registered Users
    1. Enable "Allow User to Add Rows" properties of the GridView. Then, you will see default 1 line in the GridView where you can enter your BookID.

    2. Use DataGridView's CellEndEdit Event. That event will fire after you typed bookid and pressed "Enter" or you move your focus to another control. Sample Code will be like this -

    private void dgvGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
    {
        if (e.ColumnIndex == colID.Index)
        {
            // Currently entered BookID
            string l_BookID = dgvGridView1.Rows[e.RowIndex].Cells[colID.Index].Value.ToString();
    
            // Get BookInfo from Database
            DataTable l_BookInfoTable = GetBookInfoByID(l_BookID);
    
            // If Book exists
            if (l_BookInfoTable.Rows.Count > 0)
            {
                // Bind to other columns
                dgvGridView1.Rows[e.RowIndex].Cells[colName.Index].Value = l_BookInfoTable.Rows[0]["Name"];
                dgvGridView1.Rows[e.RowIndex].Cells[colPrice.Index].Value = l_BookInfoTable.Rows[0]["Price"];
                dgvGridView1.Rows[e.RowIndex].Cells[colDesc.Index].Value = l_BookInfoTable.Rows[0]["Desc"];
            }
            else
            {
                // Do something!
            }
        }
    }
    

    Alternatively, you could bind a DataTable to DataGridView and Modify it's data source to make changes.

    Thanked by 1 illikintann
  • Registered Users

    thz bro, I got it. I want to get Job(.Net Programmer) in Yangon near Botahtaung. :)

    Thanked by 1 illikintann
  • Registered Users

    Glad to hear that. I'm now quite far away from Yangon and I cannot help you that :P
    There must be a lot of software houses in Yangon. try to get into one of those.

    Thanked by 1 illikintann
Sign In or Register to comment.