Insert val from other form to dataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a question..
In a windows datagrid and when I make a DoubleClick in a cell another form opens, and then I want to chose a value and return' it to the cell where I did the DoubleClick..
How can I receive the value and put it in the cell

Thaks for your help
Bernardo
 
Bernardo,

On the other form that displays the value, place a property or method on
it that will return the value selected. I would assume that you are showing
the dialog with the list modally, so when the form is closed and control
returns to the double-click event handler, you can just get the selected
value from the form through the property or method you defined.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Bernardo said:
Hi,

I have a question...
In a windows datagrid and when I make a DoubleClick in a cell another form
opens, and then I want to chose a value and return' it to the cell where I
did the DoubleClick...
 
Hi,

A helper question - how well are you experienced in Windows Forms data
binding? I believe the best way would be to retrieve a value corresponding
to the cell selected in the secondary grid and then update the value
corresponding to the cell currently selected in the primary grid. Both the
retrieval and the update should be performed on the data sources the grids
are bound to, not on the grids themselves.

But you might do away with manipulating the Item indexers on the grids as
well. This would be much simplier, as you will be able to use CurrentCell
property's Row and Column to index directly into the Item[...]. But I am not
so sure about how reliable and technically correct this way is though.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Bernardo said:
Hi,

I have a question...
In a windows datagrid and when I make a DoubleClick in a cell another form
opens, and then I want to chose a value and return' it to the cell where I
did the DoubleClick...
 
Back
Top