Παραεμφερές με το θέμα του τίτλου :
Ρε παιδιά δώστε μια εξήγηση,
γιατί δεν παίζει το παρακάτω γιατί έχω παρανοήσει ....
Dynamic addition : Τρία Cells (Περιγραφή, Ένα combo, και Ένας CompareValidator)
Χωρίς τον validator όλα παίζουν μια χαρά ... Αν κάνω add ένα οποιοδήποτε άλλο control δεν
έχω κανένα θέμα ... Όποιον validator δοκίμασα μου δημιούργησε πρόβλημα ...
Με validator .. Δεν μου γίνεται add παρά το πρώτο row (σίγουρα έχω παραπάνω δεν είναι data related το θέμα)
Υ.Σ.
VS 2003 + framework 1.1 (από ανάγκη)
Protected Function BuildRowFor(ByVal smeCasesLookupRow As DataRow) As HtmlTableRow
'/ ok, ftiaxnw to row ...
Dim trSMECase As New HtmlTableRow
'/ kai twra thelw 2 cells, ena me to bitCombo, ki ena me thn perigrafh
'/ ok, twra to description ...
Dim descrCell As New HtmlTableCell
descrCell.Attributes("class") = "formLabelStyle"
descrCell.InnerHtml = smeCasesLookupRow("SSE_Description")
'/ add sto row
trSMECase.Cells.Add(descrCell)
'/ Me ligh tyxh, thelw ki ena validator gia to combo ...
Dim bitComboCell As New HtmlTableCell
Dim btCombo As BitCombo = CType(Me.Page.LoadControl(Request.ApplicationPath & "/BitCombo.ascx"), BitCombo)
With btCombo
.ID = "cmb" & smeCasesLookupRow("SSEID")
.ValidatorEnabled = False '/Me.IsRequired
.ValidatorVisible = False '/Me.IsRequired
.BitComboErrorMessage = ""
End With
bitComboCell.Controls.Add(btCombo)
trSMECase.Cells.Add(bitComboCell)
Dim reqFieldCell As New HtmlTableCell
Dim reqFieldVal As CompareValidator = New CompareValidator
With reqFieldVal
.ID = "cpv" & smeCasesLookupRow("SSEID")
.ControlToValidate = "cmb" & smeCasesLookupRow("SSEID")
.Type = ValidationDataType.Integer
.ValueToCompare = 0
.Operator = ValidationCompareOperator.GreaterThan
.Display = ValidatorDisplay.Dynamic
.ErrorMessage = "ΓΑΜΩ ΤΗΝ ΑΤΥΧΙΑ ΜΟΥ"
.EnableClientScript = True
.EnableViewState = True
.Enabled = True
.Visible = True
End With
reqFieldCell.Controls.Add(reqFieldVal)
trSMECase.Cells.Add(reqFieldCell)
Return trSMECase
End Function
Πάνος Αβραμίδης