Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
112 views
I may be doing something wrong here but we use the Splitter for our screen layout.  In any case we have a layout with a menu at the top and a footer at the bottom.  In the middle is a content area and then above that a message area which would need to adjust based on how many user messages there are, but if there are none, not show up.  In any case when you submit multiple times on the same page, the complete splitter continually shrinks for each submission.  Here is a sample ASPX I put together to demonstrate the point.  Simply run it and click the Test button and watch the splitter shrink.

<%@ Page AutoEventWireup="true" Inherits="PlaygroundControl" Language="c#" Codebehind="PlaygroundPage.aspx.cs" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<head id="Head1" runat="server">
    <title>Playground Page</title>
    <style type="text/css">
        .ie7ScrollFix {   position:relative; }
        html, body, form
        {   font-size: 10px;
            font-family: Verdana, Arial, Helvetica, sans-serif;
            margin:0px;
            padding:0px;
            width: 100%;
            height: 100%;
            border-style: none;
            background-color: #FFFFFF;
            color: #000000;
            overflow:hidden;
            z-index:0;
            border-collapse: collapse;
        }
    </style>
</head>
<body class="BODY">
<form id="test" runat="server">
<telerik:RadScriptManager ID="supportScripts" runat="server" >
</telerik:RadScriptManager>
 
<%  // Code block could be moved to load event but here right now
    RadPane msgPane = RadSplitterMaster.GetPaneById("messagePane");
    int rowCount = 2;
    msgPane.SetExpandedSize(Unit.Pixel(rowCount > 0?rowCount*15:0));
    msgPane.Height = Unit.Pixel(rowCount > 0 ? rowCount * 15 : 0);
    msgPane.Collapsed = (rowCount > 0 ? false : true);   
%>
 
<telerik:RadSplitter ID="RadSplitterMaster" runat="server" Height="100%" Width="100%"
    VisibleDuringInit="false" ClientIDMode="Predictable" ResizeMode="AdjacentPane"
    ResizeWithBrowserWindow="true" ResizeWithParentPane="true" Orientation="Horizontal"
    BorderStyle="Solid" BorderSize="3">
        <telerik:RadPane ID="headerPane" runat="server" Height="52px" Scrolling="None" Locked="true" BackColor="Blue">
            Menu Stuff <br />
            Here
        </telerik:RadPane>
        <telerik:RadPane ID="messagePane" runat="server" Scrolling="None" BackColor="Orange" >
                Random stuff here<br />
                With lines and such<br />
        </telerik:RadPane>
        <telerik:RadPane ID="contentPane" runat="server" Scrolling="Both" BackColor="White" >
            <input type="submit" value="Click to Test" />
            <div>Put in full content regardless of size</div>
        </telerik:RadPane>
        <telerik:RadPane ID="footerPane" runat="server" Height="12px" Locked="true" BackColor="Green">
            <div id="footerDiv">
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/LicenseAgreement.htm">
                    <b><font size="-2" color="white" >©My Company Stuff</font></b>
                </asp:HyperLink>   
            </div>
        </telerik:RadPane>
</telerik:RadSplitter>
 
</form>
</body>
</html>
I put all the code in the ASPX for clarity sake.  Is this a bug or am I just doing something wrong here?
Thanks,
Shane
Dobromir
Telerik team
 answered on 27 Oct 2011
6 answers
896 views
I have seen a couple of examples of opening a window from codebehind using C#., but none using VBScript. I must be the last guy on earth using VB.

Can anyone post a code sample of how to open a RadWindow from codebehind with VB Script?

Thanks
pedrotti
Top achievements
Rank 1
 answered on 27 Oct 2011
2 answers
113 views
Hi,
I'm creating a radgrid where i have master table outside and a detail table inside.
I already set ParentTableRelation.
  <DetailTables>
                    <telerik:GridTableView runat="server" AllowAutomaticDeletes="True"
                        AllowAutomaticUpdates="True" DataKeyNames="ID"
                        DataSourceID="EntityDataSource2" Name="TestChoice"
                        CommandItemDisplay="Top">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="OfQuestion" MasterKeyField="ID" />
                        </ParentTableRelation>
                  ....
 
</DetailTables>

It works fine when I have to enable client row selection in the master table and i need to select the row in the master before click that triangle to expand the detail table.

If I don't select any row in the master table and I just click expand the row, it shows nothing.

My questions are
1. do I have to set anything special in order to make it works without client row selection?
2. after inserting a new row, i just want the grid to stay in insert mode.
let say, if I insert a new row in a master table, i want my master table to stay in insert mode only; another table stays in readonly mode.
also if I insert a new row in a detail table, i want my detail table to stay in insert mode only; another table stays in readonly mode.
How can I do that?

Here is the first part of the RadGrid and the
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
          CellSpacing="0" DataSourceID="EntityDataSource1" GridLines="None" AllowCustomPaging="True"
          PageSize="25" AutoGenerateColumns="False">
          <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
              <Selecting AllowRowSelect="True" />
          </ClientSettings>
          <MasterTableView AllowAutomaticDeletes="True" AllowAutomaticUpdates="True"
              CommandItemDisplay="Top" DataKeyNames="ID"
              DataSourceID="EntityDataSource1" AllowCustomPaging="False"
              PageSize="10" Name="TestQuestion">

<
telerik:GridTableView runat="server" AllowAutomaticDeletes="True"
                       AllowAutomaticUpdates="True" DataKeyNames="ID"
                       DataSourceID="EntityDataSource2" Name="TestChoice"
                       CommandItemDisplay="Top">
                       <ParentTableRelation>
                           <telerik:GridRelationFields DetailKeyField="OfQuestion" MasterKeyField="ID" />
                       </ParentTableRelation>
                    ...


Best Regards,
Utharn
PS. Insertion and Updation operation work fine. and sorry, i write the column name in my native language so i didn't post the whole part.

Utarn Buranasaksee
Top achievements
Rank 1
 answered on 27 Oct 2011
2 answers
214 views
Hi,

I have implemented a Radgrid in my website and i have added the following attribute to each Gridboundcolumn:

DataFormatString="<nobr>{0}</nobr>" 

The purpose of this was to resize the width of each column to the data it contains automatically as i understand there is no other way to do so.

The problem I have is that when I export the gridcontents to Excel or csv, then the <nobr></nobr> tags surround each cell's data.

Is there a way to eliminate these tags on export without having to first replace the tags in the grid contents, which in turn removes the formatting?

Regards,

Shane
Shane
Top achievements
Rank 1
 answered on 27 Oct 2011
1 answer
288 views
Hi

I want to display the grand total on top of the last series. When i do the DefaultLabelValue for the last chart series, it is overriding the last series label value. Please guide me to achieve the grand total in the stacked bar. Please see the attached image.
if (cs.Index == chart.Series.Count-1)
                {
                    cs.DefaultLabelValue = "#STSUM";
                    cs.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
                    cs.Appearance.LabelAppearance.LabelLocation = Telerik.Charting.Styles.StyleSeriesItemLabel.ItemLabelLocation.Auto;
                                    }

Anyone guide me how the calculation is happening for the cs.DefaultLabelValue = "#STSUM"; So that i could add one more series with all the values as 1 and substracting 1 from the total.

Regards
Arima
Peshito
Telerik team
 answered on 27 Oct 2011
3 answers
142 views
Hello, Telerik Team,
I have a question about your RadGrid control.

I have a Hierarchical RadGrid with two levels, the markup of the grid looks like this:

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" AllowCustomPaging="true"
    AllowMultiRowSelection="true">
    <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" InsertItemPageIndexAction="ShowItemOnCurrentPage">
        <Columns>
            <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/Edit.png"
                CommandName="Edit" Text="Edit"
                UniqueName="EditColumn">
            </telerik:GridButtonColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/Delete.png"
                CommandName="DeleteShift" ConfirmText="Do you want to delete this Shift?" ConfirmDialogHeight="150"
                ConfirmTitle="Confirmation" ConfirmDialogType="RadWindow"
                Text="Delete" UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
             <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/AddRecord.png"
                CommandName="AddJob" Text="Add Job"
                UniqueName="AddJob">
            </telerik:GridButtonColumn>
             <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/ExportCSV.png"
                CommandName="ExportJobsCSV" Text="Export Jobs"
                UniqueName="ExportJobsCSV">
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" Visible="False">
            </telerik:GridBoundColumn>
        </Columns>
        <DetailTables>
            <telerik:GridTableView Width="100%" runat="server" DataKeyNames="ID" ClientDataKeyNames="ID" AllowFilteringByColumn="false" AllowPaging="false" ItemStyle-BackColor="#DCD9C5" AlternatingItemStyle-BackColor="#C0BDAE" AllowSorting="false">
                <%--<ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ShiftID" MasterKeyField="ID" />
                </ParentTableRelation>--%>
                <Columns>
                   <%-- <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~/Images/Icons/Edit.png"
                        HeaderStyle-Font-Size="Smaller" HeaderStyle-Width="34px" HeaderText="Edit" UniqueName="EditColumn" />--%>
                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/Edit.png"
                        CommandName="EditJob"
                        UniqueName="EditColumn" Text="Edit">
                    </telerik:GridButtonColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="~/Images/Icons/Delete.png"
                        CommandName="DeleteJob" ConfirmTitle="Confirmation" ConfirmText="Are you sure you want do delete this Job?"
                        ConfirmDialogHeight="150" ConfirmDialogType="RadWindow"
                        Text="Delete" UniqueName="DeleteColumn" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
        <CommandItemTemplate>
            <div class="cmdItem">
                <asp:LinkButton ID="btnAddShift" runat="server" CommandName="Add Shift" OnClientClick="javascript:lastTableView=null;">
                    <img alt="" src="../../Images/Icons/AddRecord.png" />Add Shift</asp:LinkButton>   
                <asp:LinkButton ID="btnExportCSV" runat="server" CommandName="Export CSV" OnClientClick="return exportGrid('CSV');"><img alt="" src="../../Images/Icons/ExportCSV.png" />Export to CSV</asp:LinkButton>   
                <asp:LinkButton ID="btnManageShiftColumns" runat="server" CommandName="Manage Shift Columns">
                    <img alt="" src="../../Images/Icons/Columns.png" />Manage Shift Columns</asp:LinkButton>   
                <asp:LinkButton ID="btnManageJobColumns" runat="server" CommandName="Manage Job Columns">
                    <img alt="" src="../../Images/Icons/Columns.png" />Manage Job Columns</asp:LinkButton>   
                <%--<asp:LinkButton ID="btnDetailedExportCSV" runat="server" CommandName="Export CSV Detailed"
                    OnClientClick="return exportGrid('CSVDetailed');"><img alt="" src="../../Images/Icons/ExportCSV.png" />Detailed Export to CSV</asp:LinkButton>   
                <asp:LinkButton ID="btnExportPDF" runat="server" CommandName="Export PDF" OnClientClick="return exportGrid('PDF');"><img alt="" src="../../Images/Icons/ExportPDF.png" />Export to PDF</asp:LinkButton>   --%>
            </div>
        </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnCommand="gridCommand" />
        <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="true" />
    </ClientSettings>
</telerik:RadGrid>

The refreshGrid Javascript function looks like this:
function refreshGrid(sender) {
        $find("<%= RadGrid1.ClientID %>").get_masterTableView().rebind();
        showScrollBars();
}

I have a RadWindow where another page is loaded where I can add/delete/modify columns and I have a "sunny day" scenario when the columns in the outer level are changed: the grid is rebinded and the new columns appear nicely. However, when I modify/delete/add columns in the inner levels the grid is rebinded, but the column set in the inner levels is not refreshed. I've debugged the server-side code and everything is fine there, but on the client side I have the old column setup. Is there a solution to my problem, or should I wait for a new version of Telerik?

Note: I've done a temporary hack to hide this anomality from the users where the refreshGrid function only rebinds if the column modification/deletion/insertion happened in the outer layer. Elseway the page is reloaded. I know this is an ugly hack, but I don't see any alternatives.

I appreciate any help.
Sincerely Yours,
Lajos Arpad.
Veli
Telerik team
 answered on 27 Oct 2011
6 answers
167 views
I have a fairly simple page that contains a DropDownList control and a DetailsView control in a master/details type setup.

The DetailsView displays the details of the record selected in the DropDownList.

This form works perfectly without RadAjaxManager.

However, as soon as I hook up the RadAjaxManager I get errors in the code.

Troubleshooting the issue I was able to determine that the DetailsView.DataBound event is being triggered BEFORE the DropDownList.DataBound event. Code in the DetailsView.DataBound event populates a control within the DetailsView with data associated with the currently selected item in the DropDownList. But an error occurs because there is no DropDownList.SelectedValue because the DropDownList control hasn't been databound yet.

As I said, this does not occur when RadAjaxManager is not on the page.

What do I need to set in RadAjaxManager to make sure that the controls get bound in the correct order? (top-down)

Note I've hooked up event handlers for DetailsView.ModeChanged and DetailsView.DataBound. Also note I've hooked up the DropDownList.PreRender event as well with the following code:

CType(sender, DropDownList).Attributes.Add("onChange""window.focus();")


I need to have this code because the user may use his mouse wheel to scroll the page, but if the DropDownList is selected it will scroll that instead and reload the DetailsView.

Iana Tsolova
Telerik team
 answered on 27 Oct 2011
1 answer
129 views
Hi,

Are there any events on the client side which fire when a new page is requested from the grid for which I can write javascript code to handle?

The reason that I ask is that I have a grid with client-side binding and caching enabled. This works pretty much as I would expect except that when you go to a page which is cached the RadAjaxLoadingPanel isn't shown and I would really like to show it and hide it again for the cached pages as it is great indicator as to whether something is going on.

Stuart
Shinu
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
612 views
I am working with the RadWindow, and an objective is to close the RadWindow once a navigateUrl is applied to a HyperLink;
 
The issue is with the close of the RadWindow, and how best to close the RadWindow programmatically with C# and/or JavaScript;

Thank in advance for any insight;  Best regards - Rob 

 
Princy
Top achievements
Rank 2
 answered on 27 Oct 2011
1 answer
106 views
I have successfully tested this feature on my dev and live server on multiple browsers on my machine. However the user is receiving the attached screen. The user is using Internet Explorer, although not sure which version at this time.

I used an ImageButton for the export button.
protected void exportToExcel_Click(object sender, ImageClickEventArgs e) {
          radGridVesselUtil.ExportSettings.IgnorePaging = true;
          radGridVesselUtil.ExportSettings.OpenInNewWindow = true;
          radGridVesselUtil.ExportSettings.ExportOnlyData = true;
          radGridVesselUtil.ExportSettings.FileName = "vessel_util_" + DateTime.Now.ToShortDateString();
          radGridVesselUtil.MasterTableView.ExportToExcel();
      }
 protected void gridDpSummary_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) {
                gridDpSummary.DataSource = SqlDataSource1;
            }


RadGridMarkup

                    
                       <telerik:RadGrid ID="radGridVesselUtil" runat="server" CellSpacing="0"
                         AllowPaging="True" AllowSorting="True" PageSize="25"
                       GridLines="None" EnableEmbeddedSkins="False" Skin="dpgrid"
                         ShowGroupPanel="True" AutoGenerateColumns="False" 
                         onneeddatasource="radGridVesselUtil_NeedDataSource">
                             <MasterTableView>
                               <CommandItemSettings ShowExportToExcelButton="true"></CommandItemSettings>
                               <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                               <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                               <Columns>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Voyage Column"
                                   HeaderText="Voyage" UniqueName="Voyage" DataField="VoyageID">
                                   <HeaderStyle Width="55px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Leg Start Column"
                                   UniqueName="LegStart" HeaderText="Start Date" DataField="LegStart">
                                   <HeaderStyle Width="125px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Leg End Column"
                                   UniqueName="LegEnd" HeaderText="End Date" DataField="LegEnd">
                                   <HeaderStyle Width="125px" HorizontalAlign="Center"/>
                                   <ItemStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Vessel Column"
                                   UniqueName="VesselName" HeaderText="Vessel" DataField="VesselName">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Facility Column"
                                   UniqueName="FacilityName" HeaderText="Facility" DataField="FacilityName">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Time Usage column"
                                   HeaderText="Time Usage" UniqueName="TimeUsage" DataField="TimeUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Volume Usage column"
                                   HeaderText="Volume Usage" UniqueName="VolumeUsage" DataField="VolumeUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Weight column"
                                   HeaderText="Weight" UniqueName="Weight" DataField="Weight">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Capacity Usage Column"
                                   HeaderText="Capacity Usage" UniqueName="CapacityUsage" DataField="CapacityUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn FilterControlAltText="Filter Deck Space Usage Column"
                                   HeaderText="Deck Space Usage" UniqueName="DeckSpaceUsage" DataField="DeckSpaceUsage">
                                   <HeaderStyle HorizontalAlign="Center"/>
                                 </telerik:GridBoundColumn>
                               </Columns>
                               <EditFormSettings>
                               <EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif" CancelImageUrl="Cancel.gif" FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                               </EditFormSettings>
                               <GroupByExpressions>
                                 <telerik:GridGroupByExpression>
                                   <SelectFields>
                                     <telerik:GridGroupByField FieldName="VoyageID" HeaderText="Voyage" />
                                   </SelectFields>
                                   <GroupByFields>
                                     <telerik:GridGroupByField FieldName="VoyageID" SortOrder="Descending" />
                                   </GroupByFields>
                                 </telerik:GridGroupByExpression>
                               </GroupByExpressions>
                             </MasterTableView>
                              <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                             <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                              <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                                 ResizeGridOnColumnResize="False"></Resizing>
                             </ClientSettings>
                              <GroupingSettings ShowUnGroupButton="true"/>
                              <FilterMenu EnableImageSprites="False"></FilterMenu>
                              <HeaderContextMenu EnableEmbeddedSkins="False" CssClass="GridContextMenu GridContextMenu_dpgrid"></HeaderContextMenu>
                       </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 27 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?