This is a migrated thread and some comments may be shown as answers.

[Solved] Style issue with Ajax

1 Answer 93 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
James Baddiley
Top achievements
Rank 1
James Baddiley asked on 01 Jul 2009, 07:57 AM
Hi,

I have a tabstrip and checkboxList and i am updating the checkboxlist when user click on any tab. i am using style on server side. When the page is loaded first time then style applies but when i click on tab then style didn't apply and when i remove the ajax on chekboxList then  style applies on postback but when i apply ajax then it didn't apply. so i think there is an issue with ajax.

My script is this:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
  <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="tabStrip1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="chkBoxList1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>


<telerik:RadTabStrip ID="tabStrip1" runat="server" CausesValidation="False"
                                    DataTextField="col1" DataValueField="col2" OnTabClick="tabStrip1_TabClick"
                                    Skin="Web20">
                                </telerik:RadTabStrip>
                                <asp:CheckBoxList ID="chkBoxList1" runat="server"
                                     DataValueField="col2"  DataTextField="col1"
                                    RepeatDirection="Horizontal">
                                </asp:CheckBoxList>


Server side code that bind the checkboxlist from the database.

chkBoxList1.DataSource = GetDatatable()
chkBoxList1.DataBind();

            foreach (System.Web.UI.WebControls.ListItem item in chkBoxList1.Items)
            {
                if (item.Text == "abc")
                {
                    item.Attributes.Add("Style", "padding-left:22px");
                }
                else if (item.Text == "abc11")
                {
                    item.Attributes.Add("Style", "padding-left:32px");
                }
                else if (item.Text == "def")
                {
                    item.Attributes.Add("Style", "padding-left:43px");
                }
                else if (item.Text == "1213")
                {
                    item.Attributes.Add("Style", "padding-left:52px");
                }
                
                item.Text = "";
            }
        }

Please tell me that how i can resolve this issue.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 06 Jul 2009, 08:30 AM
Hello William,

I reviewed the code, and the setup seems correct.
To further trace the issue, however, you can open a formal support ticket, and send us a small project sample, demonstrating your approach, along with the unwanted behavior.
We will review it locally, and advise you further.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
James Baddiley
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or