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

Home Posts Topics Members FAQ

datagrid autogenerate columns

Hi ,

Getting to the point directly,
my query output doesnt have fixed columns , so I choosed "autogenera te
columns" datagrid.
I assign this dataset to my datagrid, but now I want my data should be
hyperlinks, so that I can navigate from that page to another, depending on
the link clicked.

how can I do in autogenerate columns

regards
ypul
Nov 19 '05 #1
1 1735
Although in autogeneratecol umns option, the datagrid does not automatically
generate hyperlink for you, you can implement your code to create hyperlinks.
Following code snippet show how to do it:

In datagrid_ItemDa taBound event:

if (e.Item.ItemTyp e == ListItemType.It em || e.Item.ItemType ==
ListItemType.Al ternatingItem){
foreach (TableCell cell in e.Item.Cells){
cell.Text = "<a href='myUrlSite/myPage.aspx?id= " + cell.Text + "'
target=_blank>" + cell.Text + "</a>"
}
}
HTH

Elton Wang

"ypul" wrote:
Hi ,

Getting to the point directly,
my query output doesnt have fixed columns , so I choosed "autogenera te
columns" datagrid.
I assign this dataset to my datagrid, but now I want my data should be
hyperlinks, so that I can navigate from that page to another, depending on
the link clicked.

how can I do in autogenerate columns

regards
ypul

Nov 19 '05 #2

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

Similar topics

1
3123
by: Robert | last post by:
This is a repost from the other dotnet.csharp forum: I'm including a simple datagrid control on my web form. I have created a Dataview (reportListView) onto a data table to populate it. At its simplest it works - if I define the datasource for the grid to be 'reportListView' and use autogenerate columns then I get all columns of the view appearing when the page is viewed. However I now want to restrict the number of columns to be...
0
1702
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray that has the information, but we as developers have no way to access this information. I have come up with a solution for the problem, (as I am sure many others have) using reflection. Here is some sample code that will print out the auto...
2
864
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray that has the information, but we as developers have no way to access this information. I have come up with a solution for the problem, (as I am sure many others have) using reflection. Here is some sample code that will print out the auto...
1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems controlling the visibility of columns in the DataGrid control. The problem usually comes down to one fact. The DataGrid has a property called AutoGenerateColumns. The default value is "True". This means that when AutoGenerateColumns is set to True,...
5
3632
by: VB Programmer | last post by:
I have a simple datagrid on a webform. (I'm using VB.NET.) In the page load I get some data, set the .DataSource property of the dg, then do a .DataBind. The columns are automatically created. Question: How can I dynamically change the width's of these columns? Thanks in advance.
2
1148
by: SKG | last post by:
i have a datagrid which has to display values like <Main> and <SubMain> But then they appear to be blank. I found when these values are placed in datagrid cells <td></td> they do not show. how can i display them. Thank!!!
1
3995
by: nemo | last post by:
I'm creating a datasource and populating a datagrid at runtime. The code is as follows: dt = New DataTable dt.Columns.Add(New DataColumn("Item", GetType(String))) dt.Columns.Add(New DataColumn("Value", GetType(String))) For i = 0 To j - 1 dr = dt.NewRow()
2
1463
by: serge calderara | last post by:
Dear all, I have a datagrid which bind to a dataset object Datagrid autogenerate propertie is set to True. I need to create the first column of my grid to be used as an hyperlink and sending the content click cell to the next page as a parameter. I can do that without any trouble if my grid is not set for autogenerate. How can I do when columns name are issue from the dataset ?
0
1527
by: arlie_maija | last post by:
Hey - I'm writing a control that contains a DataGrid, and I'm unable to get the update event to fire. When I click the update link, the edit event fires. heres the details... my control overrides CreateChildControls and dynamically creates the DataGrid, creates an EditCommandColumn which it adds to the
0
8385
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
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
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...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.