This is a migrated thread and some comments may be shown as answers.

Button Column

2 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Smiely
Top achievements
Rank 1
Smiely asked on 09 Nov 2010, 10:12 PM
Hi,

I have added button column to radGrid. On click,  I want to move that data to another radGrid. HOW DO I GET THAT "ON CLICK" event ?

Please help.....

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2010, 06:17 AM
Hello,


Initially, set the a custom CommandName for GridButtonColumn and you can check for the CommandName in server side ItemCommand event whether it is same. Now get the cell values by accessing the GridDataItem (code below shows how to do this).

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == "copyRow")// Check for CommandName
    {
        GridDataItem item = (GridDataItem)e.Item;
        string value1 = item["ColumnUniqueName1"].Text;
        string value2 = item["ColumnUniqueName2"].Text;
        // Create new row and add to DataTable which is DataSource of second grid
    }
}

Create new row and add to the DataTable which is set as DataSouce of second grid.



-Shinu.
0
Smiely
Top achievements
Rank 1
answered on 10 Nov 2010, 03:57 PM
THANKS A BUNCH SHINU...... it worked!!
Tags
Grid
Asked by
Smiely
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Smiely
Top achievements
Rank 1
Share this question
or