This is a migrated thread and some comments may be shown as answers.

[Solved] Removing PageSize Elements and setting MouseOver on Pager (page links)

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 03 Sep 2009, 04:36 PM
I am having a problem removing the PageSize label and combobox.  I stepped through the code and found that:

e.Item.Controls(0).Controls(0).Controls(0).Controls(0).Controls(3).Visible = False

works (sort of)... Then some research online I found that:

e.Item.FindControl("ChangePageSizeLabel").Visible = False
e.Item.FindControl("PageSizeComboBox").Visible = False

Works as well.  The problem is that when I click to change the page (with ajax) the code no longer works.  I was able to remove using CSS but Something else I am doing is setting a mouse over on each page button.  This works, but not with ajax postback.  Stepping through the code, I set the tooltip on the button the same for page load and ajax postback but it appears that pager changes do not take affect for ajax partial page rendering.  Sniffing the packets I see the update panel updating the radgrid but the <a> tags do not have a title like they do in the original page load.


UPDATE: I turned off Ajax and found that it is NOT Ajax it is postback period.

1 Answer, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 03 Sep 2009, 04:50 PM
If anyone is interested, here is the code to set pager items 1, 2, 3 etc... with a tooltip:

Private Sub gvPreview_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gvPreview.ItemDataBound
 Select Case e.Item.ItemType
  Case GridItemType.Pager
   If gvPreview.PageCount > 1 Then
    For Each ctl As Control In e.Item.Controls(0).Controls(0).Controls(0).Controls(0).Controls(1).Controls
     Select Case ctl.GetType.Name
      Case "GridLinkButton"
       Dim lnk As LinkButton = ctl
       Try
        lnk.ToolTip = gvPreview.DataSource(i)("FileName")
       Catch ex As Exception
        HandleError(ex, "Error Default.aspx->Create Mouse Over")
       End Try
     End Select
     i += 1
    Next
   End If
 End Select
End Sub

PS why does "Format Code Block" not work. I get a blank RadWindow.
Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
Share this question
or