datagrid problem....
-
Hi, two questions 1. i want to bind a database table to a datagridview and few of the columns must have cell format as datagridview combo box ... 2. if question one is solved then..see to this.... one of the column contains item list along with its values i am storing the item names in the combobox and the values as cell.value... now what i need is when i am retriving the database the particular columns must have cell type as combobox and the values for the cell must match the combobox list item regards sindhu tiwari
its me sid
-
Hi, two questions 1. i want to bind a database table to a datagridview and few of the columns must have cell format as datagridview combo box ... 2. if question one is solved then..see to this.... one of the column contains item list along with its values i am storing the item names in the combobox and the values as cell.value... now what i need is when i am retriving the database the particular columns must have cell type as combobox and the values for the cell must match the combobox list item regards sindhu tiwari
its me sid
sindhutiwari wrote:
1. i want to bind a database table to a datagridview and few of the columns must have cell format as datagridview combo box ...
Use ItemTemplate Field and use Combox in It!! your problem will solve Steps a)add a column to the gridview which is a TemplateField b)Edit the templateField and drag ComboBox into the template!
sindhutiwari wrote:
2. if question one is solved then..see to this....
Try to do this first one , after that you can do this one also . This is For your reference!!! Reference!!!![^]
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
-
sindhutiwari wrote:
1. i want to bind a database table to a datagridview and few of the columns must have cell format as datagridview combo box ...
Use ItemTemplate Field and use Combox in It!! your problem will solve Steps a)add a column to the gridview which is a TemplateField b)Edit the templateField and drag ComboBox into the template!
sindhutiwari wrote:
2. if question one is solved then..see to this....
Try to do this first one , after that you can do this one also . This is For your reference!!! Reference!!!![^]
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
i neede it in desktop application
its me sid
-
i neede it in desktop application
its me sid
Hi sindhutiwari, 1) First retrive the data from database to DataTable. DataTable objDataTable = new DataTable(); objDataTable.Columns.Add("DataColumn1"); objDataTable.Columns.Add("DataColumn2"); dr = objDataTable.NewRow(); dr[0] = "data1"; dr[1] = "yes" objDataTable.Rows.Add(dr); 2) Now you can bind this datatable to datagridview. You should set the "DataPropertyName" property of datagridview column. grdView.DataSource = objDataTable; this.grdColumn1.DataPropertyName = "DataColumn1"; this.grdColumn2.DataPropertyName = "DataColumn2"; // grdColumn2 is comboboxcell it contains 2 items (yes/no). other values not accepted. Regards,
Gopal.S