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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridLists populated via a database query.

Thread ID:





21435 Nov 10,2004 11:04 AM UTC Nov 10,2004 01:37 PM UTC WinForms 1
Tags: GridControl
Steve Page
Asked On November 10, 2004 11:04 AM UTC

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 01:37 PM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon