private void variableGrid_RowsDeleted(object sender, DataGridRowsDeletedEventArgs e)
 {
     removeVarGridVariable();
 }
 private void grid_RowsDeleted(object sender, DataGridRowsDeletedEventArgs e)
 {
     txtMsg.Foreground = new SolidColorBrush(Colors.Black);
     string[] products = e.DeletedRows.Select(row => (row.DataItem as Product).ProductNumber).ToArray();
     txtMsg.Text = string.Format("Products ( {0} ) Deleted", string.Join(", ", products));
 }
        //private string datagriddelcolname;
        //private void gridControl1_DeletingRows(object sender, DataGridDeletingRowsEventArgs e)
        //{
        //    //MessageBox.Show("Dell..");
        //    datagriddelcolname = datagridrowindex; // right nowassuming single row is to be deleted
        //}

        private void gridControl1_RowsDeleted(object sender, DataGridRowsDeletedEventArgs e)
        {
            MessageBox.Show(datagridrowindex.ToString());

            IAnalyticsService analyticServ = LifetimeService.Instance.Container.Resolve<IAnalyticsService>();
            //foreach (var idx in e.DeletedRows)
            //{
            //    datagridrowindex=idx.Index;
            //    analyticServ.RemoveDatagridRow(datagridrowindex, ds.Name);//removing R side
            //}
            analyticServ.RemoveDatagridRow(datagridrowindex, ds.Name);//removing R side

            //renumbering
            renumberRowHeader(gridControl1);
            //if (gridControl1.Viewport != null)
            //{
            //    foreach (var row in gridControl1.Viewport.Rows)
            //    {
            //        UpdateRow(row);
            //    }
            //}

            //////refreshing datagrid. I guess its already been done before executing this block(in VirtualList.cs)
            //IUnityContainer container = LifetimeService.Instance.Container;
            //IDataService service = container.Resolve<IDataService>();
            //IUIController controller = container.Resolve<IUIController>();
            //controller.RefreshDataSet(ds); //LoadNewDataSet(ds);
        }