By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

Scrollable Datagrid : creating paging links dynamically outside the scroll bar

P: n/a
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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.

"RJN" wrote:
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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.