Featured post
.net - How can I prevent users from entering data into DataGridViewComboBoxCells? -
i have project uses number of datagridview controls. of cells of datagridviewtextboxcell persuasion. declare controls so:
dim mycell datagridviewcell
later specify whether datagridviewtextboxcontrols or datagridviewcomboboxcells so:
mycell = new datagridviewtextboxcell ...or... mycell = new datagridviewcomboboxcell
none of places in code require ability users enter own values in combo boxes. is, either hard-coded or values gathered other data within application.
currently, users can highlight combo box control defined shown above , begin typing like. example, have 1 combo box offers user selection of integers between 1 , 9. can highlight combo box cell , enter "hello, world!" if i'd like.
what take disable ability? i'm sure there's property, have yet find it. have searched internet, , have found ability have user-entered values added list , stream of data-binding tutorials.
thank in advance! c
check here
edit
i should have put more information up, i'm tired , feeling little sick felt being lazy ... no have ruin laziness , force me type more. (lol joking).
essentially comboxbox see in comboboxcell acutally combobox control (tired = bad engrish).
from can recall, should able @ control used in cell using editingcontrolshowing event of datagridview. once there set dropdownstyle.
like:
private sub datagridview_editingcontrolshowing(byval sender object, byval e datagridvieweditingcontrolshowingeventargs) dim c combobox = e.control if not c nothing c.dropdownstyle = comboboxstyle.dropdownlist end if end sub
- Get link
- X
- Other Apps
Comments
Post a Comment