DataGrid Pager customization

J

James T.

Hello!

I am using following code to customize DataGrid Pager. It works fine...
My question is, how I can replace"&nbsp" with " | " between each LinkButton
control?

Thanks!
James

Dim pager As TableCell
Dim wc As WebControl
Dim cnt As Integer
pager = e.Item.Controls(0)
Dim lnk As LinkButton
Dim lt As Literal

If e.Item.ItemType = ListItemType.Pager Then

pager = e.Item.Controls(0)
pager.HorizontalAlign = Horizontallign.Center

For cnt = 0 To pager.Controls.Count - 1 Step 2
wc = pager.Controls(cnt)

If wc.GetType.ToString() =
"System.Web.UI.WebControls.DataGridLinkButton" Then

CType(wc, LinkButton).Text = "[" & CType(wc, LinkButton).Text & "]"
CType(wc, LinkButton).ForeColor = Drawing.Color.Orange

Else

CType(wc, Label).Text = CType(wc, Label).Text
CType(wc, Label).Font.Bold = True
CType(wc, Label).ForeColor = Drawing.Color.Orange

End If

Next

End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top