Welcome Guest Search | Active Topics | Sign In | Register

Grid gets error:Multiple controls with the same ID xxxxx edit:_ctl1 were found Options
chuck_farah
Posted: Tuesday, March 24, 2009 4:33:26 PM
Rank: Member
Groups: Member

Joined: 12/15/2008
Posts: 21
I get this error attempting to create new columns of datetime in the grid

Multiple controls with the same ID 'UcHostReplicationGraphs1:EOgrdReplication:edit:_ctl1' were found. Trace requires that controls have unique IDs.

i have no javascript in my usercontrol (uchostreplicationGraphs)

here is my code but not sure why i am getting this error:

Dim gCol As EO.Web.GridColumn
Dim vCol As DataColumn

'remove columns from the grid
MyGrid.Columns.Clear()

' add the columns that should always be there
Dim dgRowNumColumn As New EO.Web.CheckBoxColumn
dgRowNumColumn.Width = 30
dgRowNumColumn.AllowSort = True
dgRowNumColumn.Name = "Delete"
MyGrid.Columns.Add(dgRowNumColumn)
Dim dgTimeColumn As New EO.Web.DateTimeColumn
dgTimeColumn.Width = 150
dgTimeColumn.AllowSort = True
dgTimeColumn.Name = "Time"
dgTimeColumn.DataFormat = "{0:MM/dd/yyyy HH:mm:ss}"
'dgTimeColumn.CommandName = "cmdHost"
dgTimeColumn.DataField = "Time"
dgTimeColumn.HeaderText = "Time"
MyGrid.Columns.Add(dgTimeColumn)

Dim dgHostColumn As New EO.Web.ButtonColumn
dgHostColumn.Width = 100
dgHostColumn.AllowSort = True
dgHostColumn.Name = "Host"
dgHostColumn.CommandName = "cmdHost"
dgHostColumn.DataField = "Host"
dgHostColumn.HeaderText = "Host"
MyGrid.Columns.Add(dgHostColumn)

'now make it match the dataview add new columns from the database
Dim isFound As Boolean
Dim hLen As Integer
For Each vCol In InDV.Table.Columns
For Each gCol In MyGrid.Columns
If gCol.DataField = vCol.ColumnName Then
isFound = True
End If
Next
If Not isFound Then
'Need to add this column
Dim dType As String = vCol.DataType.FullName
Select Case dType.ToUpper
Case "SYSTEM.DATETIME"
Dim nCol As New EO.Web.DateTimeColumn
nCol.DataType = EO.Web.GridColumnDataType.DateTime
nCol.DataFormat = "{0:MM/dd/yyyy HH:mm:ss}"
nCol.DataField = vCol.ColumnName
nCol.HeaderText = vCol.ColumnName
'PubremoveUnwanted - removes any special character from the name
'i thought the error was complaining about the .name
nCol.Name = PubremoveUnwanted(vCol.ColumnName).Replace(" ", "_")
nCol.AllowSort = True
If vCol.ColumnName.IndexOf("%") > -1 Then
hLen = 10.5
Else
hLen = 7
End If
nCol.Width = (vCol.ColumnName.Length * hLen) + 3 '8 pixels a charachter
nCol.Width = 150
MyGrid.Columns.Add(nCol)
Case "SYSTEM.DOUBLE"
Dim nCol As New EO.Web.StaticColumn
'nCol.DataType = EO.Web.GridColumnDataType.Float
nCol.DataField = vCol.ColumnName
nCol.HeaderText = vCol.ColumnName
nCol.Name = PubremoveUnwanted(vCol.ColumnName).Replace(" ", "_")
nCol.AllowSort = True
If vCol.ColumnName.IndexOf("%") > -1 Then
hLen = 10.5
Else
hLen = 7
End If
nCol.Width = (vCol.ColumnName.Length * hLen) + 3 '8 pixels a charachter
MyGrid.Columns.Add(nCol)
Else
'else never is selected in my case
End Select
Else
isFound = False
End If
Next
eo_support
Posted: Tuesday, March 24, 2009 5:19:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are unable to reproduce this problem. Can you provide a repro test project?

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.