Scrollable Datagrid : creating paging links dynamically outside the scroll bar

  • Thread starter Thread starter RJN
  • Start date Start date
R

RJN

Hi

Sorry for posting again.

I have a datagrid which is put inside a div tag to make it scrollable. I
need to page the datagrid. The page numbers appear at the bottom of the
datagrid and has to be scrolled down completely to see the page number
links. The page number should always be visible outside the scroll bar.
Basically I want to create the paging links dynamically and on click of
this it should fire PageIndexChanged event.


For this I introduce a table below the datagrid and this table will have
all the paging links.

In the ItemCreated event of the datagrid, I get the control collection
of the paging links and add it to the table.

If e.Item.ItemType = ListItemType.Pager Then
Dim i As Int16
For i = 0 To e.Item.Controls(0).Controls.Count - 1
--Create a new link button
--Get the e.Item.Controls(0).Controls(i) and assign
its properties to link button
--Add the link button to the table
Next
End if

Now I need to assign the events to the new paging links created. It
should fire PageIndexChanged event.

To do this , in the ItemDataBound event I add the
Page.GetPostBackClientHyperlink to the link button .

But in ItemDataBound I'm not able to execute the statements within the
below if condition.
If e.Item.ItemType = ListItemType.Pager

End if

This statement is not executed at all.

Any help is appreciated.

Regards

RJN
 
Hi,

Instead of placing the statements in ItemBound event, place them in
OnPreRender event. Because, OnPreRender event is th one which is called
before returning the HTML content to the client.
 
Back
Top