Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Command Column Click Event

$
0
0

Sorry...I formatted the code as c#...here is it formatted correctly:

 

  PrivateSubForm1_Load( sender AsObject,  e AsEventArgs) HandlesMyBase.Load
     
        'create a command column (button)
        DimcommandColumn AsNewGridViewCommandColumn()
        'name it so we cah check for it later
        commandColumn.Name = "change"
        commandColumn.UseDefaultText = False
        commandColumn.HeaderText = "Command"
        'add the button
        RadGridView1.MasterTemplate.Columns.Add(commandColumn)
        'add a column to hold price info
        DimpriceColumn AsNewGridViewTextBoxColumn()
        priceColumn.Name = "price"
        priceColumn.HeaderText = "Price"
        RadGridView1.MasterTemplate.Columns.Add(priceColumn)
        'Adds three rows of data to the grid
        radgridview1.rows.add("Add","10")
        radgridview1.rows.add("Add","13")
        radgridview1.rows.add("Add","15")
 
 
    EndSub
 
 
 
PrivateSubRadGridView1_CellClick( sender AsObject,  e AsGridViewCellEventArgs) HandlesRadGridView1.CellClick
        'everytime a cell is clicked this will run, check to see if they clicked the column named change
        if e.Column.name = "change"
            'if so then take the current row and replace the value with whatever is typed in the textbox1
            RadGridView1.mastertemplate.currentrow.cells("price").value = textbox1.text
 
        EndIf
EndSub

 


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>