473,657 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do i add link column in grid view in asp.net 2.0


Hi all,

I have a storep procedure which returns 5 columns.

i want to show only two columsn in the grid view. first column is a
link based on some 3 of the columns.

i added the following in the aspx.

<Columns>
<asp:HyperLinkF ield headertext="Efd fdvft" DataTextField=" fame"
DataNavigateUrl Fields="guid"
DataNavigateUrl FormatString="t est.aspx?efid={ 0}" />

<asp:BoundFie ld DataField="fdat e"

HeaderText="fdf ate"
HtmlEncode="Fal se" SortExpression= "Date" />
</Columns>
and in the code behind add this.

gv1.DataSource = cmd.ExecuteRead er()

gv1.DataBind()
this gives me 7 columns instead of two.

what should i do ?

thanks in advance

Jul 19 '06 #1
1 3690
I h ave tried autogeneratecol umn=false
parez wrote:
Hi all,

I have a storep procedure which returns 5 columns.

i want to show only two columsn in the grid view. first column is a
link based on some 3 of the columns.

i added the following in the aspx.

<Columns>
<asp:HyperLinkF ield headertext="Efd fdvft" DataTextField=" fame"
DataNavigateUrl Fields="guid"
DataNavigateUrl FormatString="t est.aspx?efid={ 0}" />

<asp:BoundFie ld DataField="fdat e"

HeaderText="fdf ate"
HtmlEncode="Fal se" SortExpression= "Date" />
</Columns>
and in the code behind add this.

gv1.DataSource = cmd.ExecuteRead er()

gv1.DataBind()
this gives me 7 columns instead of two.

what should i do ?

thanks in advance
Jul 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1525
by: Henry | last post by:
I hope someone can help me on this. I have two controls on a form. the first is a comboBox the second is a datagrid. Both controls are bound to tables in a common dataset. What I am trying to get to happen is to have the value from the combobox control what populates the datagrid. I have two data adapters, the second of which uses a parameterized query to populate its referenced table in the dataset. I have two issues. first how to...
3
2125
by: Fernando Lopes | last post by:
Hi. Anybody know how can i add a column with radio buttons in a grid view? I will use this column to select the grid row to show others informations about this selected row. Any help will be appreciate. Thanks. Fernando Lopes
2
4266
by: Joe Griffith | last post by:
I'm using a Win Forms Data Grid View control in unbound mode. When I add columns using the wizard the first item is the column name. Everything works fine. However, if you return to the columns collection and look at the poperties of an individual column the name property is not in the list. Is there a way to change (or even find) the name of a column in a data grid view other than looking at it in the *.Designer.vb file?
2
2979
by: Remy | last post by:
Hi I would like to put a link into the Footer of the first column of an ASP.NET 2.0 GridView. By first column I mean the column where it normally displayes the Edit and Delete link. I've built the Insert functionality into the footer, but I only wanna display those controls if someone clicks on the link. At the moment I hide the whole footer and I have the link outside of the grid. I guess I could just add another table below the grid...
1
1291
by: Gunawan | last post by:
Hi, I could add a boundcolumn to gridview using this BoundColumn bc = new BoundColumn(); bc.DataField = "ProductsName"; bc.HeaderText = "Product"; gridview1.columns.add(bc); What I would like to ask, how can I perform this with TemplateColumn? I have a problem to bound template column to any object such as dropdownlist
1
8131
by: =?Utf-8?B?UmFodnlu?= | last post by:
Hi All; I'm working in VS2005, and have a DataGridView that is bound to a datasource. Is there a way to change a column to be a link style column after the DataGridView populates? Here's how I populate it: DataSet ds = new DataSet(); dgvShipmentHistory.DataSource = null;
2
3210
by: jakeesgirl | last post by:
I'm creating a C# program in Visual Studio. When I query the sql database, the results are put into a data grid view. However, the column widths are always too small when displayed. I have text that is not shown because the column width is not large enough. Is there a way I can fix that in the data grid view? I see a column height property but not a column width.
2
7597
by: rameshgohil | last post by:
I am using grid view and a button column in it using <itemTemplate> but I am not able to rerive cell value of a selected row from grid view. I have tried the following to methods in Row_command event of gridview but it gives Null reference exception error while clicking the button in button column of grid view : int index = gdvOdetails.SelectedIndex; object oid = (object)gdvOdetails.SelectedDataKey.Values; txtMsg.Text =...
2
2825
by: vinod allapu | last post by:
Hi all, i want to append an empty column to the grid view. Only the appended column should be editable and while displaying the grid the entire column should be in editable mode(not a single cell) . so that the user can enter values in that column and update. My grid should not contain any edit,update buttons. Please check the image for better understanding. Is it possible to do like this... Thanking you all,
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.