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

Stuckup in PanelBar and TabStrip integration

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aamir Ali Ansari
Top achievements
Rank 2
Aamir Ali Ansari asked on 08 Aug 2010, 09:12 AM
I am currently working on an application which will open tabs dynamically by clicking items inside panelbars. I wish to ignore few items espeicially title/group elements when clicked. When getting ID or Tab Index, I am getting same values for multiple entries. For example inside panel "Admin" bar and its first child is returning same value (0).

Furthermore I wish to add click event to an image added to tab for closing reasons. I dont want to use Tab Template feature for this. Any suggestion. My code is in following shape at present.

protected void RadPanelBar1_ItemClick(object sender, RadPanelBarEventArgs e)
   {
       RadTab NewTab = new RadTab();
       NewTab.Text = e.Item.Text;
       NewTab.ImageUrl = "images/deletecross.gif";
         
       RadTabStrip1.Tabs.Add(NewTab);
       int sel;
       sel = RadTabStrip1.Tabs.Count();
       RadTabStrip1.SelectedIndex = sel - 1;
   }

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 11 Aug 2010, 02:56 PM
Hello Aamir Ali,

You can set the Value property of the items to unique values in order to recognize them.
Regarding the other issue - you should subscribe to OnClientTabSelecting event and check whether the image is clicked:

<script type="text/javascript">       
    function tabSelecting(sender, args)
    {
        if (args.get_domEvent().target.className.indexOf("rtsImg") > -1) {
            args.set_cancel(true);
            alert("image clicked");
        }
        else
            alert("item clicked");
    }
</script>

here you can read how to remove tabs on the client.

All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Aamir Ali Ansari
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or