Example #1
0
        private void CompleteSelected()
        {
            var rows = gridView.GetSelectedRows();

            if (rows.Length > 0)
            {
                this.SelectedItem = gridView.GetRow(rows[0]);
            }
            else
            {
                this.SelectedIndex = -1;
            }
        }
Example #2
0
        private void BorrarFilasSeleccionadas(DevExpress.XtraGrid.Views.Grid.GridView view)
        {
            if (view == null || view.SelectedRowsCount == 0)
            {
                return;
            }

            DataRow[] rows = new DataRow[view.SelectedRowsCount];

            for (int i = 0; i < view.SelectedRowsCount; i++)
            {
                rows[i] = view.GetDataRow(view.GetSelectedRows()[i]);
            }

            view.BeginSort();

            try
            {
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }
            finally
            {
                view.EndSort();
            }
        }
Example #3
0
        private void CNT_DAHIL_Click(object sender, EventArgs e)
        {
            int index = xtraTabControl_MASTER_MNG_DETAY.SelectedTabPageIndex;
            var rtb   = xtraTabControl_MASTER_MNG_DETAY.TabPages[index].Controls[0];

            DevExpress.XtraGrid.GridControl         grd_ = (DevExpress.XtraGrid.GridControl)rtb;
            System.Data.DataView                    RW   = (System.Data.DataView)grd_.DataSource;
            DevExpress.XtraGrid.Views.Grid.GridView GR   = (DevExpress.XtraGrid.Views.Grid.GridView)grd_.MainView;



            int[] GETROW = GR.GetSelectedRows();
            if (GR.RowCount > 0)
            {
                for (int i = 0; i < GETROW.Length; i++)
                {
                    DataRow dr = GR.GetDataRow(Convert.ToInt32(GETROW[i]));
                    if (GR.Columns["DAHIL_HARIC"] != null)
                    {
                        dr["DAHIL_HARIC"] = "Dahil";
                    }
                }
            }

            //   GR.EndUpdate();
            //   GR.RefreshData();
        }