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

Custom toolbar on RadGrid - getting row

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Annette
Top achievements
Rank 1
Annette asked on 23 Mar 2011, 03:03 PM
I have a tool bar in my rad grid with an command name of "Stock".  When a user selects a row and clicks on the button, I need to get the row details.

How can I get a hold of the details for the row selected?  I do have Postback on client selecting row, but I'm not sure that is correct.

protected

 

void grdProducts_ItemCommand(object sender, GridCommandEventArgs e)

 

 

{

 

 

if (e.CommandName== "Stock")

 

 

{
????

}
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Mar 2011, 07:10 AM
Hello Annette,

The following code snippet shows how to get the details of selected row.

C#:
protected void grdProducts_ItemCommand(object sender, GridCommandEventArgs e)
    {
       if (e.CommandName == "Stock")
        {
            GridDataItem item = (GridDataItem)grdProducts.SelectedItems[0];
            string value = item["ColumnUniqueName"].Text;
        }
    }

Thanks,
Princy.
Tags
Grid
Asked by
Annette
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or