0

I have datagridview binded to database table and want to achieve some extended functionality.
In a form there is one SplitContainer and on Panel2 is placed those Datagridview.

I would like in Panel1 to get a copy of this same Datagridview to get ability to look at different areas of data. Only difference will be that in the original datagridview column headers have to be hidden and in copy datagridview have to be shown.

Actually, question is how to copy and show (existed and filled) my DataGridView1 in first panel of Split container?

I try that:

    Dim mydatagridview As DataGridView = DataGridView1
    SplitContainer1.Panel1.Controls.Add(mydatagridview)

This places actual DataGridView to Panel1 but then DataGridView in Panel2 disappears.

How to get it both for getting described scenario?

Answer:

Solution is very simple

     Dim copyDataSet As DataSet
         copyDataSet = originalDataSet.Copy()
         ''additionally filtering is possible also
         copyDataSet.Tables(0).DefaultView.RowFilter = "input_value>0"
         DataGridView2.DataSource = copyDataSet.Tables(0)
Wine Too
  • 4,515
  • 22
  • 83
  • 137
  • possible duplicate of [Binding class with master/detail into two datagridview](http://stackoverflow.com/questions/10860262/binding-class-with-master-detail-into-two-datagridview) – Bjørn-Roger Kringsjå Jan 11 '14 at 11:44
  • In my case second datagridview don't have to be binded. – Wine Too Jan 11 '14 at 11:59
  • You need to be more spesific. Please edit your question to include your data schema. – Bjørn-Roger Kringsjå Jan 11 '14 at 12:17
  • Data schema is irrelevant here. What is important is functionality of looking different area of same data. More specific, copy (clone and show in runtime) instance of filled DGV. But never mind, In waiting of more elegant solution I solved this with two DGV's added in design time. – Wine Too Jan 11 '14 at 13:07

0 Answers0