![]() |
Web Development »
ASP.NET »
General
Intermediate
License: The Code Project Open License (CPOL)
ASP.NET using GridView Control as LookupBy Amit K BhagatASP.NET using GridView control as lookup |
VB, Windows, .NET, ASP.NET, WebForms, SQL 2000, SQL 2005, VS2005, DBA, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||
This simplifies the way to enter lookup values in a textbox.
I have used GridView to return lookup values for FormView control.
You can use the lookup to return a value to any ASP.NET textbox control.
I have used two lookup pages, lookupSupplier.aspx and lookupCategory.aspx. These two lookup pages work for main page default.aspx page which has FormView control that is used for inserting and editing the Products table.
You must know how the GridView control works.
The following is an example of creating a template column for GridView control.
You need to add an ASP.NET hyperlink control for a template column. This hyperlink will be used to return the value(text) in column one (column index 0) of the GridView control.
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="hlReturnLookupValue" runat="server">Select</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Try to use caching for lookup pages so that lookup pages get opened quickly and work fast. However, this is not essential.
I will update this page based on your feedback.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 22 Nov 2008 Editor: Deeksha Shenoy |
Copyright 2007 by Amit K Bhagat Everything else Copyright © CodeProject, 1999-2009 Web13 | Advertise on the Code Project |