473,466 Members | 1,332 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to add comboboxes in the first row of datagridview.

Hi all,
I have to add comboboxes in the first row of datagridview for
mapping the database fields.
For e.g. I have to show Id, FirstName, LastName in each comboboxes in
the first row. if i select a database which contains 2 fields then
this data should be displayed from second row so that the user can
choose the header name for this two columns from comboboxes like Id,
FirstName, LastName etc.
Can anybody tell me the solution?
Thanks,
Ashish Taralekar.

Apr 11 '07 #1
2 1741
One way to try to do this is to use the DataGridView in VirtualMode,
setting this property to true and not setting the DataSource property.
Then in the CellValueNeeded event, you can dynamically provide the
information necessary for your first row, and then for row 2 on, you
can provide values from your DataSource. You will likely have to
handle CellValuePushed as well, and also set the rowcount and column
count appropriately. It will take a little coding to get things
working.

======================
Clay Burch
Syncfusion, Inc.

Apr 11 '07 #2
On Apr 11, 5:32 pm, "ClayB" <c...@syncfusion.comwrote:
One way to try to do this is to use the DataGridView in VirtualMode,
setting this property to true and not setting the DataSource property.
Then in the CellValueNeeded event, you can dynamically provide the
information necessary for your first row, and then for row 2 on, you
can provide values from your DataSource. You will likely have to
handle CellValuePushed as well, and also set the rowcount and column
count appropriately. It will take a little coding to get things
working.

======================
Clay Burch
Syncfusion, Inc.

Hi Clay,
I tried to implement datagridview in virtualmode and written the
code to add comboboxcolumns into the DataGridView1_CellValueNeeded
event but when i debug this code then the control is not going into
this event. I am not getting when this event will fire.
Thanks,
Ashish Taralekar.

Apr 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: johnson_cy | last post by:
I am using Access 2000. My main form has a record source of a table (employeeTbl with key of . It is filtering the record results. My subform and mainform have the link child/link master set...
6
by: Sam | last post by:
Hi, I have a datagrid which has (amongst other stuff) 2 comboboxes columns. So far so good. The trick is that when I select a value in my first column, it must updates the items of the combobox in...
1
by: Sam | last post by:
Hi, Databound comboboxes in a datagridview control, are not editable! Therefore if I want to let my user adding a value which is not part of the list, it wouldn't work! Is there a work around? ...
0
by: rsimlote | last post by:
I have a datagridview with 5 comboboxes. After selecting choices in the first row, when the user move on to or enter into the combobox in the next row, the selection from the previous row displays...
5
by: jjsavage | last post by:
Hi all, I've got a DataGridView bound to a DataTable, and I need to make some of the columns into ComboBoxColumns. I've tried some of the solutions listed here, but I can't seem to make them...
0
by: Matt Pegg | last post by:
Hi all, I want be able to enable and disable navigation buttons when on the first or last row of a DataGridView object. I have a populated DataGridView and two buttons - "First Row" and...
2
by: ReneMarxis | last post by:
Hello can anyone tell me if its possible to have mixed colum-types inside one colum in a Datagridview under Net 2.0? I need to have comboboxes (with different content), inputfields and...
1
by: Arved Sandstrom | last post by:
This seems to be something so simple that none of the hundred-odd tutorials and forum threads that I have looked at (:-)) apparently thinks it's a problem. In a nutshell, I have two...
5
by: bill | last post by:
When you retrieve records to diplay in a DataGridView control the first record has the background highlighted even though no row is yet selected. Does anyone know a way to suppress this first...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.