Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
79 views
I have a strip of tabs set out in the normal way in the code-in-front. I would like to be able to change the order of appearance of the tabs in the strip. e.g.

Tab 1 | Tab 2 | Tab 3 | Tab 4

but I want to programatically, with a postback, change the on screen order of these to

Tab 3 | Tab 1 | Tab 4 | Tab 2

(or whatever). Is this possible, i fiddled for a while but couldn't see how it was done.
Kate
Telerik team
 answered on 26 Oct 2011
1 answer
111 views
Hi, I have a page with 2 notifications object! Here the scenario, a page with three notifications objects. I have a link button, and by server side i call show of three objects.
How can i calculate offset for each object is necessary?
I've implemented "OnClientShowing" and "ONClientHidden", and works fine, but only If i used show notification from client side.
Any workaround?
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
1 answer
81 views
Hi all!!

I'm working with a RadGrid with hierarchies, but I have a couple of problems, I've managed to show the internal grids but when I display information in an internal grid I can not do depending on the value that has the grid father, my question is:
How I can make the relationship between parent and child grid?, And how to make each internal grid have different information?


Here is my code:

<telerik:RadGrid ID="grdCompCliente" runat="server" OnItemCommand="grdCompCliente_ItemCommand1"
                        OnItemCreated="grdCompCliente_ItemCreated1" 
                        OnItemDataBound="grdCompCliente_ItemDataBound1" Skin="Windows7">
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                        <MasterTableView AllowMultiColumnSorting="True" EnableNoRecordsTemplate="true" 
                            GroupLoadMode="Server" ShowHeadersWhenNoRecords="false">
                            <NestedViewTemplate>
                                <asp:Panel ID="InnerContainer" runat="server" Visible="false">
                                    <telerik:RadGrid ID="grdPostores" runat="server" >
                                        <MasterTableView AutoGenerateColumns = "true">
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre del Postor">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                    <telerik:RadButton ID="cmdAgregarPostor" runat="server" 
                                        CausesValidation="False" Text="Agregar Postores">
                                    </telerik:RadButton>
                                </asp:Panel>
                            </NestedViewTemplate>
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                Visible="True">
                            </ExpandCollapseColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>

protected void grdCompCliente_ItemDataBound1(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {                
                try
                {
                    int id = Convert.ToInt32(Session["Prueba"]);
                    DataAccesCatalogos compCliente = new DataAccesCatalogos();
                    ((RadGrid)e.Item.FindControl("grdPostores")).DataSource = compCliente.GetBidders(id);
                    ((RadGrid)e.Item.FindControl("grdPostores")).DataBind();
                }
                catch { }
            }
        }
         
        protected void grdCompCliente_ItemCreated1(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }
  
        protected void grdCompCliente_ItemCommand1(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
                {
                    ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible = !e.Item.Expanded;
                      
                    string id_comp = (e.Item as GridDataItem)["ID"].Text;
                      
                    Session["Prueba"] = id_comp;
                    //Label1.Text = "id: " + Session["Prueba"].ToString();
                }
             
        }

Thankyou for your attention
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Oct 2011
1 answer
125 views
Greetings,
I try to make the exemple The telerik team has posted here :
http://www.telerik.com/community/code-library/aspnet-ajax/grid/display-radgrid-row-details-in-ajaxtoolkit-modalpopupextender.aspx


But i don't get anything when i click on an ID ( just a OK button which make a short apparition before vanishing )... My popup does not show itself...

Can anyone help me ?

<%@ Page Title="Page d'accueil" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
   <style type="text/css">
        .modalBackground
        {
            background-color: Gray;
            filter: alpha(opacity=70);
            opacity: 0.7;
        }
        .PanelClass
        {
            background: white;
        }
        .DetailsViewHeader
        {
            border-bottom: 1px solid #41a901;
            padding-top: 8px;
            padding-bottom: 8px;
            background: olive;
            font-size: 13px;
            font-weight: normal;
            text-align: left;
            color: white;
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1">
    </ajaxToolkit:ToolkitScriptManager>
    <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="DetailsViewDataSource"
        AutoGenerateRows="False" Width="60%" HeaderText="Contact details">
        <HeaderStyle CssClass="DetailsViewHeader" />
        <Fields>
            <asp:BoundField DataField="Title" HeaderText="Title" />
            <asp:BoundField DataField="BirthDate" HeaderText="BirthDate" DataFormatString="{0:D}" />
            <asp:BoundField DataField="City" HeaderText="City" />
            <asp:BoundField DataField="Country" HeaderText="Country" />
        </Fields>
    </asp:DetailsView>
 
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        onajaxrequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function PopulateDetails(rowid) {
                $get("<%=btnPopUp.ClientID %>").click();
                $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(rowid);
 
                return false;
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"
        AutoGenerateColumns="false" onitemcreated="RadGrid1_ItemCreated">
        <MasterTableView DataKeyNames="EmployeeID">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="EmployeeID">
                    <ItemTemplate>
                        <asp:LinkButton ID="btnShowDetails" runat="server" CausesValidation="false" Text='<%#Eval("EmployeeID")%>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First name" ReadOnly="True"
                    UniqueName="FirstName" />
                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last name" ReadOnly="True"
                    UniqueName="LastName" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT EmployeeID, LastName, FirstName FROM Employees"></asp:SqlDataSource>
    <asp:SqlDataSource ID="DetailsViewDataSource" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT Title, BirthDate, City, Country FROM Employees WHERE EmployeeID=@EmployeeID"
        runat="server">
        <SelectParameters>
            <asp:Parameter Name="EmployeeID" Type="Int16" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Panel ID="Panel1" runat="server" CssClass="PanelClass" Style="display: none;">
        <asp:Button ID="btnOK" runat="server" Text="OK" />
    </asp:Panel>
    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1"
        OkControlID="btnOK" TargetControlID="btnPopUp" BackgroundCssClass="modalBackground"
        DropShadow="true">
    </ajaxToolkit:ModalPopupExtender>
    <asp:Button ID="btnPopUp" runat="server" Text="Show popup" Style="display: none"/>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
           if (e.Item is GridDataItem)
        {
            LinkButton btnDetails = e.Item.FindControl("btnShowDetails") as LinkButton;
            btnDetails.OnClientClick = string.Format("return PopulateDetails('{0}');", (e.Item as GridDataItem).GetDataKeyValue("EmployeeID").ToString());
        }
 
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        int eventArgument = Convert.ToInt32(e.Argument);
        foreach (GridDataItem gridItem in RadGrid1.MasterTableView.Items)
        {
            if (Convert.ToInt32(gridItem.GetDataKeyValue("EmployeeID")) == eventArgument)
            {
                DetailsViewDataSource.SelectParameters["EmployeeID"].DefaultValue = eventArgument.ToString();
                DetailsView1.DataBind();
                return;
            }
        }
    }
}

Radoslav
Telerik team
 answered on 26 Oct 2011
6 answers
167 views
when i entered the 00/00/11 date in Rad Date Picker and press enter key it automatically changes the date to 31-Dec-2009
Milena
Telerik team
 answered on 26 Oct 2011
2 answers
94 views
Hello,

I am using this example http://demos.telerik.com/aspnet-ajax/ajax/examples/loadingpanel/explicitshowhide/defaultcs.aspx
and I am using it in a user control inside a sharepoint web part..but i cannot get the loading panel to load..all others activities seem to work properly but it is the loading panel that does not load...I had to replace the  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
with a scriptmanager proxy as sharepoint has a script manager inside the master page ...Can someone please tell me how to make it work inside sharepoint ....

The thing which i am dealing with is that i have a radgrid and I have a button..When the button is clicked some operations happen on the grid..while the operation is happening I want to show some loading panel  when the button is clicked so that it shows that some operation is happening .

Thanks
Maria Ilieva
Telerik team
 answered on 26 Oct 2011
4 answers
106 views
Hello,

I am trying to build MegaDropDown, which is a combination of RadMenu and RadSiteMap and RadSiteMapNodes.
I have 15 menuitems.Each menuitem has Radsitemap.
Basically i have to click on the arrow button on the rightmost side of the menu inorder to see the last menu.
I was able to see Radsitemap for first few menuitems.But if i scrool to the last menuitem and click on the menuitem, i can see the site map
but , its missing styles for the header in the radsitemap.
But this is working in firefox and ie8.

Please see the attachments for more details.
In WrongStyles.png  "PC Administration" and "Customer Documents" and "Others"   are headings.
But its missing styles.

Please Advise.
Kate
Telerik team
 answered on 26 Oct 2011
1 answer
96 views
Hello,

I have a Ajaxified Grid that populates a sub grid using the OnRowSelected ClientEvent. It also opens a modal edit control with Javascript. This MasterRadGrid is rather large and takes a couple of seconds to load. The OnRowSelected even calls the rowSelected function.

function rowSelected(senders, args) {
    var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');
    var selectedIndex = args.get_itemIndexHierarchical();
    ajaxManager.ajaxRequestWithTarget('<%= MasterRadGrid.UniqueID %>', selectedIndex);
}

Which calls the RaisePostBackEvent...

protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument)
{
    try
    {
        viewstateColumnSequence = 0;
 
        base.RaisePostBackEvent(sourceControl, eventArgument);
        var grid = sourceControl as RadGrid;
 
        if (grid != null)
        {
            try
            {
                var gridItem = grid.Items[eventArgument];
                gridItem.FireCommandEvent(RadGrid.SelectCommandName, String.Empty);
            }
            catch { }
        }
    }
    catch (Exception ex)
    {
    }
}

Which fires the CommandEvent for select...

protected void MasterRadGrid_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
    //Needed to reset the column created column names
    viewstateColumnSequence = 0;
 
    try
    {
        if (e.Item != null && e.Item.ItemIndex >= 0)
        {
            if (e.CommandName == "Select")
            {
                string tempCiIdHidden = ChildTabControl.myCiIdHidden.Value;
                HiddenField myCiIdHidden = (HiddenField)e.Item.FindControl("CiIdHidden");
                if (tempCiIdHidden != myCiIdHidden.Value)
                {
                    LoadChildGrid(myCiIdHidden.Value);
                }
 
                //Needed to persist the custom column template changes
                MasterRadGrid.Rebind();
            }
        }
    }
    catch (Exception ex)
    {
    }
}

My issue is that every time the row is selected, it raises a postback event that reloads the MasterRadGrid, whether the data needs refreshed or not. I'm stumped on how to raise the postback event to load the child grid but prevent the MasterRadGrid from reloading. Any ideas on what I'm missing or a direction you can point me in?

Thanks for taking a look.

Smith

Maria Ilieva
Telerik team
 answered on 26 Oct 2011
3 answers
146 views
Hi,

I have a hierarchical grid. The 2nd level grid contains a column with an editItemTemplate, that editItemTemplate contains a RadComboBox. The DataSource of the RadComboBox returns over 30,000 rows, I am therefore using an additional parameter to pass in the first letter of the name which is entered into the RadComboBox.

I'm tring to do this on the OnSelecting event for the SqlDataSource:
protected void names_selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
RadComboBox rcb = (RadComboBox)editItem.FindControl("rcb_name");
                        e.Command.Parameters["@starts_with"].Value = rcb.Text;
}

Can you tell me how I can find the RadComboBox within the edit template of the 2nd level grid and also if this is the right place to alter the parameter value?


Thanks in Advance,
Ryan
Veli
Telerik team
 answered on 26 Oct 2011
1 answer
112 views
I've been playing around with the RadNotificaiton and got most of my website using it now. However, I have a glitch and I was wondering if someone could help me out. I'm getting a blank notification with only the icons... just no text is visible. The only time this behavior is noticed is when there is bound data. The page works correctly in the sense that I can Insert/Edit/Delete, just getting the blank notification. Any help would be greatly appreciated.

William
Marin Bratanov
Telerik team
 answered on 26 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?