469,138 Members | 1,251 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,138 developers. It's quick & easy.

Remove an item from a checkboxlist.

I am loading the 5 checkboxlist from a database. I have 5 lists. The first
four are interior, exterior, safety and drive train. The fifth is optional
options. It is possible the optional option was already selected, if it was
selected it would be in one of the first four (interior, exterior, safety and
drive train). What I am doing is loading the fifth checkboxlist and then
checking to see if it was selected if so, I am trying to remove it from the
fifth checkboxlist. This is my code.
This first four are
CREATE PROCEDURE Get_A_Vin_A_CarOptions_by_type
@Vin Nvarchar(50),
@IdTypeOption int

as

SELECT Options.IdTypeOption, Options.PrintDescription, Options.IDOption
FROM VinNumber INNER JOIN
Options ON VinNumber.VINOption =
Options.OptionDescription AND VinNumber.VINValue = Options.OptionValue
WHERE VinNumber.VIN = @Vin AND (VinNumber.VINOption NOT LIKE 'decoded'
+ '%') AND (VinNumber.VINOption NOT LIKE 'DataOne' + '%')
AND (VinNumber.VINOption NOT LIKE 'vinSquish' + '%')
AND (NOT (Options.PrintDescription IS NULL)) and Options.IdTypeOption
=@IdTypeOption
ORDER BY Options.PrintDescription
GO

The fifth one is
CREATE PROCEDURE Get_A_Vin_A_CarOptions
@Vin Nvarchar(50)

as

SELECT Options.IdTypeOption, Options.PrintDescription, Options.IDOption
FROM VinNumber INNER JOIN
Options ON VinNumber.VINOption =
Options.OptionDescription AND VinNumber.VINValue = Options.OptionValue
WHERE VinNumber.VIN = @Vin AND (VinNumber.VINOption NOT LIKE 'decoded'
+ '%') AND (VinNumber.VINOption NOT LIKE 'DataOne' + '%')
AND (VinNumber.VINOption NOT LIKE 'vinSquish' + '%')
AND (NOT (Options.PrintDescription IS NULL))
ORDER BY Options.IdTypeOption, Options.PrintDescription
GO

Editoptionalsselected.DataSource =
optionsfile.GetACarOptionoptionals(DataTableCars.R ows(0)("VinNumber"))
Editoptionalsselected.CellPadding = 5
Editoptionalsselected.DataTextField = "PrintDescription"
Editoptionalsselected.DataValueField = "IDOption"
Editoptionalsselected.RepeatColumns = 5
Editoptionalsselected.RepeatDirection = RepeatDirection.Horizontal
Editoptionalsselected.CssClass = "CartListItem"
Editoptionalsselected.BackColor = Yellow

If DataTableCars.Rows(0)("IdCar") > 0 Then
OptionsSelected =
optionsfile.GetACarOptions(DataTableCars.Rows(0)(" IdCar"))
While OptionsSelected.Read()
selected = OptionsSelected.Item("IdOption")
Editoptionalsselected.Items.Remove(selected)
End While
End If
Editoptionalsselected.DataBind()


Jul 21 '05 #1
0 4417

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Scott | last post: by
7 posts views Thread by localhost | last post: by
1 post views Thread by Ryan Scully | last post: by
reply views Thread by Stanley J Mroczek | last post: by
5 posts views Thread by stephen | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.