data grid with allowPaging and selectedItemStyle problem

I have a datagrid with both AllowPaging="true" and a custom selectedItemStyle defined:


<asp:DataGrid
id="dgBasketList"
runat="server"
DataKeyField="basketName" AllowPaging="True"
AutoGenerateColumns="False"
AlowPaging="true"
onPageIndexChanged="dgBasketList_PageChanger">

<SelectedItemStyle
backcolor="#FF8080">
</SelectedItemStyle>

<AlternatingItemStyle
backcolor="#80FF80">
</AlternatingItemStyle>

<ItemStyle
font-size="XX-Small"
font-names="Verdana">
</ItemStyle>

<HeaderStyle
font-size="Small"
font-names="Microsoft Sans Serif"
font-bold="True"
forecolor="White"
backcolor="Green">
</HeaderStyle>

<Columns>
<asp:ButtonColumn
DataTextField="basketName"
HeaderText="Basket Name"
CommandName="Select">
</asp:ButtonColumn>
</Columns>

<PagerStyle
font-size="XX-Small"
font-names="Arial"
font-bold="True"
horizontalalign="Right"
pagebuttoncount="4"
mode="NumericPages">
</PagerStyle>

</asp:DataGrid>


whats interesting is that when I turn the page on the datagrid, the SelectedItemStyle follows over to the next page. How do I reset the datagrid to "Nothing Selected" on the dgBasketList_PageChanger event? What would be cool is if I could change to the next page and have nothing selected then change back to the page where the selected item resides and have the SelectedItemStyle reapllied. Anyone else seen this?

dog

hu, good thing I don't have smilies turned on on my web server, I'm afeered none of my asp.net code would work too well.set the selectedIndex to -1 in the paging sub

Ericthanks eric, much appreciated. it worked.
 
Back
Top