Method 'dgrdShows_ItemDataBound' cannot handle Event 'ItemDataBound' because they do not have the same signature

I added code to my code behind to automatically select the correct item in a dropdown that is in a datagrid I am getting the following error:

Method 'dgrdShows_ItemDataBound' cannot handle Event 'ItemDataBound' because they do not have the same signature.
Anyone have any ideas.

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Public Class Manage_Shows
Inherits System.Web.UI.Page
Protected WithEvents dgrdShows As System.Web.UI.WebControls.DataGrid
Dim stmSQL As String
Dim objConn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim cmdSQL As SqlCommand
Protected WithEvents lstDealers As System.Web.UI.WebControls.DropDownList
Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList
Dim ddlDataSet As DataSet = New DataSet()

#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
End If
End Sub
Sub BindDataGrid()
Dim dstShows As DataSet
Dim dadShows As SqlDataAdapter
Dim dvwShows As DataView
dstShows = New DataSet()
dadShows = New SqlDataAdapter(stmSql, objConn)
dadShows.Fill(dstShows, "Shows")
dvwShows = dstShows.Tables("Shows").DefaultView
dvwShows.Sort = "SF_BTSHOW_StartDate"
dgrdShows.DataSource = dvwShows
Session("DVCNT") = dvwShows.Count
End Sub
Function GetDealers() As DataSet
'Populate the ddlDataSet
Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter(stmSQL, objConn)
myDataAdapter.Fill(ddlDataSet, "Dealers")
Return ddlDataSet
End Function

Sub dgrdShows_EditItemCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
dgrdShows.EditItemIndex = e.Item.ItemIndex
End Sub
Sub dgrdShows_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrdShows.ItemDataBound
If e.Item.ItemType = ListItemType.EditItem Then
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim currentDealer As String = CType(drv("SF_Dealer_ID"), String)
Dim ddl As DropDownList
ddl = CType(e.Item.FindControl("DropDownList1"), DropDownList)
ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByText(currentDealer))
End If
End Sub
Sub dgrdShows_UpdateItemCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
Dim intShowID As Integer
Dim txtShowName As TextBox
Dim txtShowLocation As TextBox
Dim txtShowCity As TextBox
Dim txtShowState As TextBox
Dim txtShowStart As TextBox
Dim txtShowEnd As TextBox

Dim strShowName As String
Dim strShowLocation As String
Dim strShowCity As String
Dim strShowState As String
Dim dtShowStart As Date
Dim dtShowEnd As Date
Dim intDealerID As Integer

intShowID = dgrdShows.DataKeys(e.Item.ItemIndex)
txtShowName = e.Item.Cells(0).Controls(0)
txtShowLocation = e.Item.Cells(1).Controls(0)
txtShowCity = e.Item.Cells(2).Controls(0)
txtShowState = e.Item.Cells(3).Controls(0)
txtShowStart = e.Item.Cells(4).Controls(0)
txtShowEnd = e.Item.Cells(5).Controls(0)

strShowName = txtShowName.Text
strShowLocation = txtShowLocation.Text
strShowCity = txtShowCity.Text
strShowState = txtShowState.Text
dtShowStart = txtShowStart.Text
dtShowEnd = txtShowStart.Text
'intDealerID = lstDealers.DataValueField

stmSQL = "Update TBL_SF_BTSHOW Set SF_BTSHOW_Name=@ShowName, SF_BTSHOW_Location=@ShowLocation, SF_BTSHOW_City=@ShowCity, SF_BTSHOW_State=@ShowState, SF_BTSHOW_StartDate=@ShowStart, SF_BTSHOW_EndDate=@ShowEnd Where SF_BTSHOW_ID=@ShowID"
cmdSQL = New SqlCommand(stmSQL, objConn)
cmdSQL.Parameters.Add("@ShowName", strShowName)
cmdSQL.Parameters.Add("@ShowLocation", strShowLocation)
cmdSQL.Parameters.Add("@ShowCity", strShowCity)
cmdSQL.Parameters.Add("@ShowState", strShowState)
cmdSQL.Parameters.Add("@ShowStart", dtShowStart)
cmdSQL.Parameters.Add("@ShowEnd", dtShowEnd)
cmdSQL.Parameters.Add("@ShowID", intShowID)
'cmdSQL.Parameters.Add("@DID", intDealerID)
dgrdShows.EditItemIndex = -1
End Sub
Sub dgrdShows_CancelCommand(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
dgrdShows.EditItemIndex = -1
End Sub
End Class
9/10/2003 11:52:22 PM 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 5

I have an error which was:

Sub dgrdShows_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrdShows.ItemDataBound

Instead of

Sub dgrdShows_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgrdShows.ItemDataBound
9/11/2003 12:29:31 AM
Yep, that looks like it will fix it. Figured the problem was in your delegate but couldn't log in to point that out before you caught it.

9/11/2003 12:46:19 AM

Similar Artilces:

Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/ GranParadiso/3.0a1 From URL: Note to readers: Hendrix gives...

Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\ to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified, it calls t/uni/, that, in, (when the path separators are '\'), the $file is '..\lib\unicore\To\' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2008120122 Firefox/3.0.5 From URL: Note to readers: Hendrix gives no expectation of a response to this fee...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

Hello. I'm using defferent 5.6.0's for Win32. I wonder wheter following behaviour is intentional or not: d:\>perl -e "print 'b'..'c'" bc d:\>perl -e "print 'b'..'a'" bcdefghijklmnopqrstuvwxyz I expected empty list in latter case, like in perl -e "print 'bb'..'a'" <!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia"> &Vadim; On Wed, Sep 20, 2000 at 03:14:41PM +0400, Konovalov, Vadim wrote: > Hello. > > I'm using defferent 5.6.0'...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

'Value' should be between 'minimum' and 'maximum'.
I'm attempting to invoke with parameters:  Dim thing2 As New mydelsubPBStep(AddressOf pbStep) Me.Invoke(thing2, "setMax", dt.Rows.Count)      <---- this is where the error occurs   the delegate looks like this: Private Delegate Sub mydelsubPBStep(ByVal mode As String, ByVal value As Integer)   the function it's calling looks like this:Private Sub pbStep(ByVal mode As String, ByVal value As Integer) Select Case mode.ToLower Case "clear" ProgressBar1.Value = 0 Case "step" ProgressBar1.PerformStep() L...

EXEC sp_msforeachtable 'sp_spaceused ''?'''
What does the following SQL code mean?  EXEC sp_msforeachtable 'sp_spaceused ''?'''Johan TheunissenMCPD, MCSE, MCTS BizTalk 2006==============================Please mark the most helpful reply/replies as "Answer". JohanNL:sp_msforeachtable This is the name of the SP that resides in the master database.  This SP executes one or more commands for a table. JohanNL:sp_spaceused This is the command that you want to run for each of the tables residing in your current database.  As you might have understood so far, that this is again a...

'To', 'CC', & 'BCC'
Name: Dick Tracy Email: philipdottracyatoptusnetdotcomdotau Product: Thunderbird Summary: 'To', 'CC', & 'BCC' Comments: I have just started using Thunderbird and while I find it quite excellent- I suggest having a button to add addressees to 'BCC' as well. Currently each 'BCC' addressee has to be selected manually. I send e-mail to quite a number of people at a time and I do not wish to readily spread others addresses easily. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/2.0....

Could not find an event named 'dvProduct_ItemInserting' on associated control 'dvProduct' for the trigger in UpdatePanel 'UpdatePanel1'
 Hi i m using gridview and detailsView as parent detail for products in shopping cart.Both the controls are in the update panel ,DetailsView control include File Upload control so i write trigger in the update panel though this things i done correctly i m getting the above error.Below is my code  "UpdatePanel1" runat="server" UpdateMode="Conditional"> "grdProductList" runat="server" OnRowDeleting="grdProductList_RowDeleting" OnRowDataBound="grdProductList_RowDataBound" OnSelectedIndexC...

Could not find an event named 'SelectedIndexChanged' on associated control 'ddlist' for the trigger in UpdatePanel 'upResults'
I get the error "Could not find an event named 'SelectedIndexChanged' on associated control 'ddlist' for the trigger in UpdatePanel 'upResults'" when loading my page. This works just fine when using <asp:dropdownlist> but when I change it to my custom control <vortex:combobox> it gives the above error. Any idea why? the selectedindexchanged event does exist. Is exists, accepted, but is it tied to the dropdownlist?Thanks,MaxLet Me Google That For You! Here is where the combobox is declared along with the updatepanel:<asp:ScriptManager ID="scriptManager" runat="server">&...

Could not find control '' in ControlParameter ''
Hello All I have a repeater with controls, some draw from different SqlDatasources. Everything loads up properly, I click my update button and then I get the error: "Could not find control 'txtProjectName' in ControlParameter 'projectName'" The Control txtProjectName is in the repeater <itemTemplate> <asp:TextBox ID="txtProjectName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "projectName") %>' /> My Datasource that I want to update looks like this:  <asp:SqlDataSource ID="dsEditProject" runat="server" ConnectionString="<%$ ConnectionString...

Web resources about - Method 'dgrdShows_ItemDataBound' cannot handle Event 'ItemDataBound' because they do not have the same signature -

Resources last updated: 11/30/2015 1:30:20 AM