Wrox Programmer Forums
|
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 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 April 25th, 2006, 04:31 PM
Registered User
 
Join Date: Apr 2006
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! :)
 
Old April 26th, 2006, 10:10 AM
Registered User
 
Join Date: Apr 2006
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. ;?
 
Old April 26th, 2006, 03:07 PM
Authorized User
 
Join Date: May 2005
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

 
Old April 26th, 2006, 03:17 PM
Authorized User
 
Join Date: May 2005
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






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





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