如何将一列URL分配给DataGrid的超链接列c [英] How to assign a column of URLs to Hyperlink Column of a DataGrid c
问题描述
大家好,全部:
我需要一些关于DataGrid控件的帮助。
我在.NET visual Stadio的设计视图中创建了一个DataGrid,dg并使用
构建器向dg添加超链接列。
我想尝试在
编程中为此超链接列分配一列URL方式(即,动态分配)。但是,我找不到继续这样做的方式
。
你有什么想法吗?谢谢。
David
Hi, all:
I need a help from you about DataGrid control.
I created a DataGrid, dg, in design view of .NET visual Stadio and use the
builder to add a Hyperlink column to dg.
I want to try to assign a column of URLs to this hyperlink column in
programming way (ie., dynamically assignment). However, I can not find a way
to continue doing it.
Do you have ideas about it? Thanks.
David
推荐答案
2005年10月14日星期五08:53:14 -0700, david写道:
On Fri, 14 Oct 2005 08:53:14 -0700, david wrote:
大家好:
我需要一个关于DataGrid控件的帮助。
我在.NET的设计视图中创建了一个DataGrid,dg visual Stadio并使用
构建器向dg添加一个超链接列。
我想尝试以编程方式为这个超链接列分配一列URL(即,动态分配) 。但是,我找不到继续这样做的方法。
你有什么想法吗?谢谢。
David
Hi, all:
I need a help from you about DataGrid control.
I created a DataGrid, dg, in design view of .NET visual Stadio and use the
builder to add a Hyperlink column to dg.
I want to try to assign a column of URLs to this hyperlink column in
programming way (ie., dynamically assignment). However, I can not find a way
to continue doing it.
Do you have ideas about it? Thanks.
David
让我们假设你有数据集,dataview,数组中的列表。您可以使用DataBinding为您的网格提供值。一篇好文章:
http://www.codeproject.com /aspnet/Ma...ataBinding.asp
Let''s assume that you have the list in the dataset, dataview, array. You
can use DataBinding to provide your grid with values. For a good article:
http://www.codeproject.com/aspnet/Ma...ataBinding.asp
HI David,
在DataGrid_ItemDataBound中事件:
HyperLink link =(HyperLink)e.Item.Cells [link_Column_index] .Controls [0];
link.NavigateUrl = getURL();
HTH
Elton Wang
" david"写道:
HI David,
In DataGrid_ItemDataBound event:
HyperLink link = (HyperLink)e.Item.Cells[link_Column_index].Controls[0];
link.NavigateUrl = getURL();
HTH
Elton Wang
"david" wrote:
全部:
我需要一个关于DataGrid控件的帮助。
我在.NET visual的设计视图中创建了一个DataGrid,dg Stadio并使用
构建器向dg添加一个超链接列。
我想尝试以编程方式为这个超链接列分配一列URL(即,动态分配)。但是,我找不到继续这样做的方法。
你有什么想法吗?谢谢。
大卫
Hi, all:
I need a help from you about DataGrid control.
I created a DataGrid, dg, in design view of .NET visual Stadio and use the
builder to add a Hyperlink column to dg.
I want to try to assign a column of URLs to this hyperlink column in
programming way (ie., dynamically assignment). However, I can not find a way
to continue doing it.
Do you have ideas about it? Thanks.
David
谢谢。
目前还不完全清楚对我来说。例如,我有一个URL列表,名为
URL,它是数据集的一列,我在数据网格中有一列超链接列,
链接,dg。假设这两列具有相同的大小。
在设计视图中,我将
属性构建器中的超链接列留空了URL框。
现在在代码behide中,我尝试在获取URL列表后填写每个超链接列项的
的URL框(属性项)。我可以执行
跟随:
dg.Columns(" link")= URL
它有意义吗?
David
" Elton W"写道:
Thank you.
It is not completely clear to me. For example, I have a list of URLs, called
URLs which is a column of a dataset, and I have a column of hyperlink column,
link, in the datagrid, dg. Assume that these two columns have the same size.
In the design view, I have left the URL box empty for the hyperlink column in
the property builder.
Now in the code behide, I try to fill in the URL box (property item) for
each hyperlink column item after I got the list of URLs. Can I do the
following:
dg.Columns("link") = URLs
Does it make sense?
David
"Elton W" wrote:
HI David,
在DataGrid_ItemDataBound事件中:
HyperLink link =(HyperLink)e.Item.Cells [link_Column_index ] .Controls [0];
link.NavigateUrl = getURL();
HTH
Elton Wang
" david"写道:
HI David,
In DataGrid_ItemDataBound event:
HyperLink link = (HyperLink)e.Item.Cells[link_Column_index].Controls[0];
link.NavigateUrl = getURL();
HTH
Elton Wang
"david" wrote:
全部:
我需要一个关于DataGrid控件的帮助。
我在.NET visual的设计视图中创建了一个DataGrid,dg Stadio并使用
构建器向dg添加一个超链接列。
我想尝试以编程方式为这个超链接列分配一列URL(即,动态分配)。但是,我找不到继续这样做的方法。
你有什么想法吗?谢谢。
David
Hi, all:
I need a help from you about DataGrid control.
I created a DataGrid, dg, in design view of .NET visual Stadio and use the
builder to add a Hyperlink column to dg.
I want to try to assign a column of URLs to this hyperlink column in
programming way (ie., dynamically assignment). However, I can not find a way
to continue doing it.
Do you have ideas about it? Thanks.
David
这篇关于如何将一列URL分配给DataGrid的超链接列c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!