Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 25th, 2006, 04:31 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default gridview select

Can anyone tell me what I need to do to get a select button to pass an id number to a formview page?

Here is my code:
gridview:
<asp:GridView ID="gdStreet" runat="server" DataSourceID="odbPIResults" onselectedindexchanged="gdStreet_SelectedIndexChan ged"
DataKeyNames="Tax_ID"
AutoGenerateColumns="False"
SelectedIndex="0">
            <Columns>
              <asp:CommandField
                 ButtonType="Button"
                 ShowSelectButton="True"
                 CausesValidation="False"
                 >
              </asp:CommandField>


(I have also tried to use the buttonfield with this code:
                <asp:ButtonField ButtonType="Button"
                CommandName="Select"
                 Text="Details" >
                </asp:ButtonField>
instead of the commandfield.)

formview:
  Protected Sub gdStreet_SelectedIndexChanged(ByVal sender As _
       Object, ByVal e As System.EventArgs) Handles _
       gdStreet.SelectedIndexChanged

      Dim strID As String = gdStreet.SelectedRow.Cells(1).Text

   End Sub


The strID field is empty when I run the code. What am I missing here?

Thanks for your help! :)
Reply With Quote
  #2 (permalink)  
Old April 26th, 2006, 10:10 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never mind... the code works ok. The cell index # was incorrect. Now that is embarassing and never mind that I spent a whole day trying to figure it out. ;?
Reply With Quote
  #3 (permalink)  
Old April 26th, 2006, 03:07 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

GridView doesn't support it. Probably it will in next framework version.

You can use ALGrid from http://asplib.net or Grid from http://telerik.com.

Or add special linkbutton with "Insert row" text

Reply With Quote
  #4 (permalink)  
Old April 26th, 2006, 03:17 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Moderator. Please remove my message:

GridView doesn't support it. Probably it will in next framework version.

I send it in wrong topic

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Select from another select statement to a repeater simsen ASP.NET 2.0 Professional 0 May 2nd, 2007 04:34 PM
Select gridview record with mouseclick wirerider ASP.NET 2.0 Basics 2 March 9th, 2006 01:44 PM
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM



All times are GMT -4. The time now is 11:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.