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

Alpha Paging Problem

2 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Samantha
Top achievements
Rank 1
Samantha asked on 12 Aug 2008, 11:06 AM
I'm trying to replicate the example shown here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/AlphabeticPaging/DefaultCS.aspx

[code]

protected

void grdGlossary_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)

{

if (e.Item is GridPagerItem)

{

GridPagerItem pagerItem = (e.Item as GridPagerItem);
pagerItem.PagerContentCell.Controls.Clear();

for (int i = 65; i < 65 + 25; i++)

{

LinkButton linkButton1 = new LinkButton();
LiteralControl lc = new LiteralControl("&nbsp;&nbsp;");
linkButton1.Text =
"" + (char)i;
linkButton1.CommandName =
"alpha";
linkButton1.CommandArgument =
"" + (char)i;
pagerItem.PagerContentCell.Controls.Add(linkButton1);
pagerItem.PagerContentCell.Controls.Add(lc);

}

LiteralControl lcLast = new LiteralControl("&nbsp;");
pagerItem.PagerContentCell.Controls.Add(lcLast);
LinkButton linkButtonAll = new LinkButton();
linkButtonAll.Text =
"All";
linkButtonAll.CommandName =
"NoFilter";
pagerItem.PagerContentCell.Controls.Add(linkButtonAll);

}

}

protected void grdGlossary_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

String value = null;
switch (e.CommandName)

{

case ("alpha"):
{

value =

string.Format("{0}%", e.CommandArgument);
break;

}

case ("NoFilter"):
{

value =

"%";
break;

}

}

sqlGlossary.SelectParameters[

"PageLetter"].DefaultValue = value;
grdGlossary.Rebind();

}

[code]

[code]

<

telerik:RadGrid ID="grdGlossary" runat="server" AllowPaging="True" DataSourceID="sqlGlossary"

GridLines="None" OnItemCommand="grdGlossary_ItemCommand" OnItemCreated="grdGlossary_ItemCreated"

PageSize="20" Skin="Vista">

<PagerStyle AlwaysVisible="True" Mode="NextPrevAndNumeric" />

<MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="sqlGlossary"

GridLines="None">

<RowIndicatorColumn>

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<ExpandCollapseColumn>

<HeaderStyle Width="20px"></HeaderStyle>

</ExpandCollapseColumn>

<Columns>

<telerik:GridBoundColumn DataField="Term" HeaderText="Term" SortExpression="Term"

UniqueName="Term">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="Definition" HeaderText="Definition" SortExpression="Definition"

UniqueName="Definition">

</telerik:GridBoundColumn>

</Columns>

</MasterTableView>

<FilterMenu EnableTheming="True">

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

</FilterMenu>

</telerik:RadGrid>

<asp:Label ID="lblGlossaryFilter" runat="server" Visible="false" Text="%"></asp:Label>

<asp:SqlDataSource ID="sqlGlossary" runat="server" ConnectionString="<%$ ConnectionStrings:XX %>"

SelectCommand="GetGlossaryAll" SelectCommandType="StoredProcedure">

<SelectParameters>
<asp:Parameter Name="PageLetter" DefaultValue="%" />
</SelectParameters>
<SelectParameters>
</asp:SqlDataSource>

[/code]

The initial page with "A" selected loads fine.  However, when I click on any of the other page letters the grid does not rebind.  Any ideas?

2 Answers, 1 is accepted

Sort by
0
Samantha
Top achievements
Rank 1
answered on 13 Aug 2008, 06:47 PM
Anyone?
0
Yavor
Telerik team
answered on 15 Aug 2008, 07:44 AM
Hello Samantha,

As shown in the example, if properly implemented, the sample should load other pages as well.
If the issue is persisting at your end, please open a formal support ticket, and send us a small working project, incorporating your logic, and displaying the unwanted behavior.
We will review it locally, and advise you further.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Samantha
Top achievements
Rank 1
Answers by
Samantha
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or