Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
325 views
Hello,

I have below code and when I drag groups to the groupingbar the grid shows me the group totals in the groupfooter. However when I export the grid to ExcelML, the grouping structure is there, but the groupfooters with their totals are lost. I have read several suggestions through using the OnExcelMLExportRowCreated and OnExcelMLExportStylesCreated to get what I want, but somehow I can't get it to work. Could you point me in the right direction?

ASPX Code (the grid is ajaxified through telerik RadAjaxManager)

<telerik:RadGrid ID="rg" runat="server" Skin="Office2007"
    AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
    GridLines="None" ShowStatusBar="True" OnNeedDataSource="rg_NeedDataSource" EnableLinqExpressions="False"
    PageSize="20" Width="100%" ShowGroupPanel="True"
    OnColumnCreated="rg_ColCreated" OnItemDataBound="rg_ItemDataBound"
    OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated"
    OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated"
    meta:resourcekey="rgResource1">
    <GroupingSettings ShowUnGroupButton="True" />
    <ExportSettings ExportOnlyData="True" IgnorePaging="True" >
        <Excel Format="ExcelML" />
    </ExportSettings>
    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"
        ColumnsReorderMethod="Reorder" ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <Resizing AllowColumnResize="True" />
        <Animation AllowColumnReorderAnimation="True" />
    </ClientSettings>
    <MasterTableView AllowMultiColumnSorting="True" ClientDataKeyNames="oid"
        DataKeyNames="oid" GroupLoadMode="Client" ShowFooter="True"
        ShowGroupFooter="True" UseAllDataFields="True">
        <NoRecordsTemplate>
            <div>
                Geen items gevonden.</div>
        </NoRecordsTemplate>
        <CommandItemSettings ExportToPdfText="Export to Pdf" />
    </MasterTableView>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007"
        EnableImageSprites="True">
    </HeaderContextMenu>
</telerik:RadGrid>

Code behind (C#):

protected void rg_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
         
 
        DataTable dt = new DataTable();
 
 
        if (ddlGebruikers.SelectedValue == "-2") return;
        if (cbQuarter.Checked)
        {
            dt = getQuarterData();
        }
        else if (cbMonth.Checked)
        {
            dt = getMonthData();
        }
 
        rg.DataSource = dt;
}
 
protected void rg_ColCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridBoundColumn)
        {
            GridBoundColumn col = (GridBoundColumn)e.Column;
            if (col.UniqueName == "Q1" || col.UniqueName == "Q2" || col.UniqueName == "Q3" || col.UniqueName == "Q4")
            {
                col.Aggregate = GridAggregateFunction.Sum;
            }
            else if (col.UniqueName == "QR1" || col.UniqueName == "QR2" || col.UniqueName == "QR3" || col.UniqueName == "QR4")
            {
                col.Aggregate = GridAggregateFunction.Sum;
            }
        } 
}

Kostadin
Telerik team
 answered on 03 Nov 2014
3 answers
187 views
In my radgrid, on click of AddNewRecord, I open a user control with a search textbox and button. To hide the AddNewRecordButton and Header I have on RadGrid1_ItemCommand I have the following:
if (e.CommandName == RadGrid.InitInsertCommandName)
{
         this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
         this._RadGrid1.MasterTableView.ShowHeader = false;                     
 }
But when the search textbox retrieves results and I select one of the entries, a postback is done to display the selected the value, after which the header and AddNewRecordButton are again visible though, the user control is still open. Is there a way to hide it after the postback?
Eyup
Telerik team
 answered on 03 Nov 2014
1 answer
100 views
Hi,

In out project, we are dynamically creating RadGrid and Merging rows 

It is not working when user control which contains RadGrid loads first time but when postback occurs it is working i.e  it shows merged rows.

Please let me know what problem is causing this behaviour. 

This is urgent so please let us know as soon as possible

Thanks in advance


Pavlina
Telerik team
 answered on 03 Nov 2014
1 answer
99 views
I have a grid with a GridClientSelect column. Clicking anywhere in the row other than the checkbox for that row causes all other selected/checked rows to deselect. How do I stop this. I want the row to only be selected by clicking the checkbox. I have shown in attached screenshots.
Pavlina
Telerik team
 answered on 03 Nov 2014
10 answers
1.6K+ views
Hi,

I have a quick question.

I'm trying to implement the RadGrid in BatchEdit mode.

I need to customise validation on some fields, and to do so I need to 'wire up' the event behind 'Add new record' button embedded on the grid.
E.g. the user added a new row/record and before adding another one I need to validate the added data.

I'm able to capture the events behind the 'Save changes' and 'Cancel changes' grid buttons but haven't been able to track down the 'Add new record'.

What are the client side and server side events behind this button?

Thank you in advance.

Konstantin Dikov
Telerik team
 answered on 03 Nov 2014
1 answer
153 views
Hi,

The RadAutoCompleteBox allows me to select items that were already selected.
That way it allows the user to duplicate items selected.

I't happens the same way on that sample http://demos.telerik.com/aspnet-ajax/autocompletebox/examples/default/defaultcs.aspx

When i press 'n' and select Nancy. It goes to the box.
Then i press 'n' and select Nancy again. The i get 2 Nancyes on the box.

Is it expected?
Can i prevent it from showing selected items on the Drop Down?

Thanks in advance.
Nencho
Telerik team
 answered on 03 Nov 2014
14 answers
216 views
Hi,

Which Telerik control should I use for a Wizard Based ASP.NET Pages? Does Telerik have something similar to Microsoft ASP Wizard Control?

Thanks
Rumen
Telerik team
 answered on 03 Nov 2014
1 answer
142 views
when executing telerik demos, there is a dropdown list displayed by default and contains a default item.
I need to remove this dropdown but, i do not know How?

the code of this dropdown in view source:
<tr class="rcbReadOnly">
<td class="rcbInputCell rcbInputCellLeft" style="width:100%;"><input name="SkinChooser" type="text" class="rcbInput radPreventDecorate" id="SkinChooser_Input" value="Default" readonly="readonly" autocomplete="off"></td><td class="rcbArrowCell rcbArrowCellRight"><a id="SkinChooser_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a></td>
</tr>
Nencho
Telerik team
 answered on 03 Nov 2014
2 answers
182 views
I have a page with Radtreeview enable drag & drop. I implement a radconfirm to check exist node name when drop nodes

Script on client node dropping

 
function onNodeDropping(sender, args) {
           var dest = args.get_destNode();
           var source = args.get_sourceNode();
           if (dest) {
               var result = false;
               for (var i = 0; i < dest.get_nodes().get_count() ; i++) {
                   var node = dest.get_nodes().getNode(i);
                   if (node.get_text() == source.get_text()) {
                       result = true;
                       break;
                   }
               }
               if (result) {
                   callConfirm(source.get_text());
                   return;
               }
           }
           else {
               dropOnHtmlElement(args);
           }
       }

And code to call confirm :

function callConfirm(nodeText) {
                        radconfirm(nodeText + ' folder is existing, Do you want to overwrite?', confirmCallBackFn);
                        return false;
                    }
                    function confirmCallBackFn(arg) {
                        var ajaxManager = $find("<%=RadAjaxManager1.ClientID%>");
                   if (arg) {
                       ajaxManager.ajaxRequest('ok');
                   }
                   else {
                       ajaxManager.ajaxRequest('cancel');
                   }

Code of RadAjaxManager1_AjaxRequest
if (e.Argument.ToString() == "ok")
            {
                lbStatus.Text = "OK";
            }
            else if(e.Argument.ToString() == "cancel")
            {
                lbStatus.Text = "Cancel";
            }

But when drop an item on Radtreeview to another Node that the same node name, RadTreeView_NodeDrop event always fire before RadAjaxManager1_AjaxRequest. How to solve it?


Hristo Valyavicharski
Telerik team
 answered on 03 Nov 2014
2 answers
1.4K+ views
Hi,

I wonder how to bind a ComboBox in the new Control DataForm.

I have created a script as follows.

aspx
....
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="100%" Width="100%" HorizontalAlign="NotSet" LoadingPanelID="baseLoadingPanel" OnAjaxRequest="RadAjaxPanel2_AjaxRequest">
            <telerik:RadDataForm ID="detailsView" runat="server" OnPreRender="detailsView_PreRender">
                <ItemTemplate>
                    <table class="InputTable" border ="1">
                        <tr>
                            <td>
                                   <telerik:RadComboBox ID="comboBoxItem" runat="server"  SelectedValue='<%# Eval("item") %>' Width="100%" ValueType="System.String">
                                   </telerik:RadComboBox>
                            </td>
                        </tr>
...


aspx.cs
protected void detailsView_PreRender(object sender, EventArgs e)
{
    RadComboBox comboBox = (RadComboBox)detailsView.FindControl("comboBoxItem");
    if(comboBox!=null)
    {
        DataTable dataTable = new DataTable();
        dataTable = SelectCommonCode(codeKind, whereclause);
 
        comboBox.DataSource = dataTable;
        comboBox.DataTextField = "codename";
        comboBox.DataValueField = "code";
        comboBox.DataBind();
    }
         
}

however, if(comboBox!=null)  <---- here is always null.

Please tell me the right way.

thx
Yoongu
Top achievements
Rank 1
 answered on 03 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?