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

Cell Value

2 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rhys
Top achievements
Rank 1
Rhys asked on 25 Mar 2009, 12:02 PM
Hi,

I have a RadGrid that containes a list of products that will be posted to a database.  I have also added the delete comand that removes a reow from the grid, PERFECT, now what I need to do is when I click the delete button I would like to get the value of the "lineTotal" cell so that I can remove it form the document total.

Thanx

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Mar 2009, 12:52 PM
Hi Rhys,

I hope you are trying to access the Grid cell value on clicking the Delete button. If so you can set the CommandName for the GridButtonColumn and access the cell value in the ItemCommand event as shown below.

CS:
 
 
  protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "Delete"
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            string strtxt = item["ProductName"].Text; 
        } 
    } 
 

Thanks
Shinu

0
Rhys
Top achievements
Rank 1
answered on 25 Mar 2009, 01:13 PM
Hi Shinu,

Almost there thanx.

This is what I ended up with

Protected Sub RadGridDocumentLines_DeleteCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) Handles RadGridDocumentLines.DeleteCommand  
   Dim Item As GridDataItem = e.Item  
   Dim LineTotal As String = Item("LineTotal").Text  
 
End Sub 
Tags
Grid
Asked by
Rhys
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Rhys
Top achievements
Rank 1
Share this question
or