Remove Row in table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PawelR

    #1

    Remove Row in table

    Hello Group,

    I've problem with remove row in table.
    I've DataTable myTable and display row this table i DataGrid (myGrid).

    DataView myView = new DataView();
    myView.Table=my Table;
    myGrid.DataSour ce=myView;

    Rows in myGrid are sorted.

    I've too button [Remove]
    My question:
    How write OnClik function for button?
    How remove selected row (selected in myGrid) from myTable?
    myTable.Rows.Re moveAt(myGrid.C urrendRowIndex) not work - index in myGrid
    and in myTable after sorted is not equal.

    Thx
    PawelR
  • Marcin Grzêbski

    #2
    Re: Remove Row in table


    You are welcome! Do us³ug! ;-)

    Marcin

    PawelR wrote:
    [color=blue]
    > Dziêki Marcin,
    > pomog³o
    >
    > Pozdrawiam Pawe³R
    >
    >
    > Marcin Grze;bski napisa³:
    >
    >[color=green]
    >>Hi PawelR,
    >>
    >>PawelR wrote:
    >>
    >>[color=darkred]
    >>>Hello Group,
    >>>
    >>>I've problem with remove row in table.
    >>>I've DataTable myTable and display row this table i DataGrid (myGrid).
    >>>
    >>>DataView myView = new DataView();
    >>>myView.Table =myTable;
    >>>myGrid.DataS ource=myView;
    >>>
    >>>Rows in myGrid are sorted.
    >>>
    >>>I've too button [Remove]
    >>>My question:
    >>>How write OnClik function for button?
    >>>How remove selected row (selected in myGrid) from myTable?
    >>>myTable.Rows .RemoveAt(myGri d.CurrendRowInd ex) not work - index in myGrid
    >>>and in myTable after sorted is not equal.[/color]
    >>
    >>try:
    >>
    >>myView.Delete ( [here: selected index from myGrid] );
    >>
    >>Regards
    >>
    >>Marcin
    >>[/color]
    >
    >[/color]

    Comment

    Working...