我有一個簡單的帶有Select按鈕的GridView。在我選擇一行的GridView.RowCommand事件中我想要讀取GridView.SelectedValue時,它是空的 。 GridView.SelectedValue的唯一時間值是正確的數據是當我選擇行兩次。GridView SelectedValue在選擇一行後爲null
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
code_bimehTextBox.Text = GridView1.SelectedValue.ToString();//SelectedValue is null after clicking the select button but after clicking again it works right
}
check GridViewCommandEventArgs –