We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridLists populated via a database query.

Thread ID:

Created:

Updated:

Platform:

Replies:

21435 Nov 10,2004 06:04 AM Nov 10,2004 08:37 AM Windows Forms 1
loading
Tags: GridControl
Steve Page
Asked On November 10, 2004 06:04 AM

I have a GridDataBoundGrid that contains a column called "PersonID". To populate this column I''d like the user to be able to type a few characters of a persons name and then either a) leave the field b) hit return c) click on the drop down button. Then I want to use what they typed in to access the database to retrieve a dataset containing "PersonID"s and "Name"s that match on "Name" and then show them in a GridList so that the user can select a match. As far as the user is concerned they see "Names" and not "PersonIDs". I would like to do this in several places in my application, so is there a good way of wrapping this up as a re-usable control? Thanks in Advance.

Administrator [Syncfusion]
Replied On November 10, 2004 08:37 AM

You could use a GridDropDouwnGridListControl (celltyp = "GridListControl") to get a running start at this. What you could do is to set the column''s datasource, displaymember, and valuemember to be what you want so it picks up the foreign table. To handle the displaying the partial list when the user types a few characters and click teh drop button, you could handle the CurrentCellShowingDropdown event, and there dynamically filter the list so it only shows the items that match the type values. To get teh typed value, you would use grid.CurrentCell.Renderer.ControlText within CurrentCellShowingDropdown. Here is a KB link the does something of this nature. (It does filter teh droplist, but does not use the ControlText.) http://www.syncfusion.com/Support/article.aspx?id=567 To handle the Enter key, try the grid.CurrentCellKeyDown event, and in it call grid.CurrentCell.ShowDropdown when the key is the enter key.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;