Friday, November 29, 2019

Getting DataKeyNames for row on button click

protected void viewHoursButton_OnClick(object sender, EventArgs e)
{
    Button btn = sender as Button;
    GridViewRow row = btn.NamingContainer as GridViewRow;
    string pk = storyGridView.DataKeys[row.RowIndex].Values[0].ToString();
    System.Diagnostics.Debug.WriteLine(pk);
}

No comments:

Post a Comment

base 64 convert to image

public Image LoadImage() {     //data:image/gif;base64,     //this image is a single pixel (black)     byte[] bytes = Convert.FromBase6...