Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2004, 04:24 PM
Authorized User
 
Join Date: Feb 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have a good day!

Aashish Shah
 
Old February 14th, 2004, 05:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

see http://www.rustemsoft.com/

Always:),
Hovik Melkomian.
 
Old October 12th, 2004, 01:42 AM
Authorized User
 
Join Date: Jan 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi ..

but how do u pre-select the item based on the content of the datagrid

say for exmpl:
ive the currency column .. while editing i get a drop down showin usd,gbp,euro - but with gbp selected already - ie. based on the previously saved value of currency of that row...


 
Old October 16th, 2004, 03:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

One way I have done this is to create a template column that contains both the control that I want the users to see, and a hidden literal to hold the lookup value:

<asp:templatecolumn>
   <asp:literal runat="server" id="litValue" text='<%# binding code... %>' visible="false" />
   <asp:dropdownlist runat="server" id="ddlChoices" ...></asp:dropdownlist>
</asp:templatecolumn>

Then in my editcommand handler for the grid, I preset the ddl item based on the value that's in the literal control.

ddlChoices = CType(e.Item.FindControl("ddlChoices"), DropDownList)
litValue = CType(e.Item.FindControl("litValue"), Literal)

ddlChoices.SelectedIndex = ddlChoices.Items.IndexOf(ddlChoices.Items.FindByVa lue(litValue.Text))





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting data using a dropdownlist johan_st ASP.NET 2.0 Basics 0 January 20th, 2007 07:45 AM
Setting Selected attribute of DropDownList in Grid jlrolin ASP.NET 1.0 and 1.1 Professional 0 June 13th, 2006 01:59 PM
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.