how do i convert datagridview cell click event to DevExpress Grid Control

Rifath Apps

The program i have create for "Inventory system". And also i have create GridControl from Devexpress Tools. how do i convert this code to Devexpress gridcontrol.. please refer attached image GridControl

 private void dgvinvoicesummary_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        try
        {
            int id = e.RowIndex;
            DataGridViewRow row = dgvinvoicesummary.Rows[id];
            int ddl1 = Convert.ToInt32(row.Cells[2].Value.ToString());

            if (dgvinvoicesummary.Columns[e.ColumnIndex].Name == "Update")
            {
                invoiceSummary Obj = new invoiceSummary
                {                      
                    CustomerName = row.Cells["customerName"].Value.ToString(),
                    InvoiceID = Convert.ToInt32(row.Cells["invoiceId"].Value.ToString()),
                    IssueDate = row.Cells["issue_date"].Value.ToString(),
                    DueDate = row.Cells["due_date"].Value.ToString(),
                    Status = row.Cells["Status"].Value.ToString()

                 };
                frmAddinvoice fm = new frmAddinvoice(Obj);              
                fm.ShowDialog();
                this.Close();
                GetInvoiceSummaryData();                    
            }      
            if (dgvinvoicesummary.Columns[e.ColumnIndex].Name == "delete")
            {
                DeleteInvoiceSummaryRow(ddl1);                                    
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }
Rifath Apps

The Answer should be like this

  private void gridView1_RowCellClick(object sender, RowCellClickEventArgs e)
    {

        int id = e.RowHandle;
        DataRow row = gridView1.GetDataRow(id);
        int ddl1 = Convert.ToInt32(gridView1.GetRowCellValue(id, "invoiceId").ToString());

        if (e.Column.Name=="ActionUpdate")
        {
            invoiceSummary Obj = new invoiceSummary
               {

                   CustomerName = gridView1.GetRowCellValue(id, "customerName").ToString(),
                   InvoiceID = Convert.ToInt32(gridView1.GetRowCellValue(id,"invoiceId").ToString()),
                   IssueDate = gridView1.GetRowCellValue(id,"issue_date").ToString(),
                   DueDate = gridView1.GetRowCellValue(id,"due_date").ToString(),
                   Status = gridView1.GetRowCellValue(id,"Status").ToString(),
                   PrivateNote = gridView1.GetRowCellValue(id,"privateNotes").ToString(),
                   PadiAmount = Convert.ToDouble(gridView1.GetRowCellValue(id,"Amount_Paid").ToString()),
                   Balance = Convert.ToDouble(gridView1.GetRowCellValue(id,"Balance").ToString()),
                   PaymentType = gridView1.GetRowCellValue(id,"paymentType").ToString(),
                   DateOfPayment = gridView1.GetRowCellValue(id,"DateOfPayment").ToString(),
                   TotalDiscount = Convert.ToDouble(gridView1.GetRowCellValue(id,"TotalDiscount").ToString()),
                   PackagingAmount = Convert.ToDouble(gridView1.GetRowCellValue(id,"PackagingAmount").ToString()),
                   CustomerNote = gridView1.GetRowCellValue(id,"CustomerNote").ToString(),
                   TaxTotalAmount = Convert.ToDouble(gridView1.GetRowCellValue(id,"Tax_Amount").ToString()),
                   Valuedata = Convert.ToDouble(gridView1.GetRowCellValue(id,"Amount").ToString()),
                   TotalSubAmount = Convert.ToDouble(gridView1.GetRowCellValue(id,"Total_Amount").ToString()),

               };
            frmAddinvoice fm = new frmAddinvoice(Obj);
            fm.ShowDialog();
            this.Close();
            GetInvoiceSummaryData();
        }
        else
        {
            MessageBox.Show("");
        }


    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get DevExpress GridControl cell single click event in wpf?

From Dev

how to get cell click event in kendo grid

From Dev

How to call Datagridview cell double click event from a button?

From Dev

How to call Datagridview cell double click event from a button?

From Dev

How to get a value of a cell in datagridview devexpress

From Dev

How do I get cell row and column indexes of UWP Grid control?

From Dev

How to catch empty cell click event in KendoUI Scheduler control

From Dev

Add cell click event handler to datagridview?

From Dev

When using the Grid-view(on devexpress -visual c#), how do I get the values of four fields of a record when I click on that record/row?

From Dev

How do I display Kendo Grid inside Kendo Grid cell?

From Dev

DevExpress Get Selected Cell DataGridView

From Dev

How do I control the setInterval event?

From Dev

How do I track the old value in a datagridview cell?

From Dev

How do I track the old value in a datagridview cell?

From Dev

C#: How do I get the value of an unbound DataGridView cell?

From Dev

How do I invoke a click event with GeckoFx?

From Dev

How do I create a click event in Verold?

From Dev

How do I invoke a click event with GeckoFx?

From Dev

How do I trigger a click event on an image?

From Dev

Convert Devexpress control to UIElement

From Dev

How can I create a click event on a custom user control?

From Dev

How can I click a button to launch an ItemSelected event of spinner control?

From Dev

How to prevent auto focus of find panel in devexpress grid control

From Dev

How do i use a click function to undo a click event?

From Dev

How do i use a click function to undo a click event?

From Dev

how to change Devexpress Grid Row color without event

From Dev

How do I add image in a angular ui-grid cell

From Dev

How do I center a button in an angular-ui-grid cell?

From Dev

How do I reference a specific cell in kendo grid with javascript?

Related Related

  1. 1

    How to get DevExpress GridControl cell single click event in wpf?

  2. 2

    how to get cell click event in kendo grid

  3. 3

    How to call Datagridview cell double click event from a button?

  4. 4

    How to call Datagridview cell double click event from a button?

  5. 5

    How to get a value of a cell in datagridview devexpress

  6. 6

    How do I get cell row and column indexes of UWP Grid control?

  7. 7

    How to catch empty cell click event in KendoUI Scheduler control

  8. 8

    Add cell click event handler to datagridview?

  9. 9

    When using the Grid-view(on devexpress -visual c#), how do I get the values of four fields of a record when I click on that record/row?

  10. 10

    How do I display Kendo Grid inside Kendo Grid cell?

  11. 11

    DevExpress Get Selected Cell DataGridView

  12. 12

    How do I control the setInterval event?

  13. 13

    How do I track the old value in a datagridview cell?

  14. 14

    How do I track the old value in a datagridview cell?

  15. 15

    C#: How do I get the value of an unbound DataGridView cell?

  16. 16

    How do I invoke a click event with GeckoFx?

  17. 17

    How do I create a click event in Verold?

  18. 18

    How do I invoke a click event with GeckoFx?

  19. 19

    How do I trigger a click event on an image?

  20. 20

    Convert Devexpress control to UIElement

  21. 21

    How can I create a click event on a custom user control?

  22. 22

    How can I click a button to launch an ItemSelected event of spinner control?

  23. 23

    How to prevent auto focus of find panel in devexpress grid control

  24. 24

    How do i use a click function to undo a click event?

  25. 25

    How do i use a click function to undo a click event?

  26. 26

    how to change Devexpress Grid Row color without event

  27. 27

    How do I add image in a angular ui-grid cell

  28. 28

    How do I center a button in an angular-ui-grid cell?

  29. 29

    How do I reference a specific cell in kendo grid with javascript?

HotTag

Archive