Hi Guys,
I have a RadComboBox who'se items are bound from a SQL table using "AppendDataBoundItems." When my page initially loads, the data is bound only once (as expected). Every time, however, I either run a query on the page, or hit the "Clear" button (which clears all of the fields from their selected values), this data gets appended again, & again, & again...
Scenario:
1. The page loads, and the values are appended once.
2. I run a query, and the values are appended again, showing up 2 times in the dropdown.
3. I hit the clear button, and the values are appended again, showing up 3 times in the dropdown.
All I need is for this data to be appended once (when the page initally loads), and no other times. Here's my corresponding code...
ASPX Page:
<radC:RadComboBox ID="CodeDescPermType" runat="server" DataSourceID="SqlDataSource1" AppendDataBoundItems="True"
SkinsPath="~/RadControls/ComboBox/Skins" Width="150px" DataTextField="CodeDesc" DataValueField="CodeDesc" ExpandEffect="Barn" MarkFirstMatch="True">
<Items>
<radC:RadComboBoxItem ID="RadComboBoxItem2" runat="server" Text="- Select Permit Type -" Value="- Select Permit Type -" />
</Items>
</radC:RadComboBox>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="CodeDescPermType"
ErrorMessage="* Must Select Permit Type" Operator="NotEqual" ValueToCompare="- Select Permit Type -"></asp:CompareValidator>
<asp:SqlDataSource ID="SQLDataSource1" runat="server" ConnectionString = "<%$ ConnectionStrings:BuildingInspPermits %>"
SelectCommand="SELECT [CodeDesc] FROM [BLDG_PERMIT_TYPE_CODES] "></asp:SqlDataSource>
ASPX.VB Page (That Clears the Value When the "Clear" Button's Selected):
Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
lblMsg.Text = ""
CodeDescPermType.ClearSelection()
' RadComboBoxItem2.ClearItems()
StartDate.Text = StartDate.MinDate
EndDate.Text = EndDate.MaxDate
gvRoutes.Visible = False
End Sub
I know this is terribily simple, but I just can't seem to figure it out. Any help would be greatly appreciated... Thanx!
- Tav
I have a RadComboBox who'se items are bound from a SQL table using "AppendDataBoundItems." When my page initially loads, the data is bound only once (as expected). Every time, however, I either run a query on the page, or hit the "Clear" button (which clears all of the fields from their selected values), this data gets appended again, & again, & again...
Scenario:
1. The page loads, and the values are appended once.
2. I run a query, and the values are appended again, showing up 2 times in the dropdown.
3. I hit the clear button, and the values are appended again, showing up 3 times in the dropdown.
All I need is for this data to be appended once (when the page initally loads), and no other times. Here's my corresponding code...
ASPX Page:
<radC:RadComboBox ID="CodeDescPermType" runat="server" DataSourceID="SqlDataSource1" AppendDataBoundItems="True"
SkinsPath="~/RadControls/ComboBox/Skins" Width="150px" DataTextField="CodeDesc" DataValueField="CodeDesc" ExpandEffect="Barn" MarkFirstMatch="True">
<Items>
<radC:RadComboBoxItem ID="RadComboBoxItem2" runat="server" Text="- Select Permit Type -" Value="- Select Permit Type -" />
</Items>
</radC:RadComboBox>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="CodeDescPermType"
ErrorMessage="* Must Select Permit Type" Operator="NotEqual" ValueToCompare="- Select Permit Type -"></asp:CompareValidator>
<asp:SqlDataSource ID="SQLDataSource1" runat="server" ConnectionString = "<%$ ConnectionStrings:BuildingInspPermits %>"
SelectCommand="SELECT [CodeDesc] FROM [BLDG_PERMIT_TYPE_CODES] "></asp:SqlDataSource>
ASPX.VB Page (That Clears the Value When the "Clear" Button's Selected):
Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
lblMsg.Text = ""
CodeDescPermType.ClearSelection()
' RadComboBoxItem2.ClearItems()
StartDate.Text = StartDate.MinDate
EndDate.Text = EndDate.MaxDate
gvRoutes.Visible = False
End Sub
I know this is terribily simple, but I just can't seem to figure it out. Any help would be greatly appreciated... Thanx!
- Tav