2012-04-23 62 views

回答

0

無論綁定控件的UrlToShare屬性(例如,在ItemDataBound事件),這是更容易,或者set it on the client(在這種情況下,你不能〜/根使用將被自動生成的,你需要一個客戶端 - 如果網格上方/下方只有一個實例,則可用URL)。

0

在radgrid控件的ItemCreated事件,您可以設置UrlToShare屬性,像這樣:

Protected Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemCreated 
     Dim RadSocialShare1 As RadSocialShare = e.Item.FindControl("RadSocialShare1") 
     If RadSocialShare1 IsNot Nothing Then 
      'In this example, "ID" is a field in the data bound to the radgrid 
      Dim myID as string = DataBinder.Eval(e.Item.DataItem, "ID") 

      'Now Make the Url 
      Dim myUrl as string = "~/page.aspx?id=" & myID 

      RadSocialShare1.UrlToShare = myUrl 
     End If 
    End Sub