B
Brian K. Williams
I am attempting to use the SelectedIndexChanged to detect when a row has
been selected. I have seen many examples where they are writing all the code
on the ASPX page.
When I attempt to use the SelectedIndexChanged on the Code Behind it never
fires.
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////
The CodeBehind:
public void dbGridPlayers_SelectedIndexChanged(object sender,
System.EventArgs e){
playerInfo.Text = dbGridPlayers.SelectedItem.Cells[1].Text;
}
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////
The APSX Code:
<asp
ataGrid id="dbGridPlayers" runat="server"
OnSelectedIndexChanged="dbGridPlayers_SelectedIndexChanged"
DataKeyField="PlayerID" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" BackColor="White" CellPadding="3" CellSpacing="0"
Width="100%">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#669999"></SelectedItemStyle>
<ItemStyle ForeColor="#000066" CssClass="ItemRow"
Font-Name="Arial" Font-Size="9"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#006699" Font-Name="Arial" Font-Size="10"></HeaderStyle>
<FooterStyle ForeColor="#000066"
BackColor="White"></FooterStyle>
<PagerStyle HorizontalAlign="Left" ForeColor="#000066"
BackColor="White" Mode="NumericPages"></PagerStyle>
</asp
ataGrid>
Thanks for any help.
Brian K. Williams
been selected. I have seen many examples where they are writing all the code
on the ASPX page.
When I attempt to use the SelectedIndexChanged on the Code Behind it never
fires.
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////
The CodeBehind:
public void dbGridPlayers_SelectedIndexChanged(object sender,
System.EventArgs e){
playerInfo.Text = dbGridPlayers.SelectedItem.Cells[1].Text;
}
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////
The APSX Code:
<asp
OnSelectedIndexChanged="dbGridPlayers_SelectedIndexChanged"
DataKeyField="PlayerID" BorderColor="#CCCCCC" BorderStyle="None"
BorderWidth="1px" BackColor="White" CellPadding="3" CellSpacing="0"
Width="100%">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#669999"></SelectedItemStyle>
<ItemStyle ForeColor="#000066" CssClass="ItemRow"
Font-Name="Arial" Font-Size="9"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White"
BackColor="#006699" Font-Name="Arial" Font-Size="10"></HeaderStyle>
<FooterStyle ForeColor="#000066"
BackColor="White"></FooterStyle>
<PagerStyle HorizontalAlign="Left" ForeColor="#000066"
BackColor="White" Mode="NumericPages"></PagerStyle>
</asp
Thanks for any help.
Brian K. Williams