Intellisense tells me that selected gets or sets the property.
RadTabStrip1.Tabs.FindTabByText("File").Selected = True
RadTabStrip1.Tabs.FindTabByText("Edit").Selected =
True
For some reason it is not finding the sub tab "Edit" of the parent "File".
26 Answers, 1 is accepted
You could use the following code to set the tab with text "Tab1" to be selected on PageLoad:
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadTab tab1 = RadTabStrip1.Tabs.FindTabByText(
"Tab1"
);
tab1.Selected =
true
;
}
Best wishes,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Dim
tab1
As
Telerik.Web.UI.RadTab = RadTabStrip1.Tabs.FindTabByText(
"Reporting"
)
tab1.Selected =
True
Dim
tab2
As
Telerik.Web.UI.RadTab = RadTabStrip1.Tabs.FindTabByText(
"Scheduling"
)
tab2.Selected =
True
I also tried the following with no luck:
For
Each
item
As
Telerik.Web.UI.RadTab
In
RadTabStrip1.Tabs.FindTabByText(
"Reporting"
).Controls
If
item.Text =
"Scheduling"
Then
item.Selected =
True
End
If
Next
You can set the Value property of the different tabs and then in code behind you can find them using FindTabByValue():
Dim
tab1
As
RadTab = RadTabStrip1.FindTabByValue(
"1"
)
Dim
childtab
As
RadTab = tab1.Tabs.FindTabByValue(
"3"
)
tab1.Selected =
True
childtab.Selected =
True
here is the markup:
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Corporate"
Value
=
"1"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"About us"
Value
=
"2"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"News"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Team"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Careers"
Value
=
"3"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Services"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Products"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Solutions"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Certifications"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
Kind regards,
Kate
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

The method you suggested does not work for me. I keep getting the "Object reference not set to an instance of an object" error.
However I was able to solve this problem by looping the child tabs of the parent tab:
RadTabStrip1.Tabs.FindTabByText(rootMenu).Selected =
True
For
Each
item
As
Telerik.Web.UI.RadTab
In
RadTabStrip1.Tabs.FindTabByText(rootMenu).Controls
If
item.Text = subMenu
Then
item.Selected =
True
item.PageView.Selected =
True
End
If
Next

For some reason, the Selected="True" keep changed by itself when I run on the server. I don't know why?
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
BorderStyle="None" Font-Size="Medium" Skin="Vista" Height="19px"
Width="100%" CausesValidation="False" AutoPostBack="True" Align="Justify"
ReorderTabsOnSelect="True" SelectedIndex="2" >
<Tabs>
<telerik:RadTab Text="A" SelectedIndex="0" PageViewID="RadPageView1" Selected="True">
</telerik:RadTab>
<telerik:RadTab Text="B" SelectedIndex="1" PageViewID="RadPageView2">
</telerik:RadTab>
<telerik:RadTab Text="C" SelectedIndex="2"
PageViewID="RadPageView3" >
</telerik:RadTab>
<telerik:RadTab Text="D" SelectedIndex="3" PageViewID="RadPageView4">
</telerik:RadTab>
<telerik:RadTab Text="E" SelectedIndex="4" PageViewID="RadPageView5">
</telerik:RadTab>
<telerik:RadTab Text="F" SelectedIndex="5" PageViewID="RadPageView6" >
</telerik:RadTab>
<telerik:RadTab Text="G" SelectedIndex="6" PageViewID="RadPageView7">
</telerik:RadTab>
<telerik:RadTab Text="H" SelectedIndex="7"
PageViewID="RadPageView8" IsBreak="true" >
</telerik:RadTab>
<telerik:RadTab Text="I" SelectedIndex="8" PageViewID="RadPageView9">
</telerik:RadTab>
<telerik:RadTab Text="J" SelectedIndex="9" PageViewID="RadPageView10">
</telerik:RadTab>
<telerik:RadTab Text="K" SelectedIndex="10" PageViewID="RadPageView11">
</telerik:RadTab>
<telerik:RadTab Text="L" SelectedIndex="11" PageViewID="RadPageView12">
</telerik:RadTab>
<telerik:RadTab Text="M" SelectedIndex="12" PageViewID="RadPageView13">
</telerik:RadTab>
<telerik:RadTab Text="N" SelectedIndex="13" PageViewID="RadPageView14">
</telerik:RadTab>
<telerik:RadTab Text="O" SelectedIndex="14" PageViewID="RadPageView15">
</telerik:RadTab>
<telerik:RadTab Text="P" SelectedIndex="15" PageViewID="RadPageView16" >
</telerik:RadTab>
<telerik:RadTab Text="Q" SelectedIndex="16" PageViewID="RadPageView17"
>
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
I tested the code that you describe but all seems to be working as expected from my side. Can you please clarify what you mean by saying that "the Selected="True" keep changed by itself when I run on the server."? Can you also clarify the steps needed to replicate the exact behavior that you observe from your side?
Regards,
Kate
the Telerik team


Thanks.
As you see,
1, first, I set <telerik:RadTab Text="A" SelectedIndex="0" PageViewID="RadPageView1" Selected="True">
</telerik:RadTab>
2, Put publish to server.
3, I check my asp page after I runs the project for few times. I found my set <telerik:RadTab Text="A" SelectedIndex="0" PageViewID="RadPageView1" > </telerik:RadTab>, the Selected="True" is gone. and the change to <telerik:RadTab Text="G" SelectedIndex="6" PageViewID="RadPageView7" Selected="True"> </telerik:RadTab>.or <telerik:RadTab Text="I" SelectedIndex="8" PageViewID="RadPageView9" Selected="True"></telerik:RadTab>
I think maybe the SelectedIndex cause this problem.

Your problem is most likely all of those SelectedIndex="1" properties.... remove all of them except for the one you are selecting as true. Meaning the first one.
Try this: Let me know if this works out for you...
<
telerik:radtab
text
=
"A"
selectedindex
=
"0"
pageviewid
=
"RadPageView1"
selected
=
"True"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"B"
pageviewid
=
"RadPageView2"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"C"
pageviewid
=
"RadPageView3"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"D"
pageviewid
=
"RadPageView4"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"E"
pageviewid
=
"RadPageView5"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"F"
pageviewid
=
"RadPageView6"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"G"
pageviewid
=
"RadPageView7"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"H"
pageviewid
=
"RadPageView8"
isbreak
=
"true"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"I"
pageviewid
=
"RadPageView9"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"J"
pageviewid
=
"RadPageView10"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"K"
pageviewid
=
"RadPageView11"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"L"
pageviewid
=
"RadPageView12"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"M"
pageviewid
=
"RadPageView13"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"N"
pageviewid
=
"RadPageView14"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"O"
pageviewid
=
"RadPageView15"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"P"
pageviewid
=
"RadPageView16"
>
</
telerik:radtab
>
<
telerik:radtab
text
=
"Q"
pageviewid
=
"RadPageView17"
>
</
telerik:radtab
>

Another question is, I look the link
http://demos.telerik.com/aspnet-ajax/dock/examples/portalpage/defaultvb.aspx?#qsf-demo-source
But, I can find all the controls code. Where are they?
<%@ Register Src="~/Dock/Common/TelerikNews.ascx" TagName="News" TagPrefix="uc2" %>
<%@ Register Src="~/Dock/Common/TelerikBlogs.ascx" TagName="Blogs" TagPrefix="uc2" %>
<%@ Register Src="~/Dock/Common/HoroscopesCS.ascx" TagName="Horoscopes" TagPrefix="uc2" %>
<%@ Register Src="~/Dock/Common/WeatherCS.ascx" TagName="Weather" TagPrefix="uc2" %>
<%@ Register Src="~/Dock/Common/ExchangeRatesCS.ascx" TagName="ExchangeRates" TagPrefix="uc2" %>
In general the user controls that you refer to are not relevant to the demo and therefore their code is not place on the on-line demo. However, with the default installation of our controls you should have installed our on-line demos locally on your machine. The default location where you can find the demo and the relevant code would be C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q2 2012 SP2\Live Demos\Dock\Common.
Greetings,
Kate
the Telerik team

<telerik:RadTab Text="CAMS/FEDS/BEDS/IPV" PageViewID="RadPageView8" IsBreak="true" Selected="True">
Please help me find way.
Thanks.
I have been testing the code that you provided but could not replicate the issue that you describe. Since I am not quite sure what I am missing in your scenario I would kindly ask you to record a video (you can use Jing for instance) demonstrating how you get the issue - the steps needed for replicating the behavior locally?
Greetings,
Kate
the Telerik team

Got a question about how to change a RADToolStrp tab name and getting it to display...I have
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Default" CssClass="TabStrip" MultiPageID="RadMultiPage1" OnTabClick="RadTabStrip1_TabClick" OnClientTabSelected="RadTabStrip1_TabClick" AutoPostBack="true"> <Tabs> <telerik:RadTab Text="Quick List" PageViewID="RadPageView1" Selected="false"></telerik:RadTab> <telerik:RadTab Text="My Network" PageViewID="RadPageView2" Selected="true"></telerik:RadTab> <telerik:RadTab Text="Administer My Hobnob Network" PageViewID="RadPageView3" Selected="false" ></telerik:RadTab> </Tabs> </telerik:RadTabStrip>Thanks
I can change the tab name, but it won't display until I click on another tab.
What do I have to do to get it to display while on the same tab?
Christopher Zei

Try the following code snippet to achieve your scenario.
ASPX:
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
Skin
=
"Default"
CssClass
=
"TabStrip"
AutoPostBack
=
"true"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Quick List"
Selected
=
"false"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"My Network"
Selected
=
"true"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Administer My Hobnob Network"
Selected
=
"false"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
OnClick
=
"Button1_Click"
/>
C#:
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadTab tab = (RadTab)RadTabStrip1.FindTabByText(
"My Network"
);
tab.Text =
"New Text"
;
}
Please elaborate your scenario if it doesn't helps.
Regards,
Princy.

I can see the new tab name in the right place in QuickWatch, so I know the RADTab got changed. Is there a refresh method (i didn't see one)

Unfortunately I was not able to replicate the issue that you are facing. I tried to replicate the issue in the telerik version 2012, 3, 1016, 35 but no avail. Please make sure that you are using the latest version of telerik controls.
Please provide your full code if it doesn't helps.
Regards,
Princy.


code behind file:connectionList.cs
-----------------------------------------------
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; using System.Data.SqlClient; using System.Configuration; using Telerik.Web.UI; using HobnobLib; using CommonLib; namespace HobnobWeb { public partial class ConnectionList : System.Web.UI.Page { private HobnobLib.Person m_Person; private static List<Person> m_ListQuickList = null; private static List<Person> m_ListMine = null; private static List<Person> m_ListAll = null; private List<int> m_LastTabGrpIdList = new List<int> {0, 0, 0, 0}; private int m_AddToQuickListIndex = 2; private int m_GroupDDLIndex = 9; private int m_iterations = 0; protected void Page_Load(object sender, EventArgs e) { if (Session["Person"] == null) { // Session timeout Session.Add("Error", "Session expired."); string myURL = ConfigurationManager.AppSettings["HobnobFrontURLTimeout"]; Response.Redirect(myURL, true); return; } else { m_Person = ((Person)Session["Person"]); } //get tabs last selected groups if (Session["LastTabGrpIdList"] != null) m_LastTabGrpIdList = (List<int>)Session["LastTabGrpIdList"]; if (m_LastTabGrpIdList[1] == 0) m_LastTabGrpIdList[1] = m_Person.GroupList[0].Id; if (m_LastTabGrpIdList[2] == 0) m_LastTabGrpIdList[2] = m_Person.GroupList[0].Id; // //Save LastTabNGroupId Session["LastTabGrpIdList"] = m_LastTabGrpIdList; //add tab event handler RadTabStrip1.TabClick += new RadTabStripEventHandler(RadTabStrip1_TabClick); //configure RadGrids ConfigureGrid(RadGrid1); ConfigureGrid(RadGrid2); ConfigureGrid(RadGrid3); if (!Page.IsPostBack) { //It's the first time here LoadGroupDDL(); PopulateTab2(); } if (RadTabStrip1.SelectedIndex == 2) { //hide my default group ShowDefaultGroupButton(false); } else if (RadTabStrip1.SelectedIndex == 3) { ShowDefaultGroupButton(true); } //SetTabText(); } /// <summary> /// Show or hide my default group button... /// Show all groups on "My Network" (Tab 1) and /// Hide my default groups on the "Administered Group (Tab 2) /// because default groups are not administered by me /// </summary> /// <param name="p_isVisible"></param> private void ShowDefaultGroupButton(bool p_Show) { //hide groups not administered by me HobnobLib.Group myGroup; if (RadToolBar1.Items.FindItemByText("Groups") != null) { m_GroupDDLIndex = RadToolBar1.Items.FindItemByText("Groups").Index; int myVisibleBtnCnt = ((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).Buttons.Count; for (int i = 0; i <= ((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).Buttons.Count - 1; i++) { myGroup = new HobnobLib.Group(Convert.ToInt32(((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).Buttons[i].Value)); if (myGroup.Owner.Id != m_Person.Id) { ((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).Buttons[i].Visible = p_Show; if (!p_Show)myVisibleBtnCnt--; } } if (myVisibleBtnCnt > 10) myVisibleBtnCnt = 10; ((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).DropDownHeight = 20 * myVisibleBtnCnt + 10; } } private void LoadGroupDDL() { //remove all RadToolBarDropDown.RadToolBarButtons if (RadToolBar1.Items.FindItemByText("Groups") != null) { m_GroupDDLIndex = RadToolBar1.Items.FindItemByText("Groups").Index; ((RadToolBarDropDown)RadToolBar1.Items[m_GroupDDLIndex]).Buttons.Clear(); } //create a list to store Group //so they can be sorted before they are added to myDropDown List<HobnobLib.Group> myGroupList = new List<HobnobLib.Group>(); // //create a RadToolBarDropDown RadToolBarDropDown myDropDown = new RadToolBarDropDown(); myDropDown.Text = "Groups"; myDropDown.ExpandDirection = ToolBarDropDownExpandDirection.Down; myDropDown.DropDownHeight = 300; myDropDown.DropDownWidth = 250; RadToolBarButton myButton = new RadToolBarButton(); //find groups that I own foreach (HobnobLib.Group grp in HobnobLib.Group.SELECTGroupByOwnerId(m_Person.Id)) { if (grp.GroupName.StartsWith("My")) grp.GroupName = "!" + grp.GroupName; myGroupList.Add(grp); } if (m_Person.GroupPersonList.Count > 0) { //find groups that I'm a member foreach (HobnobLib.GroupPerson grp in m_Person.GroupPersonList) { if (grp.Person.Id == grp.Group.Owner.Id) continue; if (grp.Group.GroupType == (int)HobnobLib.Group.GroupTypeEnum.DefaultType) continue; switch (grp.Group.GroupType) { case (int)HobnobLib.Group.GroupTypeEnum.PublicType: myGroupList.Add(grp.Group); break; case (int)HobnobLib.Group.GroupTypeEnum.PrivateType: myGroupList.Add(grp.Group); break; case (int)HobnobLib.Group.GroupTypeEnum.SharedType: myGroupList.Add(grp.Group); break; } } if (myGroupList.Count > 0) { //sort the groups by name HobnobLib.Group.SortBy(Convert.ToInt16(HobnobLib.Group.SortByEnum.GroupName)); myGroupList.Sort(); // //add the group names to myDropDown foreach (HobnobLib.Group grp in myGroupList) { myButton = this.NewRadToolBarButton(); myButton.Text = grp.GroupName.TrimStart('!'); myButton.Value = grp.Id.ToString(); myDropDown.Buttons.Add(myButton); } } } if (myDropDown.Buttons.Count > 0) { //set myDropDown dimensions myDropDown.DropDownHeight = myDropDown.Buttons.Count * 23; RadToolBar1.Items.Add(myDropDown); } } private void SetTabText() { for (int i = 1; i < RadTabStrip1.Tabs.Count; i++) { RadTab myTab = (RadTab)RadTabStrip1.Tabs[i]; if (m_LastTabGrpIdList[i] <= 0) { myTab.Text = (i == 1 ? "My Network" : "Administer My Network"); } else { HobnobLib.Group myGroup = new HobnobLib.Group(m_LastTabGrpIdList[i]); myTab.Text = (i == 1 ? @myGroup.GroupName : "Administer " + @myGroup.GroupName); } } } protected RadToolBarButton NewRadToolBarButton() { RadToolBarButton myButton = new RadToolBarButton(); //myButton.BackColor = System.Drawing.Color.Yellow; myButton.Width = 250; return myButton; } /// <summary> /// Configure the RadGrid here so the configuration is the /// same for each grid /// </summary> /// <param name="p_RadGrid"></param> public void ConfigureGrid(RadGrid p_RadGrid) { p_RadGrid.Skin = "Windows7"; p_RadGrid.CssClass = "RadGrid"; p_RadGrid.EnableViewState = true; p_RadGrid.PageSize = 50; p_RadGrid.AllowPaging = true; p_RadGrid.AllowSorting = true; p_RadGrid.AllowMultiRowEdit = false; p_RadGrid.AllowMultiRowSelection = false; //turn on column filtering and make it case insensitive p_RadGrid.AllowFilteringByColumn = true; p_RadGrid.GroupingSettings.CaseSensitive = false; p_RadGrid.AutoGenerateColumns = false; p_RadGrid.EnableHeaderContextMenu = true; p_RadGrid.GridLines = GridLines.Both; p_RadGrid.ClientSettings.AllowColumnHide = true; p_RadGrid.ClientSettings.AllowColumnsReorder = false; p_RadGrid.ClientSettings.EnableAlternatingItems = true; p_RadGrid.ClientSettings.Resizing.AllowColumnResize = true; p_RadGrid.ClientSettings.Scrolling.AllowScroll = true; p_RadGrid.ClientSettings.Scrolling.UseStaticHeaders = true; p_RadGrid.ClientSettings.Scrolling.SaveScrollPosition = true; p_RadGrid.ClientSettings.Scrolling.FrozenColumnsCount = 3; p_RadGrid.ClientSettings.Selecting.AllowRowSelect = false; //With client-side caching enabled RadGrid will store the start row index, maximum rows, //sorting and filtering expressions and will retrieve them from the cache automatically //on subsequent client-side refreshes. So this data will not be transferred between //the client and the server which will save bandwidth and loading time when the grid is //rebound on the client. //also set p_RadGrid.ClientSettings.DataBinding.SelectMethod to the method used to //populate the grid, in this case PopulateTab? p_RadGrid.ClientSettings.DataBinding.EnableCaching = true; p_RadGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; p_RadGrid.PagerStyle.AlwaysVisible = true; p_RadGrid.HeaderStyle.CssClass = "RadGridHeaderStyle"; p_RadGrid.HeaderStyle.Font.Bold = true; p_RadGrid.HeaderStyle.Wrap = true; p_RadGrid.HeaderStyle.HorizontalAlign = HorizontalAlign.Left; p_RadGrid.ItemStyle.CssClass = "RadGridItemStyle"; p_RadGrid.ItemStyle.BackColor = System.Drawing.Color.White; p_RadGrid.ItemStyle.Wrap = false; //p_RadGrid.SelectedItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#9E9E9E"); p_RadGrid.AlternatingItemStyle.CssClass = "RadGridItemStyle"; p_RadGrid.AlternatingItemStyle.BackColor = System.Drawing.ColorTranslator.FromHtml("#D6EBF5"); p_RadGrid.MasterTableView.DataKeyNames = new string[] { "Id" }; p_RadGrid.MasterTableView.ClientDataKeyNames = new string[] { "Id" }; p_RadGrid.MasterTableView.CssClass = "RadGrid"; //p_RadGrid.MasterTableView.EditMode = GridEditMode.InPlace; p_RadGrid.MasterTableView.NoMasterRecordsText = "No records to display"; p_RadGrid.MasterTableView.NoDetailRecordsText = "No records to display"; //add the grid event handlers switch (p_RadGrid.ID) { case "RadGrid1": p_RadGrid.PageIndexChanged += new GridPageChangedEventHandler(RadGrid1_PageIndexChanged); p_RadGrid.PageSizeChanged += new GridPageSizeChangedEventHandler(RadGrid1_PageSizeChanged); p_RadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource); p_RadGrid.ClientSettings.DataBinding.SelectMethod = "PopulateTab1"; break; case "RadGrid2": p_RadGrid.PageIndexChanged += new GridPageChangedEventHandler(RadGrid2_PageIndexChanged); p_RadGrid.PageSizeChanged += new GridPageSizeChangedEventHandler(RadGrid2_PageSizeChanged); p_RadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid2_NeedDataSource); p_RadGrid.ClientSettings.DataBinding.SelectMethod = "PopulateTab2"; break; case "RadGrid3": p_RadGrid.PageIndexChanged += new GridPageChangedEventHandler(RadGrid3_PageIndexChanged); p_RadGrid.PageSizeChanged += new GridPageSizeChangedEventHandler(RadGrid3_PageSizeChanged); p_RadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid3_NeedDataSource); p_RadGrid.ClientSettings.DataBinding.SelectMethod = "PopulateTab3"; break; default: break; } } private void ConfigureGridColumns(RadGrid p_RadGrid) { //If on the Quick List tab, hide the QuickList column switch (p_RadGrid.ID) { case "RadGrid1": p_RadGrid.Columns.FindByUniqueName("QuickList").Display = false; break; default: p_RadGrid.Columns.FindByUniqueName("QuickList").Display = true; break; } switch (p_RadGrid.ID) { case "RadGrid1": case "RadGrid2": p_RadGrid.Columns.FindByUniqueName("MemberName").Display = true; p_RadGrid.Columns.FindByUniqueName("CompanyName").Display = true; p_RadGrid.Columns.FindByUniqueName("Address1").Display = true; p_RadGrid.Columns.FindByUniqueName("City").Display = true; p_RadGrid.Columns.FindByUniqueName("State").Display = true; p_RadGrid.Columns.FindByUniqueName("PostalCode").Display = true; p_RadGrid.Columns.FindByUniqueName("Comments").Display = true; p_RadGrid.Columns.FindByUniqueName("County").Display = false; p_RadGrid.Columns.FindByUniqueName("Country").Display = false; p_RadGrid.Columns.FindByUniqueName("DateAdded").Display = false; //order the columns p_RadGrid.Columns.FindByUniqueName("SelectCheckBox").OrderIndex = 0; p_RadGrid.Columns.FindByUniqueName("QuickList").OrderIndex = 1; p_RadGrid.Columns.FindByUniqueName("MemberName").OrderIndex = 2; p_RadGrid.Columns.FindByUniqueName("CompanyName").OrderIndex = 3; p_RadGrid.Columns.FindByUniqueName("Address1").OrderIndex = 4; p_RadGrid.Columns.FindByUniqueName("City").OrderIndex = 5; p_RadGrid.Columns.FindByUniqueName("State").OrderIndex = 6; p_RadGrid.Columns.FindByUniqueName("PostalCode").OrderIndex = 7; p_RadGrid.Columns.FindByUniqueName("County").OrderIndex = 8; p_RadGrid.Columns.FindByUniqueName("Country").OrderIndex = 9; p_RadGrid.Columns.FindByUniqueName("Comments").OrderIndex = 10; p_RadGrid.Columns.FindByUniqueName("DateAdded").OrderIndex = 11; //Set the widths of the column and filter p_RadGrid.Columns.FindByUniqueName("SelectCheckBox").HeaderStyle.Width = 40; p_RadGrid.Columns.FindByUniqueName("QuickList").HeaderStyle.Width = 40; p_RadGrid.Columns.FindByUniqueName("MemberName").HeaderStyle.Width = 150; p_RadGrid.Columns.FindByUniqueName("MemberName").FilterControlWidth = Unit.Pixel(110); p_RadGrid.Columns.FindByUniqueName("CompanyName").HeaderStyle.Width = 200; p_RadGrid.Columns.FindByUniqueName("CompanyName").FilterControlWidth = Unit.Pixel(160); p_RadGrid.Columns.FindByUniqueName("Address1").HeaderStyle.Width = 150; p_RadGrid.Columns.FindByUniqueName("Address1").FilterControlWidth = Unit.Pixel(110); p_RadGrid.Columns.FindByUniqueName("City").HeaderStyle.Width = 100; p_RadGrid.Columns.FindByUniqueName("City").FilterControlWidth = Unit.Pixel(60); p_RadGrid.Columns.FindByUniqueName("State").HeaderStyle.Width = Unit.Pixel(80); p_RadGrid.Columns.FindByUniqueName("State").FilterControlWidth = Unit.Pixel(40); p_RadGrid.Columns.FindByUniqueName("PostalCode").HeaderStyle.Width = Unit.Pixel(100); p_RadGrid.Columns.FindByUniqueName("PostalCode").FilterControlWidth = Unit.Pixel(60); p_RadGrid.Columns.FindByUniqueName("County").HeaderStyle.Width = 100; p_RadGrid.Columns.FindByUniqueName("County").FilterControlWidth = Unit.Pixel(60); p_RadGrid.Columns.FindByUniqueName("Country").HeaderStyle.Width = 80; p_RadGrid.Columns.FindByUniqueName("Country").FilterControlWidth = Unit.Pixel(40); p_RadGrid.Columns.FindByUniqueName("Comments").HeaderStyle.Width = 250; p_RadGrid.Columns.FindByUniqueName("Comments").FilterControlWidth = Unit.Pixel(210); break; case "RadGrid3": p_RadGrid.Columns.FindByUniqueName("MemberName").Display = true; p_RadGrid.Columns.FindByUniqueName("CompanyName").Display = true; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedMTD").Display = true; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedLastMonth").Display = true; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedOnAVG").Display = true; p_RadGrid.Columns.FindByUniqueName("DateAdded").Display = false; //order the columns p_RadGrid.Columns.FindByUniqueName("SelectCheckBox").OrderIndex = 0; p_RadGrid.Columns.FindByUniqueName("QuickList").OrderIndex = 1; p_RadGrid.Columns.FindByUniqueName("MemberName").OrderIndex = 2; p_RadGrid.Columns.FindByUniqueName("CompanyName").OrderIndex = 3; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedMTD").OrderIndex = 4; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedLastMonth").OrderIndex = 5; p_RadGrid.Columns.FindByUniqueName("LeadsCreatedOnAVG").OrderIndex = 6; p_RadGrid.Columns.FindByUniqueName("DateAdded").OrderIndex = 7; //Set the widths of the column and filter p_RadGrid.Columns.FindByUniqueName("SelectCheckBox").HeaderStyle.Width = Unit.Pixel(40); p_RadGrid.Columns.FindByUniqueName("QuickList").HeaderStyle.Width = Unit.Pixel(40); p_RadGrid.Columns.FindByUniqueName("MemberName").HeaderStyle.Width = Unit.Pixel(150); p_RadGrid.Columns.FindByUniqueName("MemberName").FilterControlWidth = Unit.Pixel(110); p_RadGrid.Columns.FindByUniqueName("CompanyName").HeaderStyle.Width = 200; p_RadGrid.Columns.FindByUniqueName("CompanyName").FilterControlWidth = Unit.Pixel(160); p_RadGrid.Columns.FindByUniqueName("LeadsCreatedMTD").HeaderStyle.Width = Unit.Pixel(100); p_RadGrid.Columns.FindByUniqueName("LeadsCreatedLastMonth").HeaderStyle.Width = Unit.Pixel(120); p_RadGrid.Columns.FindByUniqueName("LeadsCreatedOnAVG").HeaderStyle.Width = Unit.Pixel(120); break; } p_RadGrid.Columns.FindByUniqueName("DateAdded").HeaderStyle.Width = 120; p_RadGrid.Columns.FindByUniqueName("DateAdded").FilterControlWidth = Unit.Pixel(80); //Telerik GridBoundColumn controls that contain hyperlinks cannot be filtered. The solution is to use the //GridHyperLinkColumn control and set DataNavigateUrlFields="Id" and DataNavigateUrlFormatString = [Name of Entity].UrlFormatString ((GridHyperLinkColumn)p_RadGrid.Columns.FindByUniqueName("MemberName")).DataNavigateUrlFields = new string[] { "Id" }; ((GridHyperLinkColumn)p_RadGrid.Columns.FindByUniqueName("MemberName")).DataNavigateUrlFormatString = HobnobLib.Person.UrlFormatString(); ((GridHyperLinkColumn)p_RadGrid.Columns.FindByUniqueName("CompanyName")).DataNavigateUrlFields = new string[] { "Company.Id" }; ((GridHyperLinkColumn)p_RadGrid.Columns.FindByUniqueName("CompanyName")).DataNavigateUrlFormatString = HobnobLib.Company.UrlFormatString(); } /// <summary> /// Enable/disable RadToolBar1 buttons /// </summary> /// <param name="p_Enable"></param> private void EnableCmdButtons(bool p_Enable) { //refresh RadToolBar1.Items[0].Enabled = p_Enable; // //add to quickList RadToolBar1.Items[2].Enabled = p_Enable; // //remove from quickList RadToolBar1.Items[4].Enabled = p_Enable; // //invite RadToolBar1.Items[6].Enabled = p_Enable; // //delete group member RadToolBar1.Items[8].Enabled = !p_Enable; } /// <summary> /// load all Persons on m_Person's Connection Quick List into RadGrid 1 /// </summary> [WebMethod(EnableSession = true)] private void PopulateTab1() { try { EnableCmdButtons(true); //clear grid RadGrid1.DataSource = null; RadMultiPage1.SelectedIndex = 0; ConfigureGridColumns(RadGrid1); //get all Quick List items for m_Person //List<HobnobLib.ConnectionQuickList> myQuickListConnections = HobnobLib.ConnectionQuickList.SELECTConnectionQuickListByOwnerId(m_Person.Id); //get only the active members List<HobnobLib.ConnectionQuickList> myQuickListConnections = HobnobLib.ConnectionQuickList.GETActiveConnectionQuickByOwnerId(m_Person.Id); m_ListQuickList = new List<HobnobLib.Person>(); //create a list of Quick List items foreach (HobnobLib.ConnectionQuickList ql in myQuickListConnections) { HobnobLib.Person myPerson = (HobnobLib.Person)ql.ListObject; myPerson.SetIsQuickList(m_Person.Id, "Connection"); m_ListQuickList.Add(myPerson); } if (m_ListQuickList.Count > 1) { HobnobLib.Person.SortBy(Convert.ToInt16(HobnobLib.Person.SortByEnum.LastNameFirst)); m_ListQuickList.Sort(); } RadGrid1.DataSource = m_ListQuickList; } catch (Exception ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } } /// <summary> /// load all of m_Person's connections into RadGrid 2 /// </summary> [WebMethod(EnableSession = true)] private void PopulateTab2() { try { EnableCmdButtons(true); //clear grid RadGrid2.DataSource = null; // new string[] { }; RadMultiPage1.SelectedIndex = 1; ConfigureGridColumns(RadGrid2); // //get all active persons in the selected group m_ListMine = new List<HobnobLib.Person>(); // //display the last group selected... Session[" m_LastTabGrpIdList"] = m_LastTabGrpIdList; // //if the group selected was my default group...then display my entire network bool isMyHobnobNetwork = (m_LastTabGrpIdList[1] == m_Person.GroupList[0].Id ? true : false); switch (isMyHobnobNetwork) { case true: //find everyone in my Network m_ListMine = GetAllMbrsOfMyNetwork(); break; default: //display only the members of the selected group foreach (HobnobLib.GroupPerson guy in new HobnobLib.Group(m_LastTabGrpIdList[1]).GroupPersonList) { if (guy.Person.isActive && guy.Person.Id != m_Person.Id) m_ListMine.Add(guy.Person); } break; } if (m_ListMine.Count > 1) { //get rid of dups m_ListMine = (List<HobnobLib.Person>)m_ListMine.GroupBy(i => i.Id, (key, group) => group.First()).ToList(); //sort the list m_ListMine.Sort((m1, m2) => m1.LastNameFirst.CompareTo(m2.LastNameFirst)); } RadGrid2.DataSource = m_ListMine; //// ////change tab text //HobnobLib.Group mySelectedGroup = new HobnobLib.Group(m_LastTabGrpIdList[1]); //RadTab myTab = (RadTab)RadTabStrip1.Tabs[1]; //if (mySelectedGroup == null || mySelectedGroup.Id == -99) //{ // myTab.Text = "My Network"; //} //else //{ // myTab.Text = @mySelectedGroup.GroupName; //} //myTab.Selected = true; } catch (Exception ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } finally { m_iterations++; } } /// <summary> /// load all of m_Person's connections into RadGrid 2 /// </summary> [WebMethod(EnableSession = true)] private void PopulateTab3() { try { EnableCmdButtons(false); m_ListAll = new List<HobnobLib.Person>(); HobnobLib.Group mySelectedGroup = new HobnobLib.Group(); //clear grid RadGrid3.DataSource = null; RadMultiPage1.SelectedIndex = 2; ConfigureGridColumns(RadGrid3); // //save the last group selected... Session[" m_LastTabGrpIdList"] = m_LastTabGrpIdList; mySelectedGroup = new HobnobLib.Group(m_LastTabGrpIdList[2]); // //if m_SelectedGroupId = 0 display my default group bool isMyHobnobNetwork = (m_LastTabGrpIdList[2] == m_Person.GroupList[0].Id ? true : false); switch (isMyHobnobNetwork) { case true: m_ListAll = GetAllMbrsOfMyNetwork(); break; default: //only display groups administered by me if (mySelectedGroup.Owner.Id == m_Person.Id) { //get all active persons in the selected group foreach (HobnobLib.GroupPerson guy in mySelectedGroup.GroupPersonList) { if (guy.Person.isActive && guy.Person.Id != m_Person.Id) m_ListAll.Add(guy.Person); } } else { //group not administred by me...display default group m_ListAll = GetAllMbrsOfMyNetwork(); mySelectedGroup = m_Person.GroupList[0]; m_LastTabGrpIdList[2] = mySelectedGroup.Id; } break; } if (m_ListAll.Count > 1) { //get rid of dups m_ListAll = (List<HobnobLib.Person>)m_ListAll.GroupBy(i => i.Id, (key, group) => group.First()).ToList(); //sort the list m_ListAll.Sort((m1, m2) => m1.LastNameFirst.CompareTo(m2.LastNameFirst)); } RadGrid3.DataSource = m_ListAll; //// ////change tab text //RadTab myTab = (RadTab)RadTabStrip1.Tabs[3]; //if (mySelectedGroup == null || mySelectedGroup.Id == -99) //{ // myTab.Text = "Administer My Network"; //} //else //{ // myTab.Text = "Administer " + @mySelectedGroup.GroupName; //} //myTab.Selected = true; //myTab.SelectedIndex = 3; } catch (Exception ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } } private List<Person> GetAllMbrsOfMyNetwork() { List<Person> myList = new List<Person>(); //find everyone in my Network if (m_Person.GroupPersonList.Count > 0) { //first find all the groups that I'm a member foreach (HobnobLib.GroupPerson grp in HobnobLib.GroupPerson.SELECTGroupPersonByPersonId(m_Person.Id)) { HobnobLib.Group myGroup = HobnobLib.Group.SelectById(grp.Group.Id); //then find all the members of each of those groups...excluding me foreach (HobnobLib.GroupPerson guy in myGroup.GroupPersonList) { if (!guy.Person.isActive) continue; if (guy.Person.Id == m_Person.Id) continue; switch (guy.Group.GroupType) { case (int)HobnobLib.Group.GroupTypeEnum.DefaultType: if (guy.Group.Owner.Id != m_Person.Id) continue; myList.Add(guy.Person); break; case (int)HobnobLib.Group.GroupTypeEnum.PublicType: myList.Add(guy.Person); break; case (int)HobnobLib.Group.GroupTypeEnum.PrivateType: myList.Add(guy.Person); break; case (int)HobnobLib.Group.GroupTypeEnum.SharedType: myList.Add(guy.Person); break; } } } } // //add the member of my default group.,.excluding me foreach (HobnobLib.GroupPerson guy in m_Person.GroupList[0].GroupPersonList) { if (guy.Person.isActive && guy.Person.Id != m_Person.Id) myList.Add(guy.Person); } return myList; } /// <summary> /// handle RadTabStrip1_TabClick event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e) { //if (e.Tab.Index == RadTabStrip1.SelectedTab.Index) return; switch (e.Tab.Index) { case 0: //Quick List RadToolBar1.Items[m_AddToQuickListIndex].Enabled = false; RadToolBar1.Items[RadToolBar1.Items.Count - 1].Enabled = false; PopulateTab1(); RadGrid1.DataBind(); break; case 1: //Groups RadToolBar1.Items[m_AddToQuickListIndex].Enabled = true; RadToolBar1.Items[RadToolBar1.Items.Count - 1].Enabled = true; PopulateTab2(); RadGrid2.DataBind(); break; case 2: //Administered Groups RadToolBar1.Items[m_AddToQuickListIndex].Enabled = true; RadToolBar1.Items[RadToolBar1.Items.Count - 1].Enabled = true; PopulateTab3(); RadGrid3.DataBind(); break; default: break; } } /// <summary> /// handle RadToolBar1_ButtonClick event... /// all items in the RadToolBar, including separatorBars, are indexed (zero-based) /// item[1] is a separatorBars /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e) { try { //if the group or Administered tab is currently selected... //check group ddl, e.Item.Value is the selected value if (e.Item.Value != string.Empty && RadTabStrip1.SelectedIndex > 0) { if (Convert.ToInt32(e.Item.Value) != -99) { switch (RadTabStrip1.SelectedIndex) { case 1: m_LastTabGrpIdList[1] = Convert.ToInt32(e.Item.Value); PopulateTab2(); RadGrid2.DataBind(); SetTabText(); break; case 2: m_LastTabGrpIdList[2] = Convert.ToInt32(e.Item.Value); PopulateTab3(); RadGrid3.DataBind(); SetTabText(); break; } return; } } switch (e.Item.Index) { case 0: //Refresh the grid switch (RadMultiPage1.SelectedIndex) { case 0: PopulateTab1(); RadGrid1.DataBind(); break; case 1: PopulateTab2(); RadGrid2.DataBind(); break; case 2: PopulateTab3(); RadGrid3.DataBind(); break; } break; case 2: //Add to Quick List switch (RadMultiPage1.SelectedIndex) { case 0: //Nothing to do break; case 1: foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid2.MasterTableView.Items) { System.Web.UI.WebControls.CheckBox mySelectCheckBox = (CheckBox)dataItem.FindControl("ckbSelect"); if (mySelectCheckBox.Checked) { System.Web.UI.WebControls.Label myQuickList = (Label)dataItem.FindControl("lblQuickList"); if (myQuickList.Text != "Yes") { AddRowToQuickList(Convert.ToInt32(dataItem.GetDataKeyValue("Id").ToString())); } } } PopulateTab2(); RadGrid2.DataBind(); break; } //Need to update the Quick Lists UpdateMasterPageQuickLists(); break; case 4: //Remove from Quick List switch (RadMultiPage1.SelectedIndex) { case 0: foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid1.MasterTableView.Items) { System.Web.UI.WebControls.CheckBox mySelectCheckBox = (CheckBox)dataItem.FindControl("ckbSelect"); if (mySelectCheckBox.Checked) { RemoveRowFromQuickList(Convert.ToInt32(dataItem.GetDataKeyValue("Id").ToString())); } } PopulateTab1(); RadGrid1.DataBind(); break; case 1: foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid2.MasterTableView.Items) { System.Web.UI.WebControls.CheckBox mySelectCheckBox = (CheckBox)dataItem.FindControl("ckbSelect"); if (mySelectCheckBox.Checked) { RemoveRowFromQuickList(Convert.ToInt32(dataItem.GetDataKeyValue("Id").ToString())); } } PopulateTab2(); RadGrid2.DataBind(); break; } //Need to update the Quick Lists UpdateMasterPageQuickLists(); break; case 6: //Invite to Network Response.RedirectLocation = ResolveUrl("InviteMembersToLeads2.aspx"); break; case 8: //delete group member...and the Administered Groups tab is currently selected if (RadTabStrip1.SelectedIndex == 2) { bool isChanged = false; foreach (Telerik.Web.UI.GridDataItem dataItem in RadGrid3.MasterTableView.Items) { System.Web.UI.WebControls.CheckBox mySelectCheckBox = (CheckBox)dataItem.FindControl("ckbSelect"); if (mySelectCheckBox.Checked) { if (DeleteMemberFromGroup(Convert.ToInt32(dataItem.GetDataKeyValue("Id").ToString()))) isChanged = true; } } if (isChanged) { PopulateTab3(); RadGrid3.DataBind(); } } break; default: if (e.Item.Index >= 9) { this.PopulateTab2(); RadGrid2.DataBind(); } break; } } catch (Exception ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } } /// <summary> /// call a method in the masterPage /// </summary> protected void UpdateMasterPageQuickLists() { HobnobMasterPage MyMasterPage = (HobnobMasterPage)Page.Master; MyMasterPage.LoadQuickLists(); } /// <summary> /// add this item to the Quick List /// </summary> /// <param name="p_Id"></param> /// <returns></returns> private bool AddRowToQuickList(int p_Id) { bool returnVal = false; try { HobnobLib.ConnectionQuickList myQuickList = new HobnobLib.ConnectionQuickList(); myQuickList.CreatedBy = m_Person; myQuickList.Owner = m_Person; myQuickList.ListObject = new HobnobLib.Person(p_Id); myQuickList.UpdateDb(); returnVal = true; } catch (Exception ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } return returnVal; } /// <summary> /// delete this item from the Quick List /// </summary> /// <param name="p_Id"></param> /// <returns></returns> private bool RemoveRowFromQuickList(int p_Id) { try { HobnobLib.ConnectionQuickList myQuickListObj = HobnobLib.ConnectionQuickList.SELECTConnectionQuickListByOwnerIdListObjectId(m_Person.Id, p_Id); myQuickListObj.DELETEConnectionQuickList(); } catch (SqlException ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } return true; } /// <summary> /// delete this item from the Quick List /// </summary> /// <param name="p_Id"></param> /// <returns></returns> private bool DeleteMemberFromGroup(int p_PersonId) { bool didDeletes = false; try { if (m_LastTabGrpIdList[2] > 0) { HobnobLib.Group myGroup = new HobnobLib.Group(m_LastTabGrpIdList[2]); foreach (HobnobLib.GroupPerson guy in myGroup.GroupPersonList) { if (guy.Person.Id == p_PersonId) { guy.DELETEMe(); didDeletes = true; break; } } } return didDeletes; } catch (SqlException ex) { Response.Write("<span style=\"font-color: red; font-weight: bold;\">" + ex.Message + "</span><br />" + ex.StackTrace); } return true; } protected void RadGrid1_PageIndexChanged(object source, GridPageChangedEventArgs e) { PopulateTab1(); } protected void RadGrid1_PageSizeChanged(object source, GridPageSizeChangedEventArgs e) { PopulateTab1(); } protected void RadGrid2_PageIndexChanged(object source, GridPageChangedEventArgs e) { PopulateTab2(); } protected void RadGrid2_PageSizeChanged(object source, GridPageSizeChangedEventArgs e) { if (m_iterations == 0) PopulateTab2(); } protected void RadGrid3_PageIndexChanged(object source, GridPageChangedEventArgs e) { PopulateTab3(); } protected void RadGrid3_PageSizeChanged(object source, GridPageSizeChangedEventArgs e) { PopulateTab3(); } protected void ToggleSelectedState(object sender, EventArgs e) { CheckBox headerCheckBox = (sender as CheckBox); switch (RadMultiPage1.SelectedIndex) { case 0: foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items) { (dataItem.FindControl("ckbSelect") as CheckBox).Checked = headerCheckBox.Checked; } break; case 1: foreach (GridDataItem dataItem in RadGrid2.MasterTableView.Items) { (dataItem.FindControl("ckbSelect") as CheckBox).Checked = headerCheckBox.Checked; } break; case 2: foreach (GridDataItem dataItem in RadGrid3.MasterTableView.Items) { (dataItem.FindControl("ckbSelect") as CheckBox).Checked = headerCheckBox.Checked; } break; } } /// <summary> /// This event fires in the following cases: /// â—¦Right after OnLoad /// Telerik RadGrid checks the viewstate for stored grid-related information. If such information is missing (when the page loads for the first time), the NeedDataSource event is fired. This also means that if the EnableViewState property of the grid has been set to false, the grid will bind each time the page loads (not only the first time) /// â—¦After automatic sorting /// â—¦When paging event occurs /// â—¦When Edit command is fired /// â—¦Right after Update/Delete/Insert command event handlers finish execution. /// You can cancel these operations handling the ItemCommand event and assigning false value to the Canceled property of the e event argument /// â—¦When grouping/ungrouping columns /// right after the RadGrid.GroupsChanging event is raised. /// â—¦When resorting a group /// â—¦When filtering column values /// â—¦When a call to the Rebind() grid method takes place /// â—¦Prior to any detail table binding /// â—¦In some other custom cases. /// /// The advantages of using this event are that the developer does not need to write any code handling the logic about when and how the data-binding should be processed. It is still the developer's responsibility to construct properly a data source object and assign it to the RadGrid's DataSource property. /// In the code of the NeedDataSource handler you should prepare the data source (list of objects) for Telerik RadGrid and assign it to the grid's DataSource property. /// /// Note: You should never call the DataBind() method from inside the NeedDataSource handler or mix simple data-binding mode with advanced data-binding /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { if (Page.IsPostBack) { PopulateTab1(); } } protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { if (m_iterations == 0) PopulateTab2(); } protected void RadGrid3_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { PopulateTab3(); } } }
the aspx file connection.aspx
----------------------------------------------
<%@ Page Title="" Language="C#" MasterPageFile="~/HobnobWeb/Hobnobsite.master" AutoEventWireup="True" CodeBehind="ConnectionList.aspx.cs" Inherits="HobnobWeb.ConnectionList" %> <asp:Content ID="MainContent" ContentPlaceHolderID="HobnobContent" runat="server"> <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadTabStrip1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> <telerik:AjaxUpdatedControl ControlID="RadToolBar1" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" UpdatePanelHeight="100%" LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadToolBar1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadToolBar1" /> <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" UpdatePanelHeight="100%" LoadingPanelID="LoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadListBoxConnections" /> <telerik:AjaxUpdatedControl ControlID="RadMenu1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="100%" LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid2"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid2" UpdatePanelHeight="100%" LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid3"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid3" UpdatePanelHeight="100%" LoadingPanelID="LoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManagerProxy> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> <!-- function ChangePageSize(grid1) { if (grid1) { var masterTable = grid1.get_masterTableView(); if (masterTable && grid1.GridDataDiv) { var height = grid1.GridDataDiv.clientHeight; masterTable.set_pageSize(Math.floor(height / 27)); } } } function OnClientResized(sender, eventArgs) { ChangePageSize($find("<%= RadGrid1.ClientID %>")); ChangePageSize($find("<%= RadGrid2.ClientID %>")); ChangePageSize($find("<%= RadGrid3.ClientID %>")); } function onClientButtonClicking(sender, eventArgs) { var item = eventArgs.get_item(); var command = item.get_commandName(); switch (command.toLowerCase()) { case 'invite': if (!alertInviteConfirmation(sender)) { eventArgs.set_cancel(true); } else { showInviteWindow(); eventArgs.set_cancel(true); } break; } } var selectedTab = '<%= RadTabStrip1.SelectedTab.Text %>'; var selectedTabIndex = '<%= RadTabStrip1.SelectedIndex %>'; var grid1_id = '<%= RadGrid1.ClientID %>'; var grid2_id = '<%= RadGrid2.ClientID%>'; var grid3_id = '<%= RadGrid3.ClientID%>'; function alertInviteConfirmation(el) { var grid_id = selectedTabIndex == 0 ? grid1_id : grid2_id; var grid_el = $('#' + grid_id + ' .RadGrid'); var selRowCount = $(grid_el).find('input[type=checkbox]:checked').length; var msg; if (selRowCount == 0) { msg = 'Please select one or more members.'; alert(msg); return false; } return true; } function showInviteWindow() { var win = $find("<%=radInviteWindow.ClientID %>"); var url = '<%= ResolveUrl("~/HobnobWeb/InviteMembersToLeads2.aspx") %>?sel={sel}'; var vals = ''; var grid_id = selectedTabIndex == 0 ? grid1_id : grid2_id; var grid_el = $('#' + grid_id + ' .RadGrid'); if ($(grid_el).find('input[type=checkbox]:checked').length == 0) $(grid_el).find('input[type=checkbox]').attr('checked', 'checked'); window['checkedItems'] = $(grid_el).find('input[type=checkbox]:checked'); checkedItems.each(function (c) { if (vals.length > 0) vals += ','; var val = $(this).next('input[type=hidden]').val(); if (val) vals += val; }); url = url.replace(/\{sel\}/, vals); win.set_navigateUrl(url); win.set_width(500); win.set_height(600); win.set_title("Invite member(s)"); win.show(); win.center(); } function InviteWindow_OnClose(oWnd) { $(window['checkedItems']).removeAttr('checked'); delete window['checkedItems']; } --> </script> </telerik:RadCodeBlock> <telerik:RadWindow runat="server" VisibleOnPageLoad="false" ID="radInviteWindow" RegisterWithScriptManager="true" KeepInScreenBounds="true" ReloadOnShow="true" VisibleStatusbar="false" Behaviors="Close" Modal="true" OnClientClose="InviteWindow_OnClose"> </telerik:RadWindow> <telerik:RadSplitter runat="server" ID="ContentSplitter" CssClass="ContentSplitter HidePageSize" Width="100%" Height="100%" Orientation="Horizontal" BorderSize="0" BorderStyle="none" PanesBorderSize="0"> <telerik:RadPane ID="RadPane1" runat="server" Height="105" Scrolling="None" style="padding:5px;"> <h1 class="ContainerTitle">My Hobnob Network</h1> <!-- --------------------------------------------------------------------- --> <!-- main tab strip... --> <!-- --------------------------------------------------------------------- --> <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Default" CssClass="TabStrip" MultiPageID="RadMultiPage1" AutoPostBack="true"> <Tabs> <telerik:RadTab Text="Quick List" PageViewID="RadPageView1" Selected="false"></telerik:RadTab> <telerik:RadTab Text="My Network" PageViewID="RadPageView2" Selected="true"></telerik:RadTab> <telerik:RadTab Text="Administer My Network" PageViewID="RadPageView3" Selected="false"></telerik:RadTab> </Tabs> </telerik:RadTabStrip> <telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Windows7" Width="100%" OnButtonClick="RadToolBar1_ButtonClick" OnClientButtonClicking="onClientButtonClicking" AutoPostBack="true"> <Items> <telerik:RadToolBarButton Text="Refresh" ToolTip="Refresh the items listed" CommandName="Refresh List" /> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton Text="Add to Quick List" ToolTip="Add selected item(s) to My Hobnob Network Quick List" CommandName="AddToQuickList" /> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton Text="Remove from Quick List" ToolTip="Remove selected item(s) from My Hobnob Network Quick List" CommandName="RemoveFromQuickList" /> <telerik:RadToolBarButton IsSeparator="true" Enabled="true"/> <telerik:RadToolBarButton Text="Invite" ToolTip="Invite selected members to leads that I originated" CommandName="Invite" Enabled="true" /> <telerik:RadToolBarButton IsSeparator="true" /> <telerik:RadToolBarButton Text="Remove Group Member" ToolTip="Remove the selected member(s) from group" CommandName="DeleteGroupMember" Enabled="true" /> <telerik:RadToolBarButton IsSeparator="true" /> </Items> </telerik:RadToolBar> </telerik:RadPane> <telerik:RadPane ID="RadPane2" runat="server" Scrolling="None" Height="100%" OnClientResized="OnClientResized"> <telerik:RadMultiPage ID="RadMultiPage1" Width="100%" runat="server" Height="100%" RenderSelectedPageOnly="true"> <!-- --------------------------------------------------------------------- --> <!-- RadPageView1 (pg index 0) Quick List tab --> <!-- --------------------------------------------------------------------- --> <telerik:RadPageView ID="RadPageView1" runat="server" Height="100%"> <telerik:RadGrid ID="RadGrid1" runat="server" Height="100%"> <MasterTableView > <Columns> <telerik:GridTemplateColumn UniqueName="SelectCheckBox" HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false"> <HeaderTemplate> <asp:CheckBox Id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="ckbSelect" runat="server" Checked="false" /> <asp:HiddenField runat="server" ID="selItemID" Value='<%# Eval("Id") %>'/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="QuickList" HeaderText="Quick List" DataField="isQuickList" Visible="True" Display="False" AllowFiltering="false" DataType="System.String"> <ItemTemplate> <asp:Label ID="lblQuickList" runat="server" Text='<%# (bool)Eval("isQuickList") ? "Yes" : "" %>' /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridHyperLinkColumn UniqueName="MemberName" HeaderText="Member Name" DataTextField="LastNameFirst" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridHyperLinkColumn UniqueName="CompanyName" HeaderText="Company" DataTextField="Company.CompanyName" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridBoundColumn UniqueName="Address1" HeaderText="Address" DataField="Company.Address.Address1" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField="Company.Address.City" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="State" HeaderText="State/ Province" DataField="Company.Address.State" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="PostalCode" HeaderText="Postal Code" DataField="Company.Address.PostalCode" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="County" HeaderText="County" DataField="Address.County" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Country" HeaderText="Country" DataField="Address.Country" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Comments" HeaderText="Comments" DataField="Comments" Visible="True" Display="False" ReadOnly="True" ItemStyle-Wrap="true" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="DateAdded" HeaderText="Member Since" DataField="DateAdded.FullName" Visible="True" Display="False" ReadOnly="True" DataType="System.DateTime"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> <!-- --------------------------------------------------------------------- --> <!-- RadPageView2 (pg index 1) My tab --> <!-- --------------------------------------------------------------------- --> <telerik:RadPageView ID="RadPageView2" runat="server" Height="100%" Selected="true"> <telerik:RadGrid ID="RadGrid2" runat="server" CssClass="RadGrid" Height="100%"> <MasterTableView > <Columns> <telerik:GridTemplateColumn UniqueName="SelectCheckBox" HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false"> <HeaderTemplate> <asp:CheckBox Id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="ckbSelect" runat="server" Checked="false" /> <asp:HiddenField runat="server" ID="selItemID" Value='<%# Eval("Id") %>'/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="QuickList" HeaderText="Quick List" DataField="isQuickList" Visible="True" Display="False" AllowFiltering="false" DataType="System.String"> <ItemTemplate> <asp:Label ID="lblQuickList" runat="server" Text='<%# (bool)Eval("isQuickList") ? "Yes" : "" %>' /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridHyperLinkColumn UniqueName="MemberName" HeaderText="Member Name" DataTextField="LastNameFirst" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridHyperLinkColumn UniqueName="CompanyName" HeaderText="Company" DataTextField="Company.CompanyName" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridBoundColumn UniqueName="Address1" HeaderText="Address" DataField="Company.Address.Address1" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="City" HeaderText="City" DataField="Company.Address.City" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="State" HeaderText="State/ Province" DataField="Company.Address.State" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="PostalCode" HeaderText="Postal Code" DataField="Company.Address.PostalCode" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="County" HeaderText="County" DataField="Address.County" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Country" HeaderText="Country" DataField="Address.Country" Visible="True" Display="False" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Comments" HeaderText="Comments" DataField="Comments" Visible="True" Display="False" ReadOnly="True" ItemStyle-Wrap="true" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="DateAdded" HeaderText="Member Since" DataField="DateAdded.FullName" Visible="True" Display="False" ReadOnly="True" DataType="System.DateTime"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> <!-- --------------------------------------------------------------------- --> <!-- RadPageView3 (pg index 2) All tab --> <!-- --------------------------------------------------------------------- --> <telerik:RadPageView ID="RadPageView3" runat="server" Height="100%" Selected="true"> <telerik:RadGrid ID="RadGrid3" runat="server" CssClass="RadGrid" Height="100%"> <MasterTableView > <Columns> <telerik:GridTemplateColumn UniqueName="SelectCheckBox" HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false"> <HeaderTemplate> <asp:CheckBox Id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="ckbSelect" runat="server" Checked="false" /> <asp:HiddenField runat="server" ID="selItemID" Value='<%# Eval("Id") %>'/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn UniqueName="QuickList" HeaderText="Quick List" DataField="isQuickList" Visible="True" Display="False" AllowFiltering="false" DataType="System.String"> <ItemTemplate> <asp:Label ID="lblQuickList" runat="server" Text='<%# (bool)Eval("isQuickList") ? "Yes" : "" %>' /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridHyperLinkColumn UniqueName="MemberName" HeaderText="Member Name" DataTextField="LastNameFirst" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridHyperLinkColumn UniqueName="CompanyName" HeaderText="Company" DataTextField="Company.CompanyName" Visible="True" Display="True" DataType="System.String"> </telerik:GridHyperLinkColumn> <telerik:GridBoundColumn UniqueName="LeadsCreatedMTD" HeaderText="Leads Created MTD" DataField="LeadsCreatedMTD" Visible="True" Display="False" AllowFiltering="false" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="LeadsCreatedLastMonth" HeaderText="Leads Created Last Month" DataField="LeadsCreatedLastMonth" Visible="True" Display="False" AllowFiltering="false" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="LeadsCreatedOnAVG" HeaderText="Leads Created on Average" DataField="LeadsCreatedOnAVG" Visible="True" Display="False" AllowFiltering="false" ReadOnly="True" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="DateAdded" HeaderText="Member Since" DataField="DateAdded.FullName" Visible="True" Display="False" ReadOnly="True" DataType="System.DateTime"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> </telerik:RadMultiPage> </telerik:RadPane> </telerik:RadSplitter> </asp:Content>

Try the following code snippet to save and load state of RadDock in database.
VB:
Private
ReadOnly
Property
CurrentDockStates()
As
List(Of DockState)
Get
'Get saved state string from the database - set it to dockState variable for example
Dim
dockStatesFromDB
As
String
=
""
_conn.Open()
Dim
command
As
New
SqlCommand(
"select State from States where id='"
+ _userID +
"' "
, _conn)
dockStatesFromDB = command.ExecuteScalar().ToString()
_conn.Close()
Dim
_currentDockStates
As
New
List(Of DockState)()
Dim
stringStates
As
String
() = dockStatesFromDB.Split(
"|"
C)
For
Each
stringState
As
String
In
stringStates
If
stringState.Trim() <>
String
.Empty
Then
_currentDockStates.Add(DockState.Deserialize(stringState))
End
If
Next
Return
_currentDockStates
End
Get
End
Property
Protected
Sub
RadDockLayout1_SaveDockLayout(sender
As
Object
, e
As
DockLayoutEventArgs)
Dim
stateList
As
List(Of DockState) = RadDockLayout1.GetRegisteredDocksState()
Dim
serializedList
As
New
StringBuilder()
Dim
i
As
Integer
= 0
While
i < stateList.Count
serializedList.Append(stateList(i).ToString())
serializedList.Append(
"|"
)
i += 1
End
While
Dim
dockState
As
String
= serializedList.ToString()
If
dockState.Trim() <> [
String
].Empty
Then
_conn.Open()
Dim
command
As
New
SqlCommand([
String
].Format(
"update States set State='{0}' where id='"
+ _userID +
"'"
, dockState), _conn)
command.ExecuteNonQuery()
_conn.Close()
End
If
End
Sub
Protected
Sub
RadDockLayout1_LoadDockLayout(sender
As
Object
, e
As
DockLayoutEventArgs)
'Populate the event args with the state information. The RadDockLayout control
' will automatically move the docks according that information.
For
Each
state
As
DockState
In
CurrentDockStates
e.Positions(state.UniqueName) = state.DockZoneID
e.Indices(state.UniqueName) = state.Index
Next
End
Sub
I tried this based on the following code libraries. Please have a look into them.
Saving State of Dynamically Created RadDocks in DataBase using Hidden UpdatePanel
Save DockState in DataBase using RadAjaxManager
Regards,
Princy.

How can i show sub menu on mouse over when tab index is change in Radmenu?
Thanks in Advance
Regards
Reshmaa Ramamurthy

I guess that you want to open the next RadMenuItem by clicking on the Tab. Please elaborate your requirement if it doesn't help.
ASPX:
<
body
onkeydown
=
"keydown(event);"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
telerik:RadMenu
ID
=
"RadMenu1"
runat
=
"server"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Menu1"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"submenu1"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"submenu2"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Menu2"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"submenu1"
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"submenu2"
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>
</
div
>
</
form
>
</
body
>
JavaScript:
function
keydown(event) {
if
(event.keyCode == 9) {
event.preventDefault();
var
radMenu = $find(
"<%=RadMenu1.ClientID%>"
);
var
nextSibiling= radMenu.get_openedItem().get_nextSibling();
radMenu.get_openedItem().close();
nextSibiling.open();
}
}
Thanks,
Princy.

Thanks for your reply...i have tried by your code but its not working...its throwing exception "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)"
Thanks in Advance
Reshmaa Ramamurthy

RadCodeBlock should be used when you have server code blocks placed within the markup (most often some JavaScript functions accessing server controls). For More Information please take a look into this help article.
Thanks,
Princy.

You can set the selected index to both of the controls in order to display a given tab and pageview on initial load:
<
telerik:RadTabStrip
...
SelectedIndex
=
"2"
>
...
<
telerik:RadMultiPage
...
SelectedIndex
=
"2"
>
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik