public dashboard() { InitializeComponent(); panel1.Hide(); panel2.Hide(); Voyage_Data_Grid.Hide(); }
private void guna2Button1_Click(object sender, EventArgs e) { Voyage_Data_Grid.Show(); guna2Button2.Visible = true; //getting the data from the textboxes string state = statetxtbox.Text; string city = citytxtbox.Text; //Creating the instance of the service proxy VoyageClient.VoyageDataSerrviceClient dataProxy = new VoyageClient.VoyageDataSerrviceClient(); //getting the result from the service int results = dataProxy.getResultNumber(state, city); //getting the content from the service VoyageClient.ImageDataContent[] imageDataContents = dataProxy.getImageDataContent(state, city, results); Voyage_Data_Grid.DataSource = imageDataContents; Voyage_Data_Grid.AutoResizeColumns(); Voyage_Data_Grid.AutoResizeRows(); //Voyage_Data_Grid.Columns.Add("UserId", "Number"); //Voyage_Data_Grid.Columns.Add("firstName", "First Name"); //Voyage_Data_Grid.Columns.Add("lastName", "Last Name"); //Voyage_Data_Grid.Columns.Add("VoyageContent", "User Thoughts"); //Voyage_Data_Grid.Columns.Add("imageData", "User Uploaded Photos"); //for(int i = 0; i < results; i++) //{ // DataGridViewImageColumn imageColumn = new DataGridViewImageColumn(); // imageColumn.Image = Bitmap.FromStream(new MemoryStream(imageDataContents[i].imageData)); // Voyage_Data_Grid.Rows.Add(new Object[] { i + 1, imageDataContents[i].firstName, imageDataContents[i].lastName, imageDataContents[i].VoyageContent, imageColumn }); //} //Voyage_Data_Grid.AutoResizeRows(); //Voyage_Data_Grid.AutoResizeColumns(); }