Hi,
I have a strange problem with my RadGrid. I placed to RadComboBoxes
The Logic about this to ComboBoxes is that if I select a Value from the first one, the second one will automatically filled with the values that are in context with the first one. This is the Code that is in the OnSelectedIndexChanged Method
This is working fine, but if I select for example the Value A in the first comboBox, my method will add the all the items in context with A in the second ComboBox.
Now if i open the second ComboBox see all the correct Items. At the bottom it is an Arrow for load more items.... and here is my problem. everytime when i click this arrow the items are added another time. but if i debug all my method where i have a Items.Add statement it never stops. Now i don't know where this items will bi added.
Regards
I have a strange problem with my RadGrid. I placed to RadComboBoxes
<
telerik:GridTemplateColumn
UniqueName
=
"Dossier"
SortExpression
=
"Identification"
HeaderText="<%$Resources:ESTV.A3, LabelDossier%>" DataField="Identification"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false"
ShowSortIcon="True">
<
ItemTemplate
>
<
a
href
=
"<%# Eval("
Case.Url") %>">
<%# Eval("Case.Identification") %></
a
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"comboBoxDossier"
AllowCustomText
=
"True"
EnableLoadOnDemand
=
"True"
EnableVirtualScrolling
=
"False"
AutoPostBack
=
"True"
ShowMoreResultsBox
=
"True"
CausesValidation
=
"False"
EmptyMessage="<%$Resources:ESTV.A3, MessageSearchForDossierEmpty%>" Skin="Office2010Blue"
Width="200px" MaxHeight="100px" ItemsPerRequest="50" OnItemsRequested="ComboBoxDossierItemsRequested"
OnSelectedIndexChanged="ComboBoxDossierOnSelectedIndexChanged">
</
telerik:RadComboBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidatorDossier"
runat
=
"server"
ControlToValidate
=
"comboBoxDossier"
ErrorMessage="<%$Resources:ESTV.A3, MessageMandatoryField%>"></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"Address"
SortExpression
=
"FullName"
HeaderText
=
"Adressen"
DataField
=
"FullName"
CurrentFilterFunction
=
"Contains"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"false"
ShowSortIcon
=
"True"
>
<
ItemTemplate
>
<
a
href
=
"ViewAddress.aspx?id=<%#Eval("
Address.Id") %>">
<%# Eval("Address.FullName") %>
</
a
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"comboBoxAddress"
AllowCustomText
=
"True"
EnableLoadOnDemand
=
"True"
EnableVirtualScrolling
=
"False"
AutoPostBack
=
"True"
ShowMoreResultsBox
=
"True"
CausesValidation
=
"False"
EmptyMessage="<%$Resources:ESTV.A3, MessageSearchForAddressEmpty%>" Skin="Office2010Blue"
Width="200px" MaxHeight="100px" ItemsPerRequest="50" OnItemsRequested="ComboBoxAddressItemsRequested"
OnSelectedIndexChanged="ComboBoxAddressOnSelectedIndexChanged">
</
telerik:RadComboBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidatorAddress"
runat
=
"server"
ControlToValidate
=
"comboBoxAddress"
ErrorMessage="<%$Resources:ESTV.A3, MessageMandatoryField%>"></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
The Logic about this to ComboBoxes is that if I select a Value from the first one, the second one will automatically filled with the values that are in context with the first one. This is the Code that is in the OnSelectedIndexChanged Method
AddressCaseRelationBll addressCaseRelationBll =
new
AddressCaseRelationBll();
AddressBll addressBll =
new
AddressBll();
RadComboBox comboBoxDossiers = o
as
RadComboBox;
if
(comboBoxDossiers ==
null
)
{
return
;
}
try
{
if
(
string
.IsNullOrEmpty(comboBoxDossiers.SelectedValue))
{
List<Address> addresses = addressBll.Select();
RadComboBox comboBoxAddress = (RadComboBox)
this
.radGridAddressCaseRelation.MasterTableView.GetInsertItem().FindControl(ControlAddress);
comboBoxAddress.Items.Clear();
foreach
(Address address
in
addresses)
{
comboBoxAddress.Items.Add(
new
RadComboBoxItem(
address.FullName, address.Id.ToString()));
}
}
else
{
List<AddressCaseRelation> addressCaseRelations = addressCaseRelationBll.SelectByCase(
new
Guid(comboBoxDossiers.SelectedValue));
RadComboBox comboBoxAddress = (RadComboBox)
this
.radGridAddressCaseRelation.MasterTableView.GetInsertItem().FindControl(ControlAddress);
comboBoxAddress.Items.Clear();
if
(
string
.IsNullOrEmpty(comboBoxAddress.SelectedValue))
{
foreach
(AddressCaseRelation addressCaseRelation
in
addressCaseRelations)
{
comboBoxAddress.Items.Add(
new
RadComboBoxItem(
addressCaseRelation.Address.FullName, addressCaseRelation.Address.Id.ToString()));
}
}
}
}
This is working fine, but if I select for example the Value A in the first comboBox, my method will add the all the items in context with A in the second ComboBox.
Now if i open the second ComboBox see all the correct Items. At the bottom it is an Arrow for load more items.... and here is my problem. everytime when i click this arrow the items are added another time. but if i debug all my method where i have a Items.Add statement it never stops. Now i don't know where this items will bi added.
Regards