Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
99 views

Hi

I am using Ajaxmanage manger in my page .Below is the code
 

<telerik:RadAjaxManager runat="server">
 <ajaxsettings>
<telerik:AjaxSetting AjaxControlID="btnContact">
 <updatedcontrols>
 <telerik:AjaxUpdatedControl ControlID="pnlContact" UpdatePanelHeight="" />
</updatedcontrols>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnDelete">
<updatedcontrols>
 <telerik:AjaxUpdatedControl ControlID="btnDelete" UpdatePanelHeight="" />
<telerik:AjaxUpdatedControl ControlID="dgvContactList" UpdatePanelHeight="" />
</updatedcontrols>
</telerik:AjaxSetting>
</ajaxsettings>
</telerik:RadAjaxManager>

btnDelete has an OnClientClik function .it does not firing. btnDelete  is inside the pnlContact panel.

<asp:Button ID="btnDelete" runat="server" CausesValidation="False" CssClass="sbttn"
TabIndex="19" Text="Delete" OnClientClick="return JF_ConfirmDelete('dgvContactList','hidContactRowCount');"
OnClick="btnDelete_Click" />

How can i call   JF_ConfirmDelete function in OnClientClick. Please provide a solution as soon as possible

Thanks

.

 

 

 

 

Maria Ilieva
Telerik team
 answered on 27 Sep 2010
1 answer
62 views

Any help is greatly appreciated.

Aspx code:
<

 

telerik:RadMenu ID="USSRadMenu" runat="server" DataSourceID="USSsmd" Skin="">

 

 

</telerik:RadMenu>

 

 

<asp:SiteMapDataSource ID="USSsmd" runat="server" ShowStartingNode="false" SiteMapProvider="USSMenu" />

css that is NOT working:

 

.RadMenu

 

.rmGroup .RightArrow,

 

 

 

.RadMenu

 

.rmGroup .RightArrowDisabled

 

{

 

background-image: url(Images/RightArrow.gif) no-repeat rightright !important;

 

}

 

Sitemap example expecting to see right arrow to go to Level 2

 

 

<

 

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

 

<

 

siteMapNode url="Root#" title="" description="">

 

<

 

siteMapNode url="ContractAdmin#" title="ContractAdmin" description="" >

 

    <

siteMapNode url="~/ContractAdmin/Branding.aspx" title="Branding" description="" >

 

        <

 

siteMapNode url="Level2#" title="Level 2" description="" />

 

    </

 

siteMapNode>

 

</

 

siteMapNode>

 

<

 

siteMapNode url="" title="LogOut" description="" />

 

</

 

siteMapNode>

 

</

 

siteMap>

 

Yana
Telerik team
 answered on 27 Sep 2010
1 answer
54 views
I have the following situation:
- RadGrid with server-side paging and context menu (per row, programmatically added);
- Some rows don't have context menu items;
- On the first page in the grid everything works fine, some rows have a context menu;
- On the second page and further, the context menu isn't showing anymore although the menu items are present in the controls collection;
- When I add a dummy menu item for every row so that the context menu contains at least one item for every row, everything works again as expected on page 2 and further;

Am I running into a weird bug or am I missing something?

Thanks!
Yana
Telerik team
 answered on 27 Sep 2010
6 answers
140 views
I am getting this error after leaving the detail grid (on page load) that displays the users information that is connected to another grid that is used for selecting a users name. THe error is reported in the ScriptResource.axd on line 2560 the bold line
RadGridNamespace.RadGridTable.prototype.InitializeEvents=function(_1a9){
for(clientEvent in _1a9){
if(typeof (_1a9[clientEvent])!="string"){
continue;
}
if(!this.Owner.IsClientEventName(clientEvent)){
if(_1a9[clientEvent]!=""){
var _1aa=_1a9[clientEvent];
if(_1aa.indexOf("(")!=-1){
this[clientEvent]=_1aa;
}else{
this[clientEvent]=eval(_1aa);
}
}else{
this[clientEvent]=null;
}
}
}
};

any ideas?
Maria Ilieva
Telerik team
 answered on 27 Sep 2010
4 answers
146 views
Hey at Telerik

I have a RadTreeView with skin Office_2007 applied.

Is there any way of disabling the hover and selected images on the nodes.

I have configured the RadTreeView with TriState checkboxes and do not need the whole hover & select logic.

Sincerly Jan
Nikolay Tsenkov
Telerik team
 answered on 27 Sep 2010
2 answers
162 views
Does anybody know of a way to insert a caption into the (autogenerated) insert item template?
Ronnie
Top achievements
Rank 1
 answered on 27 Sep 2010
3 answers
340 views
Hi,

I wish to capture both the single click and double click events of a RadGrid row.  Each row in my table shows the metadata of a document (author, date etc).  When the user clicks on the row it shows the document in an iframe, next to the Grid.  I would like it so that in addition, if the user double click the row, it opens up a new window which displays the document full screen.  However, I find that the double click event is not firing due to the setting the src of the iframe.  If I don't include that line of code then both the click doubleclick events fire as expected.

Why does the double click event not fire in this scenario and how do I get around this?

Thanks
Andrew Currie
Top achievements
Rank 1
 answered on 27 Sep 2010
3 answers
67 views
Hi everyone.

I've been searching and looking around and I'm still having problems with this.

I have a button that opens a RadWindow where the user types comments, clicks an OK button to close the window, and then the original window should redirect to the main menu.

I've tried doing this with another window and just clicking the Close button on the window, with no luck.

Here is my code:

    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            //<![CDATA[
            function openRejWin() {
                var oWnd = radopen("Confirm.aspx", "RadWindow3");
            }
            function OnRejectedClose(sender, eventArgs) {
                alert("Moving on!");
                window.location = "Menu.aspx";
            }
            function OnClosing(sender, eventArgs) {
                alert("Closing!");
            }
            //]]>
        </script>
    </telerik:RadScriptBlock>
  
    <telerik:RadWindowManager ID="RadWindowManager1" VisibleStatusbar="false"
        runat="server" Skin="Hay" EnableShadow="true" >
        <Windows>
            <telerik:RadWindow ID="RadWindow3" runat="server" ReloadOnShow="true" Behaviors="Close" OnClientClose="OnRejectedClose"  
                OnClientBeforeClose="OnClosing" NavigateUrl="Confirm.aspx" DestroyOnClose="false">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
  

Then, the .cs code for the button does the following:

btnReject.Attributes.Add("onclick", "openRejWin(); return false");

The window does open, and it does close, but I don't see the alert messages and I don't get redirected to the Menu page.

Thank you for your help.
Ivan
Top achievements
Rank 1
 answered on 27 Sep 2010
1 answer
200 views
After working on it a bit, I have expand/collapse all functionality working in my grid, with images in the header, but I have a concern. I am adding the expand/collapse buttons to the header in the code behind, because putting it in the template column wasn't making it appear. But, if I remove the template column, the buttons don't show up.

Here is the code from the .aspx page (with the columns removed):

<telerik:RadGrid ID="ResultsGrid" runat="server" ShowStatusBar="true" EnableViewState="true" AllowSorting="True" AllowFilteringByColumn="false" GroupingEnabled="False"
                AutoGenerateColumns="False" AllowMultiRowSelection="false" OnNeedDataSource="ResultsGrid_NeedDataSource"
                OnItemCommand="ResultsGrid_ItemCommand" OnItemDataBound="ResultsGrid_ItemDataBound" OnPreRender="ResultsGrid_PreRender"
                OnItemCreated="ResultsGrid_ItemCreated" OnDetailTableDataBind="ResultsGrid_DetailTableDataBind">
                <StatusBarSettings ReadyText="Stand by" LoadingText="Working..." />
                <HeaderContextMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </HeaderContextMenu>               
                <MasterTableView DataMember="TriggeredConditions" AllowMultiColumnSorting="true"
                    EnableHeaderContextMenu="true" HierarchyLoadMode="ServerOnDemand"
                    ClientDataKeyNames="TriggeredConditionId" DataKeyNames="TriggeredConditionId">
                    <DetailTables>
                        <telerik:GridTableView runat="server" AllowSorting="false" ShowFooter="false" ShowHeader="false"
                            DataMember="TriggeredConditionStats" Name="ConditionStats" EnableNoRecordsTemplate="false"
                            ShowHeadersWhenNoRecords="false" NoDetailRecordsText="">
                            <Columns>
                                (Removed)
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <RowIndicatorColumn Visible="False">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                            <HeaderTemplate>
                                <asp:ImageButton ID="ExpandAll" runat="server" CommandName="ExpandAll"
                                    ImageUrl="~/App_Themes/Standard/images/Grid_ExpandAll.png" ToolTip="ExpandAll" />
                                <asp:ImageButton ID="CollapseAll" runat="server" CommandName="CollapseAll"
                                    ImageUrl="~/App_Themes/Standard/images/Grid_CollapseAll.png" ToolTip="CollapseAll" />
                            </HeaderTemplate>
                        </telerik:GridTemplateColumn>
                        (Columns Removed)
                    </Columns>
                </MasterTableView>
                <SortingSettings SortToolTip="" />
                <ClientSettings AllowColumnsReorder="true" AllowKeyboardNavigation="true"
                    ColumnsReorderMethod="Reorder" AllowExpandCollapse="true">
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="100%" SaveScrollPosition="false" />
                    <Resizing AllowColumnResize="True" ClipCellContentOnResize="True" EnableRealTimeResize="True" />
                    <Selecting AllowRowSelect="True" />
                    <ClientEvents OnKeyPress="GridKeyPressed" OnRowSelected="RowSelected"
                        OnGridCreated="GridCreated" />
                    <ClientMessages DragToGroupOrReorder="" />
                </ClientSettings>
                <FilterMenu EnableEmbeddedSkins="False" EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
            </telerik:RadGrid>

And the code behind:
private GridHeaderItem _gridHeaderItem;
private ImageButton _imgCollapse;
private ImageButton _imgExpand;
 
protected void ResultsGrid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridHeaderItem)
    {
        if (e.Item.OwnerTableView == e.Item.OwnerTableView.OwnerGrid.MasterTableView)
        {
            _gridHeaderItem = e.Item as GridHeaderItem;
            _imgCollapse = new ImageButton();
            _imgCollapse.ImageUrl = "~/App_Themes/Standard/images/Grid_CollapseAll.png";
            _imgCollapse.CommandName = "CollapseAll";
            _imgCollapse.ID = "btnCollapse";
            _imgCollapse.Visible = false;
 
            _imgExpand = new ImageButton();
            _imgExpand.ImageUrl = "~/App_Themes/Standard/images/Grid_ExpandAll.png";
            _imgExpand.CommandName = "ExpandAll";
            _imgExpand.ID = "btnExpand";
            _imgExpand.Visible = true;
             
            _gridHeaderItem.Cells[0].Controls.Add(_imgCollapse);
            _gridHeaderItem.Cells[0].Controls.Add(_imgExpand);
        }
    }
}
 
 
protected void ResultsGrid_ItemCommand(object source, GridCommandEventArgs e)
{
    switch (e.CommandName)
    {
        case "ExpandCollapse":
            CheckExpandCollapse(e);
 
            break;
        case "ExpandAll":
            ChangeExpandButtons(e, true);
 
            break;
        case "CollapseAll":
            ChangeExpandButtons(e, false);
 
            break;
    }
}
 
 
private void CheckExpandCollapse(GridCommandEventArgs e)
{
    int expanded = 0;
    int collapsed = 0;
 
    foreach (GridDataItem item in ResultsGrid.MasterTableView.Items)
    {
        if (item.Expanded)
        {
            expanded++;
        }
        else
        {
            collapsed++;
        }
    }
 
    //All are expanded
    if (collapsed == 1 && !e.Item.Expanded)
    {
        _gridHeaderItem.Cells[0].Controls.Remove(_imgCollapse);
        _gridHeaderItem.Cells[0].Controls.Remove(_imgExpand);
        _imgCollapse.Visible = true;
        _imgExpand.Visible = false;
        _gridHeaderItem.Cells[0].Controls.Add(_imgCollapse);
        _gridHeaderItem.Cells[0].Controls.Add(_imgExpand);
    }
 
    //All are collapsed, current item is collapsing
    if (expanded == 1 && e.Item.Expanded)
    {
        _gridHeaderItem.Cells[0].Controls.Remove(_imgCollapse);
        _gridHeaderItem.Cells[0].Controls.Remove(_imgExpand);
        _imgCollapse.Visible = false;
        _imgExpand.Visible = true;
        _gridHeaderItem.Cells[0].Controls.Add(_imgCollapse);
        _gridHeaderItem.Cells[0].Controls.Add(_imgExpand);
    }
}
 
private void ChangeExpandButtons(GridCommandEventArgs e, bool expand)
{
    ImageButton btnExpand = (ImageButton)e.Item.FindControl("btnExpand");
    ImageButton btnCollapse = (ImageButton)e.Item.FindControl("btnCollapse");
 
    //Looping through each DataItem and making the "btnExpand" image button in the item visibility  to false and  "btnCollapse" visibility to true  
    foreach (GridDataItem gridDataItem in ResultsGrid.MasterTableView.GetItems(new GridItemType[] { GridItemType.Item, GridItemType.AlternatingItem }))
    {
        btnExpand.Visible = !expand;
        btnCollapse.Visible = expand;
    }
 
    //Exapanding the DataItem 
    foreach (GridDataItem item in ResultsGrid.Items) 
    {
        item.Expanded = expand;
    }
 
    //Hiding the CollapseAll image in the header to true and ExpandAll image in the header to false 
    GridHeaderItem gridHeaderItem = e.Item as GridHeaderItem;
    ImageButton imgCollapseAll = (ImageButton)gridHeaderItem.FindControl("CollapseAll");
    imgCollapseAll.Visible = expand;
    ImageButton imgExpandAll = (ImageButton)gridHeaderItem.FindControl("ExpandAll");
    imgExpandAll.Visible = !expand; 
}

If I take out the template column on the grid, the header image buttons don't show. But, it seems very extraneous to leave them there. And I'm not sure why they didn't work in the first place. Any ideas?
Mira
Telerik team
 answered on 27 Sep 2010
3 answers
128 views

Hi,

The paging doesn't work correctly.  It only shows 1 page, while the record has more than 50 rows.  I attached the code below.

Thanks

Vinh

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cubesstatus.aspx.cs" Inherits="SSI.cubesstatus" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <br />
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" 
            DataSourceID="SqlDataSource1" GridLines="None" 
            ShowGroupPanel="True" Skin="Vista" AllowAutomaticUpdates="True" 
            AutoGenerateEditColumn="True">
            <PagerStyle AlwaysVisible="True" />
<MasterTableView AllowCustomPaging="True" AutoGenerateColumns="False" DataKeyNames="ID" 
                DataSourceID="SqlDataSource1" EditMode="PopUp">
  
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
    <DetailTables>
        <telerik:GridTableView DataKeyNames="CubeID" DataSourceID="SqlDataSource2" Width="100%"
                                runat="server" AutoGenerateColumns="False" 
            AllowAutomaticUpdates="False" AllowSorting="True" EditMode="InPlace">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="CubeID" MasterKeyField="ID" />
                                </ParentTableRelation>
  
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="cubename" HeaderText="Cube name" HeaderButtonType="TextButton"
                                        DataField="cubename" UniqueName="cubename" ReadOnly="True">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" HeaderButtonType="TextButton"
                                        DataField="Status" UniqueName="Status" ReadOnly="True">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="lastcheck" HeaderText="Last check" HeaderButtonType="TextButton"
                                        DataField="lastcheck" UniqueName="lastcheck" ReadOnly="True">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <AlternatingItemStyle BackColor="#99CCFF" ForeColor="White" />
                                <PagerStyle AlwaysVisible="True" />
                            </telerik:GridTableView>
  
    </DetailTables>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
<ExpandCollapseColumn Visible="True">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" 
            ReadOnly="True" SortExpression="ID" UniqueName="ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CatalogName" HeaderText="CatalogName" 
            SortExpression="CatalogName" UniqueName="CatalogName" ReadOnly="True">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CubeName" HeaderText="CubeName" 
            SortExpression="CubeName" UniqueName="CubeName" ReadOnly="True">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ServerName" HeaderText="ServerName" 
            SortExpression="ServerName" UniqueName="ServerName" ReadOnly="True">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="Monitor" DataType="System.Boolean" 
            HeaderText="Monitor" SortExpression="Monitor" UniqueName="Monitor">
        </telerik:GridCheckBoxColumn>
    </Columns>
    <AlternatingItemStyle BackColor="#99CCFF" ForeColor="White" />
    <PagerStyle AlwaysVisible="True" />
    <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
        Font-Strikeout="False" Font-Underline="False" Wrap="True" />
</MasterTableView>
            <ClientSettings AllowDragToGroup="True">
            </ClientSettings>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:csSSIReports %>" 
              
              
            SelectCommand="SELECT [ID], [CatalogName], [CubeName], [ServerName], [Monitor] FROM [tblCubes]" 
            UpdateCommand="UPDATE tblCubes SET Monitor = @Monitor WHERE (ID = @ID)">
             <UpdateParameters>
                <asp:Parameter Name="Monitor" />            
                 <asp:Parameter Name="ID" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </div>
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:csSSIReports %>" 
          
        SelectCommand="SELECT SS.CubeID, S.CubeName, SS.Status, SS.LastCheck FROM tblCubeStatus AS SS INNER JOIN tblCubes AS S ON S.ID = SS.CubeID WHERE (SS.CubeID = @CubeID)">
        <SelectParameters>
                <asp:Parameter Name="CubeID" />
            </SelectParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>

 

 

Vinh
Top achievements
Rank 1
 answered on 27 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?