Oct 14, 2013, 2:32 PM
[CLOSED] MultiCombo not selecting items in code behind
hi,
I am using multicombo in my application. I am trying to select some of those items from code behind, but it does not select them ( selecting menaing...want those items to be checkmarked and highlighted.) can you pls resolve this issue ?
I am binding data to it on page load.
here is the code:
-----------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
The attached screenshot shows 4 options in multicombo:
No Program, Test 1, test 2, zzzzzzz
I want test 1 and test 2 selected in multicombo, on grid row select event in Museum Projects grid.
when i try the above, still it shows the multicombo unselected with those items.., as it was on page load.
pls help me resole this asap.
Thanks,
Veda
I am using multicombo in my application. I am trying to select some of those items from code behind, but it does not select them ( selecting menaing...want those items to be checkmarked and highlighted.) can you pls resolve this issue ?
I am binding data to it on page load.
here is the code:
-----------------------
<ext:MultiCombo ID="ddlRepPrograms" runat="server" FieldLabel ="Reporting Programs"
Width="500" ValueField="REP_PROGRAM_ID" DisplayField="REP_PROGRAM_NAME" Margins="0 0 10 0">
<Store>
<ext:Store ID="StoreRepPrograms" runat="server" AutoLoad="true">
<Proxy>
<ext:AjaxProxy Json="true" Url='<%#RepProgramsUrl%>' AutoDataBind="true" >
<ActionMethods Read="POST" Create="POST"/>
<Headers>
<ext:Parameter Name="Accept" Value="application/json" />
<ext:Parameter Name="Content-Type" Value="application/json" />
</Headers>
<Reader>
<ext:JsonReader Root=""/>
</Reader>
<Writer>
<ext:JsonWriter Root="" Encode="true"/>
</Writer>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="Model5" runat="server">
<Fields>
<ext:ModelField Name="REP_PROGRAM_ID" Type="Int"/>
<ext:ModelField Name="REP_PROGRAM_NAME" Type="String"/>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:MultiCombo>
Here is the code where I am trying to highlight some of the items in multiselect combo from code behind, on a grid row select event.:---------------------------------------------------------------------------------------------------------------------------------------------------------
protected void ProjectSelect(object sender, DirectEventArgs e) // use this for populatg prj form if prj grid row is selected.
{
.
.
.
.
Dictionary<string, string>[] grid1Data = JSON.Deserialize<Dictionary<string, string>[]>(response);
if (grid1Data.Count() > 0)
{
Ext.Net.ListItem lt = new Ext.Net.ListItem();
foreach (var record in grid1Data)
{
repProgramID = (record["PROGRAM_ID"]);
object RepPgmID = Convert.ToInt32(repProgramID);
this.ddlRepPrograms.SelectedItems.Add(new Ext.Net.ListItem(record["PROGRAM_NAME"]));
}
}
else
{
this.ddlRepPrograms.Select("No Program");
}
.
.
.
.
The attached screenshot shows 4 options in multicombo:
No Program, Test 1, test 2, zzzzzzz
I want test 1 and test 2 selected in multicombo, on grid row select event in Museum Projects grid.
when i try the above, still it shows the multicombo unselected with those items.., as it was on page load.
pls help me resole this asap.
Thanks,
Veda
Last edited by Daniil; Oct 18, 2013 at 4:52 AM.
Reason: [CLOSED]