Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
138 views
Hi!
I wanted to export several radgrids to a Word document, so I found out an example that suggested to wrap the grids into a global grid.
That's what I've done with the structure below: 
The problem I'm facing is in my Word document there is a string with the literal "Item" below the caption "This is the caption" and before my inner radgrid. 
I'm never setting this string, so I guess it's a default value I don't even know how to change. I don't know how to hide it in the Word document, although I managed to hide it with css in the web layer. 
Any suggestion would be appreciated, 

Thanks in advance,

Mary.

 <telerik:RadGrid ID="RadGridWrapper" runat="server" BorderStyle="None" ShowHeader="false" ShowFooter="false"    
        OnGridExporting="OnGridExporting"> 
        <MasterTableView AutoGenerateColumns="true" ShowHeadersWhenNoRecords="true" 
        NoMasterRecordsText="<%$ Resources:GlobalResources, NoResults%>"
        ShowHeader="true" ShowFooter="false" Caption="This is the caption"  >
            <ItemTemplate>
                <telerik:RadGrid ID="RadGrid1" runat="server"
                 GridLines="Both" Skin="Windows7"
                    HorizontalAlign="Center" AutoGenerateColumns="false"
                     OnNeedDataSource="RadGrid_NeedDataSource1" >
<MasterTableView> ... </MasterTableView>
    </telerik:RadGrid>
    <telerik:RadGrid ID="RadGrid2" runat="server" GridLines="Both" 
                OnNeedDataSource="RadGrid_NeedDataSource2"
                    Skin="Windows7" HorizontalAlign="Center" AutoGenerateColumns="false">
<MasterTableView> ... </MasterTableView>
    </telerik:RadGrid>
  </ItemTemplate>           
        </MasterTableView>
    </telerik:RadGrid>


Kostadin
Telerik team
 answered on 31 Jul 2013
2 answers
122 views

Hi there

I am exporting a Grid in Biff Format which is successfully exporting - however I want to allow the user to be able to change values in one column only (e.g column 3)

If the user attempts to changes any other columns they would get a warning from Excel advising them the cell is protected.

I believe this can be done in the "ExcelMLWorkBookCreated" but am not sure what the code needs to be so it can loop through all the columns - below is what I have so far....

Any help much appreciated....

protected void gridPricing_ExportToExcel_ExcelMLWorkBookCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExcelMLWorkBookCreatedEventArgs e)
       {
           e.WorkBook.Worksheets[0].IsProtected = true;
           StyleElement protectionStyle = new StyleElement("ProtectionStyle");
           protectionStyle.CellProtection.IsProtected = false;
           e.WorkBook.Styles.Add(protectionStyle);
             
           foreach (ColumnElement column in e.WorkBook.Worksheets[0].Table.Columns)
           {
               int columnindex = e.WorkBook.Worksheets[0].Table.Columns.IndexOf(column);
               if (columnindex == 3)
               {
                    
                   //code NEEDED in here needs to loop through cells or columns 
                   //and get cellelement or columnelement
                   // so I can set the cell.stylevalue for this column
               }
           }
Kostadin
Telerik team
 answered on 31 Jul 2013
2 answers
70 views
Hi

I have come across a strange behavior with the numerictextbox. There are four radtabs and the second tab has a numerictextbox in it. If I enter something inside it and suddenly move to another tab, value is lost. But if I move to another tab on clicking outside the numerictextbox value persists. Is it a bug?

Thanks
Anu
Shinu
Top achievements
Rank 2
 answered on 31 Jul 2013
5 answers
113 views
Hi telerik

In a radmonthyearpicker, please help me to access the today button to give my own text and styling.

Thankyou
Anu
Shinu
Top achievements
Rank 2
 answered on 31 Jul 2013
2 answers
146 views
Hello,

I am currently using radgrid client-side databinding, very similar to the example here: http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspx

What I want to do is have the user page, sort, filter, select rows, etc and have the server-side code capturing those values in session.  If for any reason the page is refreshed, I want to initialize the grid back to those session values (sort/filter/page/selected row).

I can get almost all of this working with the exception of the page index.  It appears to work, but then the grid immediately fires a page change back to page 0.

Any insight into why this is happening?



Yew
Top achievements
Rank 1
 answered on 31 Jul 2013
2 answers
689 views
Hi

How can I add a icon to the right most position in a Radtextbox?

Thanks for replying
Katya
Gabriel
Top achievements
Rank 2
 answered on 30 Jul 2013
1 answer
178 views
Hi,

 I need to disable some fields on the client side on page load that I will later enable via JavaScript.  Doing this from the server side is not supported so I'm doing this by calling a JavaScript function from the jquery document ready as in:
$(document).ready(function() {
                                                        // Handler for .ready() called.
                                                        initialize();
                                                        //setVisibleMarkers();
                                                        alert("document.ready");
                                                        enableMailingLabelsButton();
                                                        EnableCustomTemplates();
                                                    });

the enableMailingLabelsButton is as follows:

function enableMailingLabelsButton()
{
     
    var btnPrintMailingLabels = document.getElementById('<%=btnPrintMailingLabels.ClientID%>');
    var btnRefresh = document.getElementById('<%=btnRefresh.ClientID%>');
    var ddlMailingList = document.getElementById('<%=ddlMailingList.ClientID %>');
    var rdoSelectNew = document.getElementById('<%=rdoSelectNew.ClientID %>');
    var rdoSelectDefault = document.getElementById('<%=rdoSelectDefault.ClientID %>');
    var rdoSelectDateRange = document.getElementById('<%=rdoSelectDateRange.ClientID %>');
    var rdoPreviousDataSet = document.getElementById('<%=rdoPreviousDataSet.ClientID %>');
    var txt1ClickNumberToPrint = $find('<%= txt1ClickNumberToPrint.ClientID %>')
    var txtDateRangeNumberToPrint = $find('<%= txtDateRangeNumberToPrint.ClientID %>')
    var rdiStartDate = $find('<%= rdiStartDate.ClientID %>')
    var rdiEndDate = $find('<%= rdiEndDate.ClientID %>')
 
    if (rdoSelectNew.checked == true)
    {
        //alert(rdiStartDate);
        rdiStartDate.disable();
        rdiEndDate.disable();
        txt1ClickNumberToPrint.disable();
        txtDateRangeNumberToPrint.disable();
        ddlMailingList.disabled = true;
        btnPrintMailingLabels.disabled = true;
        btnRefresh.disabled = true;
    }
    else if (rdoSelectDefault.checked == true)
    {
        rdiStartDate.disable();
        rdiEndDate.disable();
        txt1ClickNumberToPrint.enable();
        txtDateRangeNumberToPrint.disable();
        ddlMailingList.disabled = true;
        btnRefresh.disabled = false;
        btnPrintMailingLabels.disabled = true;
    }
    else if (rdoSelectDateRange.checked == true)
    {
        rdiStartDate.enable();
        rdiEndDate.enable();
        txt1ClickNumberToPrint.disable();
        txtDateRangeNumberToPrint.enable();
        ddlMailingList.disabled = true;
        btnRefresh.disabled = false;
        btnPrintMailingLabels.disabled = true;
    }
    else if (rdoPreviousDataSet.checked == true)
    {
     
        rdiStartDate.disable();
        rdiEndDate.disable();
        txt1ClickNumberToPrint.disable();
        txtDateRangeNumberToPrint.disable();
        ddlMailingList.disabled = false;
        btnRefresh.disabled = false;
        if (ddlMailingList.selectedIndex >= 0 ) {
            //       alert("making labels active");
            btnPrintMailingLabels.disabled = false;
        }
        else {
            //       alert("making labels inactive");
            btnPrintMailingLabels.disabled = true;
        }
    }
}

The line var txt1ClickNumberToPrint = $find('<%= txt1ClickNumberToPrint.ClientID %>')  
shows a null after execution 
in the  txt1ClickNumberToPrint field, so when trying to disable this field the javascript throws an error on
page load and stops executing only in IE 10 on first load.  once the page is loaded things work fine also
Chrome does not have an issue at all.  I'd appreciate any help.  Here is the markup for that section.

<fieldset style="width:100%;">
<legend>Select Your Data Set:</legend>
<table class="signup-label" cellpadding="5px">
<tr>
<td ><asp:RadioButton Checked="true" runat="server" ID="rdoSelectNew" GroupName="select" /></td>
<td align="left" valign="baseline">Just my NEW leads please!</td>
</tr>
<tr>                                           
<td><asp:RadioButton runat="server" ID="rdoSelectDefault" GroupName="select" /></td>
<td align="left" valign="baseline">The most recent <telerik:RadNumericTextbox ID="txt1ClickNumberToPrint" runat="server" NumberFormat-DecimalDigits="0" Width="50px"></telerik:RadNumericTextbox> leads!</td>
</tr>
<tr>                                           
<td><asp:RadioButton runat="server" ID="rdoSelectDateRange" GroupName="select" /></td>
<td align="left" valign="baseline">The most recent <telerik:RadNumericTextbox ID="txtDateRangeNumberToPrint" runat="server" NumberFormat-DecimalDigits="0" Width="50px"></telerik:RadNumericTextbox> leads between the start date of <telerik:RadDateInput ID="rdiStartDate" runat="server"></telerik:RadDateInput>  and the end date of <telerik:RadDateInput ID="rdiEndDate" runat="server"></telerik:RadDateInput>!</td>
</tr>
<tr>                                           
<td><asp:RadioButton runat="server" ID="rdoPreviousDataSet" GroupName="select" /></td>
<td align="left" >
<table cellpadding="2">
<tr>
<td>An Existing Mailing List:</td>
<td><asp:DropDownList ID="ddlMailingList" runat="server"  SkinID="ExtraWideDll" DataTextField="Name" DataValueField="ID"></asp:DropDownList></td>
<td><asp:ImageButton class="norm" ID="btnRefresh" runat="server" AlternateText="Refresh" ToolTip="Refresh the list of Mailing Lists" ImageUrl="./images/Refresh.gif" onclick="btnRefresh_Click" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" colspan="2" ><asp:Button ID="btnGetData"  runat="server" Text="Print" onclick="btnGetData_Click" ToolTip="Print using the selected template!" />
<asp:Button ID="btnPrintMailingLabels"  runat="server" ToolTip="Print Mailing Labels for an existing mailing list!"
                                                        Text="Get Mailing Labels" onclick="btnPrintMailingLabels_Click"  /><img title="Use the 'Print' Button to create a new mailing list, then use the 'Get Mailing Labels' button to get the mailing labels for the Mailing List." class="tooltip" src="./images/question.png" /></td>
</tr>
<tr>
<td align="left" colspan="2" ><asp:Label CssClass="error" runat="server" ID="lblMessage"></asp:Label></td>
</tr>
</table>
</fieldset>



Jonathan
Top achievements
Rank 1
 answered on 30 Jul 2013
3 answers
137 views
Using the demo located here:
http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultvb.aspx

The validators are allowing a post back with EnableClientScript = true, despite displaying that there is an error case.

Steps to reproduce:

1) New web form application
2) New web form
3) Copy code into aspx and codebehind
4) Add a radscriptmanager, removing the masterpage reference [which i cannot find a copy of], and removing the asp:content panels
5) Override OnLoad and insert a breakpoint
6) Run the form with client mode on, breakpoint is hit despite all the validators triggering.
7) Repeat tests in all browsers - all fail.
What am I doing wrong?

Update for clarification:
The validators fire, but they still cause a postback (is this intentional?) and server side they do not flag Page.IsValid as true or false.
Blair
Top achievements
Rank 1
 answered on 30 Jul 2013
4 answers
591 views
Hi,

I have a RadGrid with EditForm Template for Editing.
for Example:
I want to have:
 * When I double click a row it has to Change Editmode to:
<MasterTableView EditMode="InPlace"
Like this:
function RowDblClick(sender, eventArgs) {
      // insert Code here to change EditMode to EditMode="InPlace"
      // then open the row for editing
      editedRow = eventArgs.get_itemIndexHierarchical();
      $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow);
    }

 hence, the Default mode is the EditForm Template, so when I click on Edit button it will open the form for editing.

any Help it will be apperciated,
Thanks
Mahmoud
Top achievements
Rank 1
 answered on 30 Jul 2013
1 answer
95 views
I have a RadListBox with multi-select turned on.  On selection of another list control, in the code-behind of the other list control, I get its value, then select records from a database, and want to select the corresponding items in the RadListBox (called "listWho" below).  When walking thru the code, it is selecting the list box items, but, after postback, the list box shows not selected items.  Why?

Here is the code.  Any help appreciated.  Dan

<telerik:RadListBox ID="listWho" runat="server" DataSourceID="dsScheduleWho" TabIndex="2"
DataTextField="wholist" DataValueField="pk" Height="120px" Width="169px"
Skin="Vista" SelectionMode="Multiple" OnClientLoad="listWho_ClientLoad">
</telerik:RadListBox>
 
 
protected void DistGroup_SelectedIndexChanged(object sender, EventArgs e)
{
   string itemValue;
   DropDownList ddl = sender as DropDownList;
   string DG_cpk = ddl.SelectedValue;
 
   try
   {
       RadListBox rlb = (RadListBox)pageform.FindControl("listWho");
       DataAccess sda = new DataAccess();
       sda.RunSelectCmd("select cpk_users from users inner join DG_Users_Link DUL on users.CPK_USERS = DUL.Cfk_Users and DUL.DELFLAG=0 "
           + "inner join DistributionGroups DG on DUL.Cfk_DistributionGroups=DG.CPK_DistributionGroups and DG.delflag=0 "
           + "where users.DELFLAG=0 and DG.CPK_DistributionGroups=" + DG_cpk);
 
       if (!sda.blNoRecords)
       {
           foreach (DataRow dr in sda.dtResult.Rows)
           {
               itemValue = dr["cpk_users"].ToString();
               RadListBoxItem rlbi = rlb.FindItemByValue(itemValue);
               rlbi.Selected = true;
           }
       }
Dan
Top achievements
Rank 2
 answered on 30 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?