Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
309 views
hi, i have used radgrid default filter for filtering items in grid using GridBoundColumn. now i want to export the dataset to excel format found by appying filter in columns. how to do it? please let me know.
sorry for my bad english. 
Princy
Top achievements
Rank 2
 answered on 21 Nov 2013
2 answers
282 views

Hello Telerik Support Team,


Having some issues with RadMenu control. Please have a look on code block and attached screenshots.
Issue – RadMenu items are not displayed properly in RadGrid. No idea how it’s taking grid row’s height and width. I have tried to override RadMenu css but still same issues.

Regards,

Ajit Singh

----------------  ASPX and CSS CODE-----------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication6.WebForm1" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .MasterTable_Default caption {
            color: red;
            background-color:Black;
            text-align:left;
        }  
        .leftNavigatorstlye-Link
        {
            background-color:#0071bc;
            font-size: 12px;
            text-decoration: none;
            font-family: Segoe UI, Helvetica, Garuda, Arial, sans-serif;
            font-weight: bold;
            color:White;
        }
        .RadGrid_Default .rgHeader,
        .RadGrid_Default th.rgResizeCol
        {
         background:url('Grid/headers.gif') repeat-x #434343 !important;
            font-size: 12px !important;
            text-decoration: none !important;
            font-family: Segoe UI, Helvetica, Garuda, Arial, sans-serif !important;
            font-weight: bold !important;
            color:White !important;
        }
</style>
</head>
<body>
   
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <table id="maintable" runat="server" style="width:100%;border-spacing:0;border-collapse:separate;">
        <tr><td class="leftNavigatorstlye-Link">My Task</td></tr>
        <tr>
            <td>
                <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowMultiRowSelection="True"
                    runat="server" AllowSorting="True" GridLines="None" AllowPaging="True" CellSpacing="0"
                        ShowGroupPanel="True" onitemcommand="RadGrid1_ItemCommand"  >
                    <MasterTableView CommandItemDisplay="Top"  CssClass="MasterTable_Default" HeaderStyle-CssClass="rgHeader" TableLayout="Fixed" >
                        <CommandItemTemplate>
                            <asp:LinkButton ID="LinkButton6" runat="server" CommandName="Rebind">
                                <img style="border:0px; height:22px;width:22px;" alt="" src="RefreshList.gif" />
                            </asp:LinkButton>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Rebind">
                                Global Actions
                            </asp:LinkButton>
                            <br />
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridTemplateColumn>
                                <ItemTemplate>
                                    <telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true"
                                        ExpandAnimation-Type="None" CollapseAnimation-Type="None" ExpandDelay="0" CollapseDelay="0"  >
                                        <Items>
                                            <telerik:RadMenuItem Text="Actions" Selected="false">
                                                <GroupSettings ExpandDirection="Right"  />
                                                <Items >
                                                    <telerik:RadMenuItem Text="View Process" />
                                                    <telerik:RadMenuItem Text="Cancel Task" />
                                                    <telerik:RadMenuItem Text="Reassign task" />
                                                    <telerik:RadMenuItem Text="Create Linked Work Item" />
                                                </Items>
                                            </telerik:RadMenuItem>
                                        </Items>
                                    </telerik:RadMenu>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="True">
                        <Selecting AllowRowSelect="True"></Selecting>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                </telerik:RadGrid>           
            </td>
        </tr>
    </table>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [USER_NAME],[FULL_NAME],[DEPARTMENT],[EMAIL_ADDRESS],[MANAGER],[GROUP_NAME] FROM [tUsers]"></asp:SqlDataSource>
<br /><br />

</div>
    </form>
</body>
</html>

--------------------------------  CODE BEHIND------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace WebApplication6
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Rebind")
            {
                RadGrid1.Rebind();
            }

        }
    }
}

 

 

SHUAN
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
147 views
Hi

How to apply the silk skin to the date picker and time picker as shown on the Telerik demos page. with silk skin(the icon, on hover highlighted in blue, rounded edges etc) as shown on Telerik demo page http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/custompopup/defaultcs.aspx

Thanks for your input.

A2H
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
179 views

I am using a RadGrid and want to be able to show row specific details in another item (such as a TextBox) when a row is clicked.  This is similar to the example seen in this Grid Example.  Since the Grid Example does not have details I am using the example in Grid Row Selection.  I want the selection to work like the top example, not the bottom one.  I am trying to have the JavaScript call a method in the aspx.cs page that then updates a text box, but the PageMethods.RowClick method in the code behind is static so it does not have access to TextBox1.  Is it possible to have more control in the aspx.cs page?  The first example looks to be using previously generated items that are then hidden or exposed using JavaScript.  Is that what I need to be doing?   

I basically want the user to be able to click on a row in the RadGrid and have other things on the page update immediately based on the selected row.               


//radgrid.aspx
function RadGrid1_OnRowClick(sender,eventArgs)
{
       var MasterTable = sender.get_masterTableView();
       var Name = MasterTable.getCellByColumnUniqueName(row, "Server").innerHTML;
       PageMethods.RowClick(Name);
}
 
// radgrid.aspx.cs
   [System.Web.Services.WebMethod]
    public static void RowClick(string item)
    {
        TextBox1.Text += item;
    }
Steve Lassanske
Top achievements
Rank 1
 answered on 20 Nov 2013
1 answer
160 views
I have a screen that has numerous rag grids on it.
.RadGrid
{
    border-radius: 10px;
    overflow: hidden;
}

This code works great it rounds all the grids, but I would like to control which grids are rounded.  I have a few hierarchical grids and I do not ant the inner grid to have rounded corners

This code is in my main site.css and I want to keep it there.  I have tried #name but that is not the most ideal nor did it work.  I would like to add a cssclass name to the grids that I want the rounded corners on.
Eric Klein
Top achievements
Rank 1
 answered on 20 Nov 2013
0 answers
132 views
I am currently using windows 7 visual studio 2010 and telerik controls 2013.2.717.40.  I have created a custom skin but when I apply it I lose the Expand and Collapse icon on the grid.  I decided to use a stock skin outlook and then change the icons but when I add the icon url it still shows the standard right arrow.

Are you no longer able to alter the icon and if you use a custom screen whey does the icon disappear?
Eric Klein
Top achievements
Rank 1
 asked on 20 Nov 2013
3 answers
180 views
Hi,

I have placed a table in an edit form that contains validation on several textboxes. I'm trying to make the validation message to be right in the cell that contains the textbox.  It seems like if I'm doing soemthing like the code below in my ItemCommand event, the message would be in the "outer" table cell.  How do I access the table cell that's in the table within the <FormTemplate>?
<EditFormSettings EditFormType="Template">
    <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
    </EditColumn>
    <FormTemplate>
        <table class="auto-style1" border="2" >
            <tr>
                <td style="width:8%">Building Name:</td>
                <td style="width:8%">
                    <asp:TextBox ID="bldgname" runat="server" MaxLength="40" >                                 
                    </asp:TextBox>
                </td>
                <td style="width:8%">Column3</td>
                <td style="width:100%">Column4</td>
            </tr>
            <tr>
                <td>Address:</td>
                <td>
                    <asp:TextBox ID="address1" runat="server" Text='<%# Bind("bldgstreet1") %>'></asp:TextBox><br />
                    <asp:TextBox ID="address2" runat="server" Text='<%# Bind("bldgstreet2") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td>City:</td>
                <td>
                    <asp:TextBox ID="bldgcity" runat="server" Text='<%# Bind("bldgcity") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td>State:</td>
                <td>
                    <asp:TextBox ID="bldgstate" runat="server" Text='<%# Bind("bldgstate") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr style="width:5%; height:50px">
                <td>Zip:</td>
                <td>
                    <asp:TextBox ID="bldgzip" runat="server" Text='<%# Bind("bldgzip") %>'></asp:TextBox><br />
                </td>
                 
                <td>
                    <div>
                        <table width="100%">
                          <tr>
                            <td style="width:30%">
                                <asp:ImageButton ID="CertifyAddressImageButton" runat="server" ImageUrl="~/images/certificate32.png" OnClick="CertifyAddressImageButton_Click"/>
                            </td>
                            <td style="width:70%">
                                <asp:CheckBox ID="CheckBoxOverride" runat="server" Text="Override?" TextAlign="Left" Font-Size="Large" />
                            </td>      
                          </tr>
                         </table>
                     </div>
                </td>
                <td>
                   <telerik:RadComboBox ID="WireCenterRadComboBox" Runat="server" Height="200px" Width="200px" DropDownWidth="750px"
                        HighlightTemplatedItems="True" MarkFirstMatch="True"
                        EnableLoadOnDemand="True" Filter="StartsWith" EmptyMessage="Enter WireCenter Name..." ToolTip="Enter WireCenter Name to Filter list"
                        OnItemsRequested="WireCenterRadComboBox_ItemsRequested" OnLoad="WireCenterRadComboBox_Load">
                        <HeaderTemplate>
                            <table style="width: 700px" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 80px;">WireCenter</td>
                                    <td style="width: 150px;">Name</td>
                                    <td style="width: 150px;">T1OrderMethod</td>
                                    <td style="width: 100px;">Vendor ACTL</td>
                                    <td style="width: 170px;">Logix ACTL</td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table style="width:700px" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 80px;"><%# DataBinder.Eval(Container, "Text")%></td>
                                    <td style="width: 150px;"><%# DataBinder.Eval(Container, "Attributes['wirecentername']")%></td>
                                    <td style="width: 150px;"><%# DataBinder.Eval(Container, "Attributes['t1ordermethod']")%></td>
                                    <td style="width: 100px;"><%# DataBinder.Eval(Container, "Attributes['vendoractl']")%></td>
                                    <td style="width: 170px;"><%# DataBinder.Eval(Container, "Attributes['logixactl']")%></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                </td>
                 
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                    </asp:Button>
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                </td>
                <td> </td>
                <td> </td>
                <td> </td>
            </tr>
        </table>
    </FormTemplate>
</EditFormSettings>

if (e.CommandName == RadGrid.UpdateCommandName ||
    e.CommandName == RadGrid.PerformInsertCommandName)
{
    GridEditableItem item = e.Item as GridEditableItem;
    // Validate Zip Code
    RegularExpressionValidator validZip = new RegularExpressionValidator();
     
 
    // for Accessing boundcolumn
    GridTextBoxColumnEditor editor;
 
    // Test zip
    TextBox txtbx;
    TableCell cell;
 
    txtbx = (TextBox)item.FindControl("bldgzip");
    cell = ((GridEditFormItem)txtbx.NamingContainer).EditFormCell;
    validZip.ControlToValidate = txtbx.ID;
    validZip.ErrorMessage = "only [0-9] and '-' are allowed";
    validZip.ValidationExpression = @"^\d{5}(-\d{4})?$";
    validZip.ForeColor = System.Drawing.Color.Red;
    cell.Controls.Add(validZip);
    // End Test Zip
 
    validZip.Validate();
  }

Helen
Top achievements
Rank 1
 answered on 20 Nov 2013
3 answers
149 views
When any PostBack occurs (in this case, I am using a RadAjaxManager) and the PivotGrid is inside a UserControl.  I can find no other explanation for this because as soon as I take off the PivotGrid (there is also another RadGrid in the UserControl) everything works just fine.  The other thing is that the PivotGrid is inside of a RadPageView.

The error is:
"Unable to get value of the property 'style': object is null or undefined"

The problem lies in the "_initializeHzScrollDiv" method which does not account for a null result from "this.get_hzScrollDiv":
var l=this.get_hzScrollDiv(); <-- Error occurs later becuase this returns Null...
var p=$telerik.isIE?a.PivotGrid.GetScrollBarWidth()+1:a.PivotGrid.GetScrollBarWidth();
l.style.width=q.clientWidth+"px";
l.style.height=p+"px";
l.style.overflowX="scroll";
l.style.overflowY="hidden";
Tim
Top achievements
Rank 1
 answered on 20 Nov 2013
1 answer
87 views
I am using RadEditor for content editing. I have set its content programmatically like 

RadEditor1.Content = Conversion.ToString(Cms.HtmlContent);

But it's not loading contents and the RadEditor also is disabled.

Any help will be appreciated.

Thanks
Ianko
Telerik team
 answered on 20 Nov 2013
11 answers
354 views
Hi,
I have a header control in my RadGrid set out as:

<

 

 

telerik:GridBoundColumn DataField="RaisingFactor" HeaderText="Raising Factor" UniqueName="RaisingFactor" ReadOnly="true" Visible="true" DataFormatString="{0:N2}"></telerik:GridBoundColumn>

 


I wish to re-set the value of the text of this control after the Update has been made on the row that it belongs to.

Its a field that is calculated based on the values of 3 other fields. I wish the new value of this header to display straight after Update.

Any advice?

Thank you.
Kostadin
Telerik team
 answered on 20 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?