Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
May 11

Written by: Steve Gray
5/11/2011 11:13 AM  RssIcon

Here is a code sample to show the use of the ComponentArt ItemCommand event

  1. Protected Sub Grid1_ItemCommand(ByVal sender As Object, ByVal e As ComponentArt.Web.UI.GridItemCommandEventArgs) Handles Grid1.ItemCommand
  2.     'there are three ways to get data from the grid:
  3.  
  4.     '1: in the Command Argument
  5.     Dim intUserID As Integer
  6.     Dim LinkButton1 As New LinkButton
  7.     'get a reference to the control
  8.     LinkButton1 = e.Control
  9.     'get the command argument
  10.     intUserID = LinkButton1.CommandArgument
  11.  
  12.     '2 from  a field in the grid
  13.     Dim strSopnumber As String
  14.     strSopnumber = e.Item("sopnumbe")
  15.  
  16.     '3 if the field is in a template, we have to search for it
  17.     'get a reference to the row number using the DataKeyField
  18.     Dim intRowID As Int16
  19.     intRowID = Me.Grid1.Items.IndexOf("rowid", e.Item("rowid"))
  20.     'We know this value, use a variable for readability
  21.     Dim intColumn As Int16
  22.     intColumn = 1
  23.  
  24.     Dim ddlNOCDMethod As DropDownList
  25.     ddlNOCDMethod = CType(Me.Grid1.FindControl(intColumn, intRowID, "ddlNOCDMethod"), DropDownList)
  26.  
  27.     Dim lblSoptype As Label
  28.     lblSoptype = CType(Me.Grid1.FindControl(intColumn, intRowID, "lblSoptpe"), Label)
  29.     Dim intSoptype As Int16
  30.     intSoptype = lblSoptype.Text
  31.  
  32. End Sub

Tags:
Categories:
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us