Rechercher et afficher le max

Fermé
billou2 Messages postés 1 Date d'inscription lundi 5 mai 2014 Statut Membre Dernière intervention 5 mai 2014 - Modifié par billou2 le 5/05/2014 à 15:17
Bonjou/Bonsoir à Tous ! J'aimerai savoir comment faire pour rechercher le Max dans un datagridview et puis l'afficher dans un autre . en effet j'ai importé un fichier Excel dans un datagridview et j'aimerai affiché la cellule où se trouve le max, dans un autre datagridview ! merci d'avance

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.OleDb;



namespace monpfe
{
public partial class vlanform : Form
{
public vlanform()
{
InitializeComponent();
}

private void button2_ouvrirvlan_Click(object sender, EventArgs e)
{
this.timer1.Start();

string PathConn = @"Provider = Microsoft.Jet.OLEDB.4.0; Data Source=" + textBox_path.Text + "; Extended Properties =\"Excel 8.0; HDR=Yes;\";";
OleDbConnection conn = new OleDbConnection(PathConn);

OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(" Select * from [" + comboBox1_sheet.Text + "$]", conn);
DataTable dt = new DataTable();

myDataAdapter.Fill(dt);

dataGridView1.DataSource = dt;



}

private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Increment(1);

}

private void button1_vlan_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();

if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
this.textBox_path.Text = openFileDialog1.FileName;
}

}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}



}
}