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

I have searched and tried different things for 2 days. I am exporting RadGrid to Excel. Has worked in the past and just quit working in production. Works on my local machine.

<telerik:RadGrid ID="grdCustom" AllowSorting="True" runat="server" GridLines="None" Width="100%"
                        OnExcelMLExportStylesCreated="grdCustom_ExcelMLExportStylesCreated" 
                        OnExcelMLExportRowCreated="grdCustom_ExcelMLExportRowCreated" AutoGenerateColumns="true" Style="overflow: hidden">
                        <MasterTableView UseAllDataFields="true"></MasterTableView>
                    </telerik:RadGrid>

 

When the 'Export to Excel' button is clicked, the following is executed:

        grdCustom.ExportSettings.ExportOnlyData = True
        grdCustom.ExportSettings.OpenInNewWindow = True
        grdCustom.MasterTableView.UseAllDataFields = True

        grdCustom.MasterTableView.ExportToExcel()

Like I mentioned earlier, works on my local machine but not in production environment.

 

Pavlina
Telerik team
 answered on 11 Aug 2016
19 answers
1.4K+ views

I have a radgrid using a form template to do my inserts and updates.  I was wondering how you would keep the grid in edit or update mode from the onInsertCommand/onUpdateComman event handlers?  I have tried using the onItemInserted and onItemUpdated handlers but my code never reaches the event. I would just like to display an error if validation failed. I have attached snippets of my code. 

<telerik:radgrid runat="server" id="gridSection" skin="Windows7" 
                                            OnNeedDataSource="gridSection_NeedDataSource"
                                            onitemdatabound="gridSection_ItemDataBound" 
                                            OnDetailTableDataBind="gridSection_DetailTableDataBind"  
                                            onupdatecommand="gridSection_UpdateCommand"
                                            oninsertcommand="gridSection_InsertCommand" 
                                            onitemcommand="gridSection_ItemCommand" 
                                            onprerender="gridSection_PreRender"  
                                            HierarchySettings-CollapseTooltip="Hide child defects."
                                            HierarchySettings-ExpandTooltip="View child defects."  
                                            oniteminserted="gridSection_ItemInserted" 
                                            onitemupdated="gridSection_ItemUpdated" >
protected void gridSection_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                QASectionDTO dto = convertSelectedGridSectionItemToDto(e);
                validateSection(dto);
                update(dto);
            }
            catch (Exception ex)
            {
                //display error and keep in update mode
            }
        }
  
        protected void gridSection_InsertCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                QASectionDTO dto = convertSelectedGridSectionItemToDto(e);
                validateSection(dto);
                insert(dto);
            }
            catch (Exception ex)
            {
                //display error and keep in edit mode
            }
        }
  
        protected void gridSection_ItemInserted(object sender, GridInsertedEventArgs e)
        {
            e.KeepInInsertMode = true;
        }
  
        protected void gridSection_ItemUpdated(object sender, GridUpdatedEventArgs e)
        {
            e.KeepInEditMode = true;
        }
  
        protected void validateSection(QASectionDTO dto)
        {
            if (dto.QASectionID == 0) throw new ArgumentException("A Section was not Selected.");
            if (dto.QAQuestionID == 0) throw new ArgumentException("A Question was not Selected.");
            if (dto.Result == "0") throw new ArgumentException("A Result was not Selected.");
            if (dto.QAQuestionID == 0) throw new ArgumentException("A Question was not Selected.");
            if (dto.Result.Equals("Pass") && dto.QAQuestionID.Equals("0")) throw new ArgumentException("A Defect Code was not Selected.");
            if (dto.HasChild && (dto.ChildDefectIDs.Count == 0)) throw new ArgumentException("At least one Child Defect is required.");
        }

 

Sam
Top achievements
Rank 1
 answered on 11 Aug 2016
1 answer
35 views

I'm having some issues with the datetimecolumn:

I have the same configuration in multiple pages, but in just one the Insert / Update does not work with some dates (eg: Aug 24 does not work, Aug 8 works).

I though there was some problem with the database, but also there the setup is same like the other pages (that accept all the dates).

In addition, I found out that with some other PC the the grid works as expected :-/ those PC use the same language, same region configuration...

 

I'm confused and I can't figure out why this happen.

Thanks for any comment

Maria Ilieva
Telerik team
 answered on 11 Aug 2016
1 answer
133 views

hi

i have this xml code for the panelbar and the padding left seems not working. How should i get it working? Thanks a lot.

 

<?xml version="1.0" encoding="utf-8" ?>
<PanelBar>

<Item Text="Course" Font-Size="1.1em"  ForeColor="#00a7dd">
      <Item Text="Lists" Font-Size="0.9em" style="padding-left:20px" ForeColor="#00a7dd" />   
      <Item Text="Categories" Font-Size="0.9em" style="padding-left:20px" ForeColor="#00a7dd"/>
</Item>

 

</PanelBar>

Veselin Tsvetanov
Telerik team
 answered on 11 Aug 2016
7 answers
281 views
At this point I have a RadGrid (RadGrid1) which contains a NestedTemplateView. Within this NestedTemplateView I have a RadTabStrip and a RadMultiPage View. On the first page of the RadMultiPage I have a second RadGrid(RadGrid2), which has a button to open a RadWindow. Within this RadWindow the user can select new records(saved to the source db), which I would like to appear in RadGrid2 when the RadWindow is closed. So what I am trying to figure out is how to rebind the "sender" grid (RadGrid2) and not the Parent Grid (RadGrid1). Any suggestions?
Eyup
Telerik team
 answered on 11 Aug 2016
1 answer
104 views

Hi

 

I am using radMenu with the Simple skin seems to be all css and no sprites, so lends itself to modification.

I have successfully changed the height and the text size, but I haven't managed to re-position the text to be centred vertically.

How do I do this?

my css so far is:

 .RadMenu_Simple .rmHorizontal .rmRootLink span.rmText
  {
    height: 30px !important;
    font-size:larger;
  }

Thanks

Clive

Dimitar
Telerik team
 answered on 11 Aug 2016
1 answer
77 views

Using an older version of telerik, we have a control formed like so:

[code]
<asp:DropDownList ID="ddlField" Visible="false" runat="server" AutoPostBack="true"
    Height="20px" Width="126px" AppendDataBoundItems="True" DataSourceID="FieldLookupDS"
    DataTextField="FieldName" DataValueField="FieldPk" CausesValidation="True">
</asp:DropDownList>
<telerik:RadComboBox runat="server" ID="radCbField" DataSourceID="FieldLookupDS"
    DataTextField="FieldName" DataValueField="FieldPk" Width="130px" AllowCustomText="true"
    Text="Select">
    <ItemTemplate>
        <asp:CheckBox runat="server" ID="cbField" AutoPostBack="true" Text='<%#Eval("FieldName")%>' />
    </ItemTemplate>
</telerik:RadComboBox>
[/code]

Without change, the old version of the telerik controls allow us to select multiple items in a drop down list with checkboxes, while the default option field remains in place. After updating to a newer version of telerik, clicking on the checkboxes themselves maintains he same effect, but clicking on the label makes that label appear in the option field instead of the desired default prompt. This has been verified by simply switching the versions we are using. 

Is there any guidance on how to re-implement this functionality in newer versions? 

Ivan Danchev
Telerik team
 answered on 11 Aug 2016
1 answer
119 views

I'm getting very odd paging when I apply filters to certain grids, while others seem to be working correctly with basically the same code. What happens if I have my row result set to 25 and have 2 pages of results then I filter which only returns 5 results, the pager still shows two pages and the count still says page 1 of 2 and rows 1-25 of 26. I've attached some screen shots so you can see exactly what I'm referring to. What's worse is if you click on the pager to go to the next page it's blank and the pager control disappears. 

Here's the basic header stuff for the Grid, if you need more let me know:

<telerik:RadGrid ID="rgActionItems"
    OnItemCommand="rgActionItems_ItemCommand"
    OnItemDataBound="rgActionItems_ItemDataBound"
    ClientSettings-ClientEvents-OnGridCreated="radGrid_CreatedMaxHeight"
    ClientSettings-Scrolling-AllowScroll="true"
    runat="server"
    AllowPaging="True"
    AllowSorting="True"
    AutoGenerateColumns="False"
    CellSpacing="0"
    ClientSettings-AllowColumnsReorder="false" ClientSettings-Resizing-AllowColumnResize="false" ClientSettings-Scrolling-UseStaticHeaders="true"
    EnableLinqExpressions="False"
    ExportSettings-ExportOnlyData="true" ExportSettings-IgnorePaging="true" ExportSettings-OpenInNewWindow="true" ExportSettings-HideStructureColumns="true"
    GridLines="None"
    GroupingSettings-CaseSensitive="false" MasterTableView-AllowMultiColumnSorting="false" MasterTableView-AllowNaturalSort="false" AllowFilteringByColumn="true" MasterTableView-CommandItemDisplay="Top"
    MasterTableView-CommandItemSettings-ShowAddNewRecordButton="false"
    MasterTableView-CommandItemSettings-ShowRefreshButton="false"
    MasterTableView-CommandItemSettings-ShowExportToCsvButton="false"
    MasterTableView-CommandItemSettings-ShowExportToExcelButton="true" ExportSettings-Excel-Format="Xlsx"
    MasterTableView-CommandItemSettings-ShowExportToPdfButton="true" ExportSettings-Pdf-AllowCopy="true" ExportSettings-Pdf-AllowPrinting="true" ExportSettings-Pdf-AllowModify="true"
    MasterTableView-CommandItemSettings-ShowExportToWordButton="true" ExportSettings-Word-Format="Docx"
    PageSize="25"
    PagerStyle-PageSizes="25,50,100"
    PagerStyle-AlwaysVisible="true" PagerStyle-EnableAllOptionInPagerComboBox="true"
    MasterTableView-PagerStyle-PagerTextFormat="{4} Page {0} of {1}, rows {2} to {3} of {5}"
    MasterTableView-PagerStyle-Position="TopAndBottom"
    MasterTableView-PagerStyle-PageButtonCount="10"
    MasterTableView-PagerStyle-EnableAllOptionInPagerComboBox="false"
    MasterTableView-TableLayout="Fixed"
    >
    <MasterTableView>
        <SortExpressions>
            <telerik:GridSortExpression FieldName="" SortOrder="Ascending" />
        </SortExpressions>
        <NoRecordsTemplate>
            <asp:Label ID="Label1" Text="No Records Found" runat="server" />
        </NoRecordsTemplate>
        <Columns>

 

Thanks

Rodney

 

 

Eyup
Telerik team
 answered on 11 Aug 2016
3 answers
110 views

when I m using signalr scripts in my master page all of radwindow in my project stop working fine

when I comment scripts like belowe rad window clients event start working
    <link rel="shortcut icon" href="Content/images/favicon.ico" />

<%--<script src="Scripts/jquery-1.6.4.js" type="text/javascript"></script>
<script src="Scripts/json2.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-1.0.0-rc2.min.js" type="text/javascript"></script>
<script src="signalr/hubs" type="text/javascript"></script>--%>

<script src="Content/lib/jquery.msgBox.min.js"></script>
<link href="Content/css/msgBoxLight.css" rel="stylesheet" />
   

Danail Vasilev
Telerik team
 answered on 11 Aug 2016
3 answers
346 views

Hi -

I am looking for a way to fix a radHTMLchart where the series labels extend outside of the chart boundary as shown in the attached picture.

My work around is to set the chart.PlotArea.LabelsAppearance.TextStyle.Margin = "-3" so the series label will appear very close to the end of the bar, but I would like to know if there is a better solution.

Thanks,

Cecilia Daniels

Danail Vasilev
Telerik team
 answered on 11 Aug 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?