Dec 7, 2013

C# Remove A DataGridRow On Button Click

private void Tab1BtnRemove_Click(object sender, EventArgs e)
{
     int noofrows = datagridname.RowCount; //Count The Number Of Rows In The DataGrid
   
    if (noofrows != 0) //If Row Count Is Zero It Wont Make An Exception If You Use An If
    {
           int iSelectedRow;  //Create a int variable
   
           iSelectedRow = datagridname.CurrentRow.Index;
          //Get the index of the datagarid row which is selected 
 
          datagridname.Rows.RemoveAt(iSelectedRow);
          //Removes That Row From The DataGrid
    }
}

No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...