Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
830
capture data from the grid
posted

in a grid WindowsForm use this code to store a value in a cell.

if (dgBase.ActiveRow.IsDataRow && dgBase.ActiveRow.IsFilterRow == false)
                {
                    mIdScadenzaSelezionata = (int)dgBase.ActiveRow.Cells[DpScadenzarioTs.FLD_IdScadenza].Value;
                }


as you do with the WPF grid?

sorry my english.

Parents
  • 830
    Suggested Answer
    posted

    Resolved:

     

     

     

     

     

     

    private void dgBase_RecordActivated(object sender, Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs

    e)

    {

     

     

     

    // Check to make sure the selected Record is a DataRecord

     

     

     

    if (e.Record is DataRecord

    )

    {

     

     

     

    // Cast the record passed in as a DataRecord

     

     

     

    DataRecord myRecord = (DataRecord

    )e.Record;

     

     

     

    // Display the selected Records values in the appropriate

     

     

     

    // editor

     

     

     

    string MyString = myRecord.Cells["DDMedia"

    ].Value.ToString();

Reply Children
No Data