473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to fix delphi dbgrid dropdown list problem

I have a DBgrid and one column is a look up to a table. When the the drop down list is envoked and when the form is being resized or moved around, the list will still be shown at the same spot where it first was envoked. I don't know what seems to be the problem.
Jul 19 '10 #1
5 3195
iohos
45
Expand|Select|Wrap|Line Numbers
  1. procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  2.  
  3.   Field: TField; State: TGridDrawState);
  4.  
  5. begin
  6.  
  7.   if (gdFocused in State) then
  8.  
  9.   begin
  10.  
  11.   if (Field.FieldName = DBLookupCombo1.DataField) then
  12.  
  13.   begin
  14.  
  15.   DBLookupCombo1.Left := Rect.Left + DBGrid1.Left;
  16.  
  17.   DBLookupCombo1.Top := Rect.Top + DBGrid1.top;
  18.  
  19.   DBLookupCombo1.Width := Rect.Right - Rect.Left;
  20.  
  21.   { DBLookupCombo1.Height := Rect.Bottom - Rect.Top; }
  22.  
  23.   DBLookupCombo1.Visible := True;
  24.  
  25.   end;
  26.  
  27.   end;
  28.  
  29. end;
  30.  
hope dis helps
Jul 25 '10 #2
Jyoti Ballabh
115 100+
@iohos
the problem persists, after a repetitious use of the algorithm the grid "shows in the same place where it was first envoked".
Aug 1 '10 #3
iohos
45
that's impossible, spettro. I ran this using some random data (the rooster of the New England Patriots). The drop down list worked just fine even after making countless edits.
Aug 1 '10 #4
Jyoti Ballabh
115 100+
The parentheses in the second last line of the program may not be required.
Aug 1 '10 #5
iohos
45
yup, can do without it.
Aug 1 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
1
by: news | last post by:
Hello, I need help with the following problem: An HTML page that have two dropdown list whit different values: 1. Dropdown list 1(tblname1) =values with different location's. After user...
1
by: Kenneth Keeley | last post by:
Hi, Is there a way to create a editable drop down list. This would be some sort of text box with a drop down list attached. My idea is to have a text box that has a dropdown list that has some...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
4
by: Paul | last post by:
I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost,...
1
by: Vijay Kerji | last post by:
Hi, I have a datagrid with dropdown list and Remove hyperlink in it as columns. When I remove a row from the datagrid, Dropdown list selection is retaining its previous value. i.e, removed...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.