Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Hello everyone,

 I have a gridview that has a link button in it. Whenever the user clicks on the link button they are redirected to a  web page. the web page is same, but displays different data. There is a button at the top of the gridview that says export to MS word. whenever that button is clicked, I need to export all the web pages that the link button  redirects to into ms word. so for e.g.

A                B                C
12              xyz               PQR
13              RST             jpn

Clicking on any item in column  C redirects to a web page.
I want that when the user clicks on the ms word button then all these web pages are exported to MS word as seperate pages.

Please let me know if it is possible. I want to know if there is any elegant solution in Telerik controls.

Any help will be greatly appreciated.
Tsvetoslav
Telerik team
 answered on 07 Jun 2011
2 answers
206 views
Hi,

I'm wondering if there's an easy way to always displays both of the sort icons (up and down) for all columns in a grid, (when AllowNaturalSort is set to false), all of the time. I know I can add the icons to the header cell myself, but was wondering if there was a cleaner approcach.

I know that the out of the box functionality is for a column to be clicked on, then the sort an icon appears beside the title letting the user see the column that we're sorting on and allowing them to "reverse" the sort.

The reason for this is the business user wants to limit the number of mouse clicks used for sorting... if this makes sense :-)

Thanks in advance for your help.


Rgds
Liam
Liam
Top achievements
Rank 1
 answered on 07 Jun 2011
1 answer
40 views
Hi All,

I would like to ask that I am migrating from Classic RadMenu to ASP.NET AJAX radMenu, following is my code for Classic control. Can any please tell me code for ASP.NET AJAX



MenuGroup TopGroup = new MenuGroup(rmColumnPicker);
TopGroup.CssClass = "CP_MenuGroup";
rmColumnPicker.RootGroup = TopGroup;


Telerik.WebControls.MenuItem miRoot = new Telerik.WebControls.MenuItem(this.rmColumnPicker.RootGroup);
miRoot.ID = "miRoot";
miRoot.Width = 164;
miRoot.Text = "Column Picker";
miRoot.RightLogo = "../RadControls/Menu/Skins/IWFAlertMenu/dropdown.gif";
miRoot.RightLogoDisabled = "../RadControls/Menu/Skins/IWFAlertMenu/dropdownDisabled.gif";
miRoot.RightLogoClicked = "../RadControls/Menu/Skins/IWFAlertMenu/dropdown.gif";
miRoot.CssClass = "CP_MainItem";
miRoot.CssClassOver = "CP_MainItemOver";
miRoot.CssClassDisabled = "CP_MainItemDisabled";
this.rmColumnPicker.RootGroup.AddItem(miRoot);

rmColumnPicker is my Classic RADMENU
Shinu
Top achievements
Rank 2
 answered on 07 Jun 2011
1 answer
129 views
I can't seem to get to the grid in a function
the function throws a null object error
        <telerik:RadGrid ID="rgEditOrder" OnNeedDataSource="rgEditOrder_NeedDataSource" OnItemCommand="rgEditOrder_ItemCommand" OnItemUpdated="rgEditOrder_UpdateRow" OnItemCreated="rgEditOrder_OnItemCreated" runat="server">
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView DataKeyNames="OrderSeq" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="False" EditMode="InPlace" >
        <Columns>
            <telerik:GridBoundColumn UniqueName="StoreNumber" DataField="StoreNumber" HeaderText="Store #" DataFormatString="{0:#####}" DataType="System.Int32" ReadOnly="True">
                <HeaderStyle Width="40px" />
            </telerik:GridBoundColumn>
a bunch of columns
            <telerik:GridTemplateColumn UniqueName="Qty" HeaderText="Cases" >
                <ItemTemplate>
                    <asp:Label ID="lblQty" Text='<%# Bind("Qty") %>' Width="40px" runat="server" />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="rntbQty" Text='<%# Eval("Qty") %>' MinValue='<%# Bind("Qty") %>' Width="40px" runat="server">
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <HeaderStyle Width="40px" />
            </telerik:GridTemplateColumn>
more columns
            <telerik:GridBoundColumn UniqueName="OrderSeq" DataField="OrderSeq" DataType="System.Int64" Visible="false">
            </telerik:GridBoundColumn>
        </Columns>
        </MasterTableView>
        <ClientSettings EnablePostBackOnRowClick="true" >
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
        </telerik:RadGrid>
<head id="Head1" runat="server">
<title>Edit Order</title>
<script language="javascript" type="text/javascript">
<!--
// this function handles the onbeforeprint event of the body object
function window_onbeforeprint()
{
    // idprint is the id assigned to the div tag of the javascript
    // injected into the response object in the code behind which
    // actually prints the screen
    var divEle = document.getElementById("idPrint");
    // remove the display=none i.e. show the div element
    if (divEle != null)
    {
         divEle.style.display = "";
    }
 
    // hide the div elements
    idShow.style.display="none";
  //  idShow.style.display="none";
  //  idShow1.style.display="none";
    idShow1.style.display="none";
    idHeader.style.display="none";
}
// this function handles the onafterprint event of the body object
function window_onafterprint()
{
    // idprint is the id assigned to the div tag of the javascript
    // injected into the response object in the code behind which
    // actually prints the screen
    var divEle = document.getElementById("idPrint");
    // hide the div element
    if (divEle != null)
    {
         divEle.style.display = "none";
    }
 
    // remove the style.display='none'-show the div element
    idShow.style.display="";
 //   idShow1.style.display="";
    idShow1.style.display="";
    idHeader.style.display="";
}
var idx = 0;
function RowDblClick(sender, eventArgs) {
    idx = eventArgs.get_itemIndexHierarchical();
    sender.get_masterTableView().editItem(idx);
}
 
// this function is called on the click event of the Finalize Order button
// it is wired to the button in the page load event  
function check_input() {
    // both the first and last name need to be entered-if either of them is not
    // popup message box and cancel update
    var strName = document.getElementById('txtFirstName');
    if (trim(strName.value) == "") {
        alert("Please Enter First Name");
        return (false);
 
    }
    strName = document.getElementById('txtLastName');
    if (trim(strName.value) == "") {
        alert("Please Enter Last Name");
        return (false);
    }
    return (true);
}
// use regular expression to format first or last name
// per Derek-remove any imbedded white space
function trim(str) {
    return str.replace(/^\s+|\s+$/g, '');
}
// this functiom was added because the code behind is looking for it 
function PrintPage() {
    return true;
}
-->
</script>
</head>
protected void rgEditOrder_OnItemCreated(object source, GridItemEventArgs e)
{
    StringBuilder sb;
    GridEditableItem geItem;
    TableCell tcQty;
    RadNumericTextBox rntbQty;
    char DoubleQuote;
    string EscapeChar,str;
     
    DoubleQuote = (char) 34;
    sb = new StringBuilder(DoubleQuote);
    EscapeChar = sb.ToString();
    str = DoubleQuote.ToString();
    if (e.Item.IsInEditMode)
    { }
    else
        return;
 
    if (e.Item is GridEditableItem)
    { }
    else
        return;
 
    geItem = (GridEditableItem)(e.Item);
    sb = new StringBuilder("<script language=");
    sb.Append(@"'");
    sb.Append("javascript");
    sb.Append(@"'");
    sb.Append(" ");
    sb.Append(@"'");
    sb.Append("text/javascript");
    sb.Append(@"'");
    sb.Append(">");
    sb.Append("function QtyOnValueChanged(sender, eventArgs) { ");
    sb.Append("alert(");
    sb.Append(@"'");
    sb.Append("gorkomatic");
    sb.Append(@"'");
    sb.Append("); ");
    sb.Append("var grid = $find(");
    sb.Append(@"'");
    sb.Append("<%= ");
    sb.Append("rgEditOrder.ClientID");
    sb.Append(" %>");
    sb.Append(@"'");
    sb.Append(").get_masterTableView(); ");
    sb.Append("grid.updateItem(grid.get_dataItems()[");
    sb.Append(geItem.DataSetIndex.ToString());
    sb.Append("].get_element()); ");
    sb.Append("alert(");
    sb.Append(@"'");
    sb.Append("qty on value changed");
    sb.Append(@"'");
    sb.Append("); }");
    sb.Append("</script>");
    str = sb.ToString();
    rcBlock.Controls.Add(new LiteralControl(str));
 //   ScriptManager.RegisterStartupScript(this,this.GetType(), "Update", str, false);
     
    tcQty = geItem.Cells[1];
    rntbQty = (RadNumericTextBox)tcQty.FindControl("rntbQty");
    if (rntbQty == null)
        return;
    rntbQty.ClientEvents.OnValueChanged = "QtyOnValueChanged";
}
Veli
Telerik team
 answered on 07 Jun 2011
0 answers
277 views
Please, find attached a sample working project, which demonstrates how to enable MS Word spell check provider of RadSpell for ASP.NET AJAX.

Microsoft Word support is not enabled by default for RadSpell. Follow the steps below to enable it:
  1. You need to have installed Microsoft Word on your server.
  2. Put the WordSpellCheckProvider.cs provider in the App_Code folder (the provider is available in the attachment).
  3. Put the Microsoft.Office.Interop.Word.dll and Microsoft.Vbe.Interop.dll in the project's /bin folder (both dll files are available in the attachment)
  4. Set the SpellCheckProviderTypeName property of RadSpell:

    RadSpell1.SpellCheckProviderTypeName = typeof(Telerik.Web.UI.WordSpellCheckProvider).AssemblyQualifiedName;

    The SpellCheckProviderTypeName property of RadSpell allows the developers to specify a custom spell check provider (in our case it is WordSpellCheckProvider.cs) instead of the default one.
  5. Configure the web site in the web.config to use ASP.NET impersonation (see also <identity> Element):

    <system.web>
          <identity impersonate="true" userName="domain\username"
              password="xxxxxxx"/>
              ...
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 07 Jun 2011
3 answers
243 views
I want to get the filtered data source after applying filtering using RadFilter. Or alternatively, I want to get the filter expression that I can apply to my original data source to get the filtered results. Please let me know how to do this. Thanks in advance.
Iana Tsolova
Telerik team
 answered on 07 Jun 2011
8 answers
118 views
Hi Telerik Team,

I am having problem. I have radSchedular that is populating from database. I wrote TimeSlotCreated server side event in which I set the disabled/enabled class based on my required condition (e.TimeSlot.CssClass = "Disabled";)

In my ASPX page i wrote 

function OnClientTimeSlotClick(sender, eventArgs)
{
        var now = new Date();
if (sender.get_selectedView() == Telerik.Web.UI.SchedulerViewType.WeekView) {
            if (eventArgs.get_time() < now) {
                alert("Time slot not available");
            }
        }
}

this event simply shows alert if the tiemslot time is less than current time.
I need to get the CssClass and check if CssClass is "disabled" or "enabled". So that I can show alert('Time slot not available') if the CssClass is 'disabled'.

Prompt response is highly appreciated. 

Regards,
Mohsin
Frank
Top achievements
Rank 1
 answered on 07 Jun 2011
2 answers
216 views
Hi,

I would like to change the name "Insert" to "Add". How can I achieve this? Thanks
Kien Lim
Top achievements
Rank 1
 answered on 07 Jun 2011
1 answer
77 views
Hi,

I looked at this thread:

http://www.telerik.com/community/forums/aspnet-ajax/rotator/how-to-bind-radrotator-to-list-lt-t-gt.aspx

What I'd like to do is to create what looks like a scrollable radgrid reproducing the look of the embedded radgrid skins using tables and a radrotator.
 
My thought is to pick apart the output of a radgrid (view source) pull the css styles out of the skin files and then create a row template in the template of the rotator that matches the columns defined in the header row of the table for multiple attributes of a bound list.

My question is if I create a header row for the table outside of the rotator declaration and then define the row templates in the template of the radrotator will this mess up the table layout i.e will the table columns stay the same width?  could you provide a working example of this approach.  Also is there an alternating style on the radrotator to emulate the alternating row style on the radrid?

Thanks,

Jonathan



Niko
Telerik team
 answered on 07 Jun 2011
1 answer
98 views

We have column name Member Name in Data Set and we are using following sql query for getting this name into data set.

Select

 

COALESCE(   

   STUFF   

   (   

    (    

     SELECT DISTINCT  

      ''; '' + FirstName + CASE WHEN MI IS NULL THEN '''' ELSE '' '' + MI END + '' '' + LastName  

     FROM  

      TestTable1 

      INNER JOIN TestTable2 on TestTable1.customerid = TestTable2.customerid  

     WHERE  

      TestTable2.MemberID = TestTable1.customerid

     FOR XML PATH('''')     

    )   

   ,1,1,''''   

   ),''N/A'')  AS [Name]

   From TestTable

 

Based on above query we are getting customer name successfully in data set and bind to grid. Now issue is that we are not able to use Starts with operator and column filter is not returning any result. However when we use “Contains” operator we are able to retrieve correct result.

Also we have another column that simply returns column data as below


Select TestTable.PersonName From TestTable


Using above query we are successfully use starts with operator.


So what can be the problem and how can we resolve it?

Regards,

Dharmesh Solanki

Veli
Telerik team
 answered on 07 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?