473,396 Members | 2,068 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 make dropdown display updates?

Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

Clara
--
thank you so much for your help
Dec 14 '07 #1
4 1193
On Dec 14, 1:48 pm, clara <cl...@discussions.microsoft.comwrote:
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.
You;ll need to post the offending code if anyone is going to be able
to help you. It sounds like you are doing exactly what you need to,
although I am not sure what you mean by refresh. All you should have
to do is clear the combobox's current list and re-add them all.
Dec 14 '07 #2
Could you tell me how to clear the items list?

Clara
--
thank you so much for your help
"za***@construction-imaging.com" wrote:
On Dec 14, 1:48 pm, clara <cl...@discussions.microsoft.comwrote:
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

You;ll need to post the offending code if anyone is going to be able
to help you. It sounds like you are doing exactly what you need to,
although I am not sure what you mean by refresh. All you should have
to do is clear the combobox's current list and re-add them all.
Dec 14 '07 #3
JDS
On Dec 14, 6:48 pm, clara <cl...@discussions.microsoft.comwrote:
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

Clara
--
thank you so much for your help
Try calling the update method. This has driven me mad in the past; you
read the definition of the refresh method and it seems to be exactly
what you want but does not seem to work in practice. Let us now if it
works.
Dec 15 '07 #4
Hi there,

I tried to use Refresh or Update, but they all failed. This is my code:

Public Sub FillActID(ByRef ComboBoxEventID As ComboBox)
Dim sqlDataReader As SqlClient.SqlDataReader
Dim sqlString As String = "select Event_id from Act_ID"

sqlDataReader = CreateReader(sqlString)

While (sqlDataReader.Read())
ComboBoxEventID.Items.Add(CInt(sqlDataReader.Item( "event_id")))
End While
ComboBoxEventID.Refresh()
ComboBoxEventID.Update()
sqlDataReader.Close()
End Sub

Clara
thank you so much for your help
"JDS" wrote:
On Dec 14, 6:48 pm, clara <cl...@discussions.microsoft.comwrote:
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

Clara
--
thank you so much for your help

Try calling the update method. This has driven me mad in the past; you
read the definition of the refresh method and it seems to be exactly
what you want but does not seem to work in practice. Let us now if it
works.
Dec 17 '07 #5

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

Similar topics

2
by: JP SIngh | last post by:
Hi All I just wondering if someone can suggest a solution to this tricky issue we have got. I have an asp form which allow our users to create a new record and save it to the database. On the...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
1
by: sk | last post by:
I have a situation where the list of tables(database) and the columns for each table must be displayed for selection. for each member(displayed in each row) i have to select a table and a column from...
3
by: RJN | last post by:
Hi The texts in the dropdown are too long and the width is not sufficient to show the entire text. Increasing the width is not an option. Is there a way to show the selected item text as a...
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...
0
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
4
by: J MCallister | last post by:
Hello, I am working on a shopping cart where the viewer sees a dropdown with shipping options, each with a price. Elsewhere on the page is a display of the total. I am working on having the...
1
by: =?Utf-8?B?U3Rvcm1icmluZ2Vy?= | last post by:
I have an UpdatePanel with a dropdown list that I can't seem to get to update. It has a hidden button which I click from javascript added to the page when another update panel is updated. Triggers...
8
by: Wingot | last post by:
Hey, I have a program I am trying to write using Visual C#, SQL Server 2005/2008, and Visual Studio 2008, and one part of it includes a Schema called Client. Inside this schema, three tables...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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,...

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.