PDA

View Full Version : [CLOSED] Clear the selected fields in MultiCombo



ucaneto
Apr 30, 2015, 3:10 PM
Hello


I'm using MultiCombo and would like to when use the first time is correct as IMG123944, when I use it again accumulates on the screen the data as img223945, as do I clean the MultiCombo?


Already I tried with the codes.



cmbProcuracao.ClearValue();


Tks

Ulisses

Daniil
Apr 30, 2015, 5:40 PM
Hi @ucaneto,

A MultiCombo's ClearValue appears to be working in the test case below. Please provide your test case.

Example

<%@ Page Language="C#" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.MultiCombo1.GetStore();
store.DataSource = new object[]
{
new object[] { "1", "Item 1" },
new object[] { "2", "Item 2" },
new object[] { "3", "Item 3" }
};
}
}

protected void Clear(object sender, DirectEventArgs e)
{
this.MultiCombo1.ClearValue();
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="Clear" OnDirectClick="Clear" />

<ext:MultiCombo
ID="MultiCombo1"
runat="server"
DisplayField="text"
ValueField="value">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="value" />
<ext:ModelField Name="text" />
</Fields>
</ext:Model>
</Model>
<Reader>
<ext:ArrayReader />
</Reader>
</ext:Store>
</Store>
</ext:MultiCombo>
</form>
</body>
</html>

ucaneto
Apr 30, 2015, 8:43 PM
I managed using well


cmbProcuracao.SelectedItems.Clear();
cmbProcuracao.UpdateSelectedItems();


Please close the Post

Ulisses