jeff Lee
asked on
Add and bind combobox inside datagridview c#
Hi,
I add and bind combobox inside datagridview c# and set datagridview.Readonly = true in default.
The following is what I want.
If the readonly of property in datagridview is true, the combobox inside datagridview can display the values as some control like textbox.
When I want to insert or edit records, I set readonly = false, the datagridview can show as follows.
Does it possible?
Thanks.
jeff
I add and bind combobox inside datagridview c# and set datagridview.Readonly = true in default.
The following is what I want.
If the readonly of property in datagridview is true, the combobox inside datagridview can display the values as some control like textbox.
When I want to insert or edit records, I set readonly = false, the datagridview can show as follows.
Does it possible?
Thanks.
jeff
Can you share the code? when I tried the same I didn't see the behavior as you said I see the combo box as desired even the both of the properties are set to read only
ASKER
Hi Dorababu M,
I just change the ReadOnly property of a DataGridView and never set ReadOnly property of combobox inside datagridview. When users insert and edit records, the system will change the ReadOnly property of a DataGridView to false.
Thanks.
jeff
I just change the ReadOnly property of a DataGridView and never set ReadOnly property of combobox inside datagridview. When users insert and edit records, the system will change the ReadOnly property of a DataGridView to false.
Thanks.
jeff
ASKER
Hi,
Briefly, when users insert and edit records, the datagridview can display record with combobox. But if users just select data, I just hope the datagridview can display record with textbox in the same column. That's what I want. The issue is very easy in Delphi. I just ask if it is possible in visual studio.
Thanks.
jeff
Briefly, when users insert and edit records, the datagridview can display record with combobox. But if users just select data, I just hope the datagridview can display record with textbox in the same column. That's what I want. The issue is very easy in Delphi. I just ask if it is possible in visual studio.
Thanks.
jeff
Still not clear but If I understood correctly in the same column you are trying to display text box and combo box column based on edit/update. Initially it will display a textbox on clicking edit it will display combo box?
ASKER
Hi Dorababu M,
>>>>>> Initially it will display a textbox on clicking edit it will display combo box?
That's correct.
jeff
>>>>>> Initially it will display a textbox on clicking edit it will display combo box?
That's correct.
jeff
How are you doing the edit of a row any button or on row click?
ASKER
Hi Dorababu M,
The form just like as follows.
When users want to insert and edit records, firstly they should press Edit.
Thanks.
jeff
The form just like as follows.
When users want to insert and edit records, firstly they should press Edit.
Thanks.
jeff
OK how are you adding the columns to grid is it from any database or you are adding the columns manually? Only one row you will select and click on edit?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Dorababu M,
It can work, but it need more code in visual studio. I must be familiar with the visual studio. I'm just curious why it can't simplify the code in visual studio.
Thanks.
jeff
It can work, but it need more code in visual studio. I must be familiar with the visual studio. I'm just curious why it can't simplify the code in visual studio.
Thanks.
jeff
What you mean by more code? Does that work for you?
ASKER
Hi Dorababu M,
Ya, it work fine for me. but I can solve the problem using simple code in Delphi. That's what I mean.
Life is really simple, but we insist on making it complicated.
I really appreciate for your help.
jeff
Ya, it work fine for me. but I can solve the problem using simple code in Delphi. That's what I mean.
Life is really simple, but we insist on making it complicated.
I really appreciate for your help.
jeff
ASKER
Hi Dorababu M,
I found another solution very easy and simple.
It's really amazing.
jeff
I found another solution very easy and simple.
It's really amazing.
jeff