Avatar of Bob Bender
Bob BenderFlag for United States of America

asked on 

Gridview with Hyperlink column questions

I have a GridView with 3 columns.   One of those columns is a HyperlinkField, using another column as a QueryString entry.

Code looks like this...

      <Columns>
          <asp:BoundField DataField="ContactUs_intended_for" HeaderText="Team" ReadOnly="True">
                 <HeaderStyle HorizontalAlign="Center" />
                 <ItemStyle HorizontalAlign="Center" />
          </asp:BoundField>

          <asp:BoundField DataField="ContactUs_subject" HeaderText="Subject" ReadOnly="True" >
                  <ItemStyle HorizontalAlign="Left" />
          </asp:BoundField>

          <asp:HyperLinkField 
                    DataNavigateUrlFields="ContactUs_intended_for"
                    DataNavigateUrlFormatString="Contact_Us_Details.aspx?Team={0}"
                    Text="Details..."  >
          </asp:HyperLinkField>
      </Columns>

Open in new window


Works good now, as the QueryString field is filled from the column for that has the "ContactUs_intended_for" value.
Therefore, I am tjhinking that only entries that can used in the DataNavigateUrlFormatString property have to be from the GridView...  Is that true?

I need to change the source of the data for the QueryString entries to new DropDown boxes added for the following.
Team named "filterTeam"  and  Status named "filterStatus"

Can I fill the "DataNavigateUrlFields" with the  filterTeam.SelectedValue.Text, filterStatus.SelectedValue.Text  entries?
If not, is there an event that is used that I can create the DataNavigateUrlFormatString with the URL info I need?

I hope that made sense...

Bob
.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
Bob Bender
SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Bob Bender
Bob Bender
Flag of United States of America image

ASKER

Thanx folks!   I understand most of that and moving forward.   NOW, to only get 2 QueryStrings (needed for a composite key on a SQL database in the detailsView page.  

I think I can use the RowBound event to build the URL and combine the fields into a single string and pass thru it.

Bob
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo