> aHLCol.DataNavigateUrlFormatString = "{0}?ID=<RecordID>" 'the real
> data would be substituted with the real data during ItemBound.
Yes ! you are right....
I assumed MS should provide the means without going extra steps b/c already
it provides half of it, the DataNavigateUrl.
I kept trying something like
DataNavigateUrl = "f1, f2" or {"f1","f2"}
thinking that's the most likely MS had implemeted that (following the
pattern)....... As you showed, I could have manipulated the datagrid in
its events as well I could have manipulated the ds adding another column on
the fly before binding etc..,,,,,
Interesting enough, after google it, I read that my assumed "way" of doing
it, it is implemented in .Net 2.0 (I haven't try it though)
What did as a quick solution is that I added another column in my sql
stamement select '<a href= .......' and resolved everything ...........
Thanks a lot and very much appreciated,
Genc.
<> wrote in message
news: oups.com...
> Hmm, that's a tough one. I believe you can handle the ItemBound event
> and modify the url within the hyperlinkcolumn. Never had the occasion
> to do what you need but I think the code below would illustrate my
> point.
>
> aHLCol.DataNavigateUrlFormatString = "{0}?ID=<RecordID>" 'the real
> data would be substituted with the real data during ItemBound.
>
> AddHandler dgSearchResults.ItemBound, AddressOf DGItemBound
>
> dgSearchResults.Columns.Add(aHLCol)
> dgSearchResults.DataSource = resultTable
> dgSearchResults.DataBind()
>
> 'Assume aHLCol is the 1st column in the DataGrid
> Sub DGItemBound(sender As Object, e As DataGridItemEventArgs)
> If e.Item.ItemType = ListItemType.Item Or _
> e.Item.ItemType = ListItemType.AlternatingItem Then
>
> 'Replace <RecordID> in the 1st column with the correct
> value from resultTable
> e.Item.Cells(0).Text =
> e.Item.Cell(0).Text.Replace("<RecordID>",
> resultTable.Rows(e.Item.ItemIndex)("RecordID"))
> End If
> End Sub
>
> That is another reason I prefer to work with GridView.
> Good luck.
>
|