| Author: ani 04 Dec 2008 | Member Level: Gold | Rating:  Points: 4 |
hi This ths the sample coding try like this...
DataGridViewCheckBoxColumn chkbx_key = new DataGridViewCheckBoxColumn();
//Use this coding when u want the control to bind in Datagridview..
chkbx_key = new DataGridViewCheckBoxColumn(); chkbx_key.Width = 40; chkbx_key.FlatStyle = FlatStyle.Popup; chkbx_key.HeaderText = "Key"; chkbx_key.DisplayIndex = 2; datagridview_ParaUnit.Columns.Insert(3, chkbx_key);
Same as ComboBox.. regards ani
|
| Author: ani 04 Dec 2008 | Member Level: Gold | Rating:  Points: 4 |
hi This ths the sample coding try like this...
DataGridViewCheckBoxColumn chkbx_key = new DataGridViewCheckBoxColumn();
//Use this coding when u want the control to bind in Datagridview..
chkbx_key = new DataGridViewCheckBoxColumn(); chkbx_key.Width = 40; chkbx_key.FlatStyle = FlatStyle.Popup; chkbx_key.DisplayIndex = 3; datagridview_ParaUnit.Columns.Insert(3, chkbx_key);
here datagridview_paraUnit is DatagridView name.. Same as ComboBox.. regards ani
|
| Author: Pankaj Prajapati 04 Dec 2008 | Member Level: Bronze | Rating:  Points: 2 |
hi thanx for this... solution...
it is working well...
but can u tell me how can i use it with multiple columns in datagridview that r bind using DataBind method.....
thanx....
|
| Author: ani 04 Dec 2008 | Member Level: Gold | Rating:  Points: 5 |
here i am using two check boxs and one combobox.. Hope this s wt u expects
DataGridViewCheckBoxColumn chkbx_key1 = new DataGridViewCheckBoxColumn(); DataGridViewChomboboxColumn combobx_key2 = new DataGridViewChomboboxColumn(); DataGridViewCheckBoxColumn chkbx_key3 = new DataGridViewCheckBoxColumn();
chkbx_key1 = new DataGridViewCheckBoxColumn(); chkbx_key1.Width = 40; chkbx_key1.FlatStyle = FlatStyle.Popup; chkbx_key1.DisplayIndex = 3; dgv_ParaUnit.Columns.Insert(3, chkbx_key1);
combobx_key2 = new DataGridViewChomboboxColumn(); combobx_key2.Width = 40; combobx_key2.FlatStyle = FlatStyle.Popup; combobx_key2.DisplayIndex = 4; dgv_ParaUnit.Columns.Insert(4, combobx_key2);
chkbx_key3 = new DataGridViewCheckBoxColumn(); chkbx_key3.Width = 40; chkbx_key3.FlatStyle = FlatStyle.Popup; chkbx_key3.DisplayIndex = 5; dgv_ParaUnit.Columns.Insert(5, chkbx_key3);
|
| Author: Pankaj Prajapati 08 Dec 2008 | Member Level: Bronze | Rating:  Points: 0 |
hi. ani
h r u?
thanx for this gr8 solution.....
|
| Author: Pankaj Prajapati 10 Dec 2008 | Member Level: Bronze | Rating:  Points: 4 |
hi...
again thnx...
i have tried ur solution, it is working very well...
but i want to do like this...
i have filled my datagridview like this...
dt = SqlHelper.ExecuteDatatable(SqlHelper.ConnectionString, CommandType.Text, "Select MId, MName From ModelM Order BY MName"); dtGrdVw.DataSource = dt; dtGrdVw.Columns[0].Width = 0; dtGrdVw.Columns[0].Visible = false; dtGrdVw.Columns[1].Width = 197; dtGrdVw.Columns[1].HeaderText = "Code"; dtGrdVw.Refresh();
now i want put checkboxes against MName field....
so how can i do this.... plz give me a soltuion for this....
thanking u.....
|