//remove an address that has been reached private void RouteList_CellContentClick_1(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; //makes sure the route has stops to remove if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { TTStruct.RemoveStop(e.RowIndex + 1, routeID); toSetDataTable = TTStruct.LoadRoutes(routeID); routeList.DataSource = toSetDataTable; } }
//display the current route private void displayR() { toSetDataTable = TTStruct.LoadRoutes(routeID); routeList.DataSource = toSetDataTable; CreateUnboundButtonColumn(); }