• grideh SelectedRows Bookmark


    VCL

    grideh 选中多行 TBookmark、Bookmark、GotoBookmark

    if(DBGridEh1->SelectedRows->Count == 0 )
       DBGridEh1->SelectedRows->CurrentRowSelected = true;

     TBookmark bm=  DataSet->GetBookmark();
     DataSet->Filtered = false;
     DataSet->Filter="";
     DataSet->GotoBookmark(bm);

     TDataSet *ds =  DBGridEh1->DataSource->DataSet;

    ds->GotoBookmark((TBookmark)DBGridEh1->SelectedRows->Items[i]);
            for (int i = 0; i < DBGridEh1->SelectedRows->Count; i++)
            {
                DBGridEh1->DataSource->DataSet->GotoBookmark((TBookmark)DBGridEh1->SelectedRows->Items[i]);
                {
             ds->FieldByName("gg")->AsString.Trim()
                }
            }
        for (int i = 0; i < curGrid->SelectedRows->Count; i++)
            {
                curds->GotoBookmark((TBookmark)curGrid->SelectedRows->Items[i]);
                {
     
                }
            }

     TBookmark bm=  DataSource1->DataSet->GetBookmark();
     DataSource1->DataSet->Filtered = false;
     DataSource1->DataSet->Filter="";
       DataSource1->DataSet->GotoBookmark(bm);

     FireMonkey

    StringGrid
     Self.StringGrid1.Cells[0, Self.StringGrid1.Selected]

     FireMonkey  Grid

    Columns

    ColumnIndex

    Grid1.Columns[Grid1.ColumnIndex]

    self.Grid1.Columns[self.Grid1.ColumnIndex].Data

    直接用dataset取就可以了。

     Column.Header 列标题

    dataset.GetRow

    oRow: TFDDatSRow;

    oRow.RowID

    TField

    AFld.OldValue

    AFld.CurValue

    AFld.NewValue

    删除选中行

    DBGridEh1->SelectedRows->Delete();

      for i := 0 to DBGridEh1.SelectedRows.Count - 1 do
      begin
        DBGridEh1.DataSource.DataSet.GotoBookmark(DBGridEh1.SelectedRows.Items[i]);
      end;
  • 相关阅读:
    Luogu 5043 【模板】树同构([BJOI2015]树的同构)
    NOIP2018 解题笔记
    CF916E Jamie and Tree
    Luogu 3242 [HNOI2015]接水果
    CF570D Tree Requests
    Luogu 4438 [HNOI/AHOI2018]道路
    Luogu 4755 Beautiful Pair
    Luogu 2886 [USACO07NOV]牛继电器Cow Relays
    c# ref 的作用
    ORA-01858: 在要求输入数字处找到非数字字符
  • 原文地址:https://www.cnblogs.com/cb168/p/5153672.html
Copyright © 2020-2023  润新知