|
-
Jul 3rd, 2005, 09:40 PM
#1
Thread Starter
Junior Member
lable Question
I would like to add this code so the the label would not appeer if the rows.count was greater than = 0
HOW would i write this TO NOT be visible?? ---> lblWidth.Visible = False
===================Code that i want to add it to==============
cmdMetroSelectFauxWoodColor.Parameters("@IDProduct").Value = Request("IDProduct")
Dim dsMetroSelectFauxColor As New DataSet
Dim daMetroSelectFauxColor As New SqlDataAdapter
daMetroSelectFauxColor.SelectCommand = cmdMetroSelectFauxWoodColor
daMetroSelectFauxColor.Fill(dsMetroSelectFauxColor, "MetroSelectFauxColor")
If dsMetroSelectFauxColor.Tables("MetroSelectFauxColor").Rows.Count = 0 Then
ddlMetroSelectFauxColor.Visible = False
lblWidth.Visible = False
Else
------------------------HERE++++ HERE----------------lblWidth.Visible = False
ddlMetroSelectFauxColor.DataSource = dsMetroSelectFauxColor
ddlMetroSelectFauxColor.DataMember = "MetroSelectFauxColor"
ddlMetroSelectFauxColor.DataTextField = "AttributeName"
ddlMetroSelectFauxColor.DataValueField = "AttributeName"
lblWidth.Visible = False
End If
Thanks!
Erik...
-
Jul 4th, 2005, 08:56 AM
#2
Re: lable Question
VB Code:
If dsMetroSelectFauxColor.Tables("MetroSelectFauxColor").Rows.Count = 0 Then
ddlMetroSelectFauxColor.Visible = False
lblWidth.Visible = False
ElseIf dsMetroSelectFauxColor.Tables("MetroSelectFauxColor").Rows.Count > 0 Then
lblWidth.Visible = True
ddlMetroSelectFauxColor.DataSource = dsMetroSelectFauxColor
ddlMetroSelectFauxColor.DataMember = "MetroSelectFauxColor"
ddlMetroSelectFauxColor.DataTextField = "AttributeName"
ddlMetroSelectFauxColor.DataValueField = "AttributeName"
lblWidth.Visible = False
End If
-
Jul 5th, 2005, 04:25 PM
#3
Frenzied Member
Re: lable Question
If your label will only apear under certian condition you can set it's visible to false in the page load and only set it's vissible to true when you condition is checked and met. The only draw back here is that you will need to evaluate the condition on every poast back for it work properly. I do this for error messages and for any user info that will not be valid after a post back.....
Magiaus
If I helped give me some points.
-
Jul 5th, 2005, 04:27 PM
#4
Frenzied Member
Re: lable Question
Another option though more complex would be to have a place holder control and add you label to the control when it is needed but it's more work that it is worth in my opinion.
Magiaus
If I helped give me some points.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|