Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 02, 2012 11:13 PM by robby32
Member
122 Points
503 Posts
Apr 30, 2012 12:20 AM|LINK
Hi ,
currently i dynamically assign list items and the type is a "checkcolumn". Now each item has a checkbox and value text .
If the value text selected is "ALL" i would like to make the others non selectable or disabled ..
how can i do this if the listitems doesnt have an "enabled" property.
cheers
Star
10672 Points
2426 Posts
Apr 30, 2012 01:53 AM|LINK
Tell which control you use or show the code.
Apr 30, 2012 03:41 AM|LINK
Hi sorry for that .. here is what id do
<dx:ASPxListBox ID="lbxSunCo" runat="server" OnDataBinding="lbxSunCo_DataBinding" SelectionMode="CheckColumn" TextField="Name" ValueField="Code" ClientInstanceName="checklistBox" Width="100%" Height="140px"> <ItemStyle BackColor="White" ForeColor="Black"></ItemStyle> <ClientSideEvents SelectedIndexChanged="function(s, e) { var item = checklistBox.GetSelectedItem();CallbackPanel.PerformCallback('1');}" /> </dx:ASPxListBox>
and on the code behind id do the following
protected void ASPxCallbackPanel1_Callback(object source,DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
{
for (int i = 0; i < lbxSunCo.Items.Count; i++)
if (lbxSunCo.SelectedValues.Contains("All"))
RemoveAllItems();
RebindLbxSunCo();
break;
}
protected void RebindLbxSunCo()
lbxSunCo.Items.RemoveAt(i);
IList<IFwDatabase> sortedList = new List<IFwDatabase>();
IFwDatabase database = new FwDatabase("All", "All");
sortedList.Insert(0, database);
lbxSunCo.DataSource = sortedList;
protected void RemoveAllItems()
{ for (int i = 0; i < lbxSunCo.Items.Count; i++)
All-Star
113532 Points
12480 Posts
Microsoft
May 02, 2012 08:32 AM|LINK
Hi,
Never use this third party control. Please post the issue to its official support forum:
http://www.devexpress.com/Support/Center/
Thanks,
May 02, 2012 11:13 PM|LINK
no worries thanks for that .
robby32
Member
122 Points
503 Posts
How can i hide certain ListItems ?
Apr 30, 2012 12:20 AM|LINK
Hi ,
currently i dynamically assign list items and the type is a "checkcolumn". Now each item has a checkbox and value text .
If the value text selected is "ALL" i would like to make the others non selectable or disabled ..
how can i do this if the listitems doesnt have an "enabled" property.
cheers
basheerkal
Star
10672 Points
2426 Posts
Re: How can i hide certain ListItems ?
Apr 30, 2012 01:53 AM|LINK
Tell which control you use or show the code.
(Talk less..Work more)
robby32
Member
122 Points
503 Posts
Re: How can i hide certain ListItems ?
Apr 30, 2012 03:41 AM|LINK
Hi sorry for that .. here is what id do
<dx:ASPxListBox ID="lbxSunCo" runat="server" OnDataBinding="lbxSunCo_DataBinding" SelectionMode="CheckColumn" TextField="Name" ValueField="Code" ClientInstanceName="checklistBox" Width="100%" Height="140px"> <ItemStyle BackColor="White" ForeColor="Black"></ItemStyle> <ClientSideEvents SelectedIndexChanged="function(s, e) { var item = checklistBox.GetSelectedItem();CallbackPanel.PerformCallback('1');}" /> </dx:ASPxListBox>
and on the code behind id do the following
protected void ASPxCallbackPanel1_Callback(object source,DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
{
for (int i = 0; i < lbxSunCo.Items.Count; i++)
{
if (lbxSunCo.SelectedValues.Contains("All"))
{
RemoveAllItems();
RebindLbxSunCo();
break;
}
}
}
protected void RebindLbxSunCo()
{
for (int i = 0; i < lbxSunCo.Items.Count; i++)
{
lbxSunCo.Items.RemoveAt(i);
}
IList<IFwDatabase> sortedList = new List<IFwDatabase>();
IFwDatabase database = new FwDatabase("All", "All");
sortedList.Insert(0, database);
lbxSunCo.DataSource = sortedList;
}
protected void RemoveAllItems()
{
for (int i = 0; i < lbxSunCo.Items.Count; i++)
{
lbxSunCo.Items.RemoveAt(i);
}
}
cheers
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: How can i hide certain ListItems ?
May 02, 2012 08:32 AM|LINK
Hi,
Never use this third party control. Please post the issue to its official support forum:
http://www.devexpress.com/Support/Center/
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework
robby32
Member
122 Points
503 Posts
Re: How can i hide certain ListItems ?
May 02, 2012 11:13 PM|LINK
Hi ,
no worries thanks for that .
cheers