将单元格数据插入一行(从A1到An)

时间:2015-12-18 08:34:53

标签: excel sorting

我一直尝试使用谷歌(无处不在)的教程解决这个问题,但我没有找到任何答案,我希望我能在这里找到答案。

这是我的数据

private void FilterCompanyType(object sender, RoutedEventArgs e)
{
    var checkedCompanyFilters = new HashSet<string>();
    foreach (CheckBox checkBox in companyTypes.Children)
    {
        if (checkBox.IsChecked == true)
        {
            checkedCompanyFilters.Add((string)checkBox.Tag);
        }
    }

    if (subbieCheckBox.IsChecked == true)
    {
        CompanyICollectionView.Filter =
            company => checkedCompanyFilters.Contains((company as CompanyModel).Subcontractor.ToString());
    }

    if (supplierCheckBox.IsChecked == true)
    {
        CompanyICollectionView.Filter =
                company => checkedCompanyFilters.Contains((company as CompanyModel).Supplier.ToString());
    }

    if (planthireCheckBox.IsChecked == true)
    {
        CompanyICollectionView.Filter =
            company => checkedCompanyFilters.Contains((company as CompanyModel).Planthire.ToString());
    }          
}

我需要的结果:

       A        B     C
     +-------+----+-----+
  1  |  123  |  4 |  5  |
  2  |  678  |  9 | 10  |
     +-------+----+-----+

或其他顺序如:

         A     B     C
     +-------+----+-----+
  1  |  123  |    |     |
  2  |  678  |    |     |
  3  |   4   |    |     |
  4  |   5   |    |     |
  5  |   9   |    |     |
  6  |  10   |    |     |
     +-------+----+-----+

任何人都知道如何解决这个问题?

0 个答案:

没有答案