Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
222 views
Dear Telerik Support

I need to remove the separator line between the refresh button and the exports button from the grid. Please see the attached image for your help.

Basically this separator comes by default in rad grid in the command item.

Thanks in advance.
Gagan
Shinu
Top achievements
Rank 2
 answered on 09 Sep 2013
3 answers
108 views
OK, here is a bit of a weird one. I am building a mail system for a project and when I do a postback event after a double click on a row all the text in the RadGrid is highlighted.

I have a javascript function that simply clicks a image button that I have a post back event on.

function refreshMail(){document.getElementById("ImageButton1").click();} 
function RowDblClick(sender, eventArgs){parent.openMailMessage(eventArgs.getDataKeyValue("Idnum"));refreshMail();} 

I have a simple Image Button and RadGrid

<asp:ImageButton ID="ImageButton1" runat="server"  
                                    ImageUrl="../graphics/refresh2.gif" onclick="ImageButton1_Click"  
                                    ToolTip="Refresh mail box." /> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowCustomPaging="True" 
                        AllowPaging="True" GridLines="None" Height="320px"  
                        HorizontalAlign="Center" PageSize="50" ShowStatusBar="True" Skin="Vista"  
                        Width="760px" AutoGenerateColumns="False" OnDeleteCommand="RadGrid1_DeleteCommand" OnItemCreated="RadGrid1_ItemCreated" 
OnNeedDataSource="RadGrid1_NeedDataSource" ShowGroupPanel="True"  
                        AllowSorting="True" EnableHeaderContextMenu="True"
 
                        <MasterTableView GridLines="None"
                        <Columns> 
                        <telerik:GridButtonColumn HeaderText="Delete" ConfirmText="Delete this mail?"  ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                        UniqueName="DeleteColumn" HeaderStyle-Width="45px"
<HeaderStyle Width="45px"></HeaderStyle> 
 
                            <ItemStyle HorizontalAlign="Center" CssClass="delButton" /> 
                        </telerik:GridButtonColumn> 
                        <telerik:GridBoundColumn DataField="From" HeaderText="From"/> 
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Title"/> 
                        <telerik:GridBoundColumn DataField="Date_" HeaderText="Date" HeaderStyle-Width="120px"
                         
<HeaderStyle Width="120px"></HeaderStyle> 
                            </telerik:GridBoundColumn> 
                        </Columns> 
                            <PagerStyle Mode="NextPrevAndNumeric" /> 
                            <RowIndicatorColumn Visible="False"
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Visible="False"
                                <HeaderStyle Width="19px" /> 
                            </ExpandCollapseColumn> 
                        </MasterTableView> 
                        <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True"
                            <Resizing AllowColumnResize="True" /> 
                            <Scrolling AllowScroll="True" ScrollHeight="280px" UseStaticHeaders="True" /> 
                            <Selecting AllowRowSelect="True"></Selecting> 
                            <ClientEvents OnRowDblClick="RowDblClick" /> 
                        </ClientSettings> 
                        <FilterMenu> 
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                         
                    </telerik:RadGrid> 


The code behind
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) 
        { 
            RadGrid1.Rebind(); 
        } 

Does anyone have any ideas?  What is really weird is that I can call the refreshMail() method from the parent page and it doesnt highlight any text. I'm sure this is a simple one, but it's got me baffeled :/

Thanks in advance,
Matt
brian
Top achievements
Rank 1
 answered on 08 Sep 2013
1 answer
92 views
Hi,

I have a RadGrid that I'm using to do some custom paging.  This works really well and I'm very happy with how it works.  Because the page size of the items I'm displaying changes depending on the selection, I'm changing the VirtualItemCount property to make sure that the number of pages stays consistent, regardless of how many items are displayed.  This works well, but it displays on the bottom of the grid (items x to y of total) which obviously changes as the VirtualItemCount changes.

What's the best way to customise just this part of the pager?  I've seen in the online demos how to customise the whole thing, but I really just want to access the control that says that and change the text.

I'm using the ItemCreated method as follows:

protected void Grid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    ...
}

But I don't seem to be able to access the label/literal itself in order to change the text.

Thanks
User
Top achievements
Rank 2
 answered on 07 Sep 2013
1 answer
77 views
I am working with a grid that has paging and I want to be able to select multiple items across multiple pages and export those items. I have implemented the follow logic to export just selected items
 protected void Button1_Click(object sender, EventArgs e) 
    { 
          foreach (GridDataItem item in RadGrid1.Items)  
        {  
            if (item.Selected==false)  
            {  
                item.Visible = false;  
            }  
        }  
        RadGrid1.ExportSettings.ExportOnlyData = true;  
        RadGrid1.ExportSettings.OpenInNewWindow = true;  
        RadGrid1.MasterTableView.ExportToExcel();  
    } 

However, this only works if the grid export settings IngorePaging = False, in which case it only exports the selected items on the current page. If I set IgnorePaging=True, all items are exported all the time.

Is there a way to export selected items across multiple pages?
Jayesh Goyani
Top achievements
Rank 2
 answered on 07 Sep 2013
2 answers
113 views
Hi everyone,

Here's my RadListBox:

<div>
    <telerik:RadListBox id="rlbCountries" runat="server" EnableEmbeddedScripts="false" DataTextField="CountryName" DataValueField="CountryID" EmptyMessage="[No countries selected]" Width="100%" Height="250px" SelectionMode="Multiple"></telerik:RadListBox>
</div>

Here's the client-side Javascript code that I use to remove items (countries) after an AJAX call to a web-service:
var rlbCountries = $find(countriesListBoxID);
var items = rlbCountries.get_items();
// clear the current countries
items.clear();

I have found that the list box is correctly cleared; however, the "[No countries selected]" message is not displayed.  If I remove the items on the server (via a post-back), the message is shown.

Has anyone else noticed this?  Is there something I can do to the list-box object on the client in order for the message to be shown?

Ed Graham
Ed
Top achievements
Rank 1
 answered on 07 Sep 2013
5 answers
188 views
Hello,

I am using your RadEditor 2010.3.1317.35 in a CMS application.
Everything is working fine with FF4 and Chrome11 but with IE 7, 8 and 9, the RadEditor is loosing its content after postback on the server where the application is deploy (Win Server 2003 32 bits)

When I try in debug with Visual Studio 2010 on my machine (Win7 32 bits) with IE 9, everything is working fine. I can get the content after postback.

Do you have any idea about my problem?


Thank you for your help,
Read you soon.
Raj
Top achievements
Rank 1
 answered on 07 Sep 2013
1 answer
249 views
Hi,

Is there a feature or something I can combine with radgrid to play audio in row when a button in a column is clicked?
I don't want user to leave the page to listen to the audio, best way will be a button column for user to click, once the button is clicked, a play will start inside the column and play a wav file.
Any suggestions?

Thanks
Roy
Konstantin Dikov
Telerik team
 answered on 06 Sep 2013
4 answers
127 views
Hi

I am using a radlistbox that contains few items populated from DB. The items can be checked and how to copy them to a radtreeview using the server side code. Any samples available?
Thanks for your replies
Berk.
Berkman
Top achievements
Rank 1
 answered on 06 Sep 2013
2 answers
102 views
Hi,

I am useing RadGrid and which use HeaderTemplate and ItemTemplate in HeaderTemplate define Header like <tr> <td>Name</td></tr> ..... and 
 bind data in ItemTemplate like <tr><td>  <%--  <%# DataBinder.Eval(Container.DataItem, "Name")%>--%></td>.......</tr>. So problem is that
 i have clike on Export To Excel button RadGrid is disappear and Excel file is empty open. why? please help

ASPX Code:
<table>
<tr>
                                   <td>
                        <asp:Button ID="ExpReport" runat="server" Text="Export Excel " 
                             CssClass="Buttons" onclick="ExpReport_Click"  />
                    </td>
                </tr>
                <tr>
                    <td colspan="8" style="height: 8px">
                    </td>
                </tr>
            </table>
            
              
                    <%-- <table width="100%"  cellpadding="0" cellspacing="0">
        <tr><td>--%>
        <div id="divTableDataHolder">
                    <telerik:RadGrid ID="RGrid" runat="server" Skin="Default" 
                BorderWidth="0px" AutoGenerateColumns="false"
                        Width="100%" Height="100%" BorderColor="Transparent" 
                AllowSorting="true" GridLines="None"  EnableAJAX="true"                 
                OnNeedDataSource="RGrid_NeedDataSource"  CellPadding="0" CellSpacing ="0" 
                ongridexporting="RGrid_GridExporting" onpdfexporting="RGrid_PdfExporting" 
                        onitemcreated="RGrid_ItemCreated" >
                       <%-- <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>--%>
                        <MasterTableView AllowMultiColumnSorting="false" ShowHeader="false" RowIndicatorColumn-Display ="false" TableLayout ="Auto" >
                         
                            <Columns> 
                              <telerik:GridTemplateColumn groupable="False" UniqueName="Employer_Id"  Display="false">
                              
                                    <HeaderTemplate>
                                           <tr>
                                            <td>
                                                
                                                    <tr>
                                                        <td align="center" colspan="18" class ="tdBorder" style="font-weight :bold">
                                                            Number of Employees (Report employees in only one Category)
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="center" colspan="18" class ="tdBorder"  style="font-weight :bold">
                                                            Race or Ethnicity
                                                        </td>
                                                    </tr>
                                                    <tr>    
                                                               <tr>
                                                                <td class ="tdBorder" rowspan="3"  style="font-weight :bold" >Job Group</td>
                                                                    <td colspan="2"  class ="tdBorder" rowspan="2"  style="font-weight :bold">
                                                                        Hisponic or Latino
                                                                    </td>
                                                                    <td colspan="16" align="center" class ="tdBorder"  style="font-weight :bold">
                                                                        Non Hisponic or Latino
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                              
                                                              
                                                                    <td colspan="7" class ="tdBorder"  style="font-weight :bold">
                                                                        Male
                                                                    </td>
                                                                    <td colspan="7" class ="tdBorder"  style="font-weight :bold" >
                                                                        Female
                                                                    </td>
                                                                        <td class ="tdBorder" rowspan="3"  style="font-weight :bold" >
                                                                         Totals
                                                                    </td>
                                                                    </tr>
                                                                    <tr>
                                                                
                                                                        <td class ="tdBorder"  style="font-weight :bold" >
                                                                            Male</td>
                                                                            <td class ="tdBorder"  style="font-weight :bold" >
                                                                                Female
                                                                            
                                                                        </td>
                                                                        
                                                                        <td class ="tdBorder">
                                                                            American Indian OR Alaskan Native
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Asian
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Black OR African American
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Caucasian White
                                                                        </td>
                                                                        <td class ="tdBorder" >
                                                                            No Race
                                                                        </td>
                                                                        <td class ="tdBorder" >
                                                                            Native Hawaiian OR Other Pacific Islander
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Two Or More Race
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            American Indian OR Alaskan Native
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Asian
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Black OR African American
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Caucasian White
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            No Race
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Native Hawaiian OR Other Pacific Islander
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Two Or More Race
                                                                        </td>
                                                                       <%--    <td class ="tdBorder" rowspan="3">
                                                                         Totals
                                                                    </td>--%>
                                                                    </tr>
                                                                <%--</tr>--%>
                                                            
                                                        </td>

                                                    </tr>
                                       
                                   
                                  
                                    
                                   </HeaderTemplate>
                                    <ItemTemplate>
                                    
                                      
                                            <tr class="tdBorder" >
                                                <td class ="tdBorder">
                                              
                                                    <%# DataBinder.Eval(Container.DataItem,"EEO") %>
                                                </td>
                                                <td class ="tdBorder">
                                            
                                                    <%# DataBinder.Eval(Container.DataItem,"HispanicOrLatinoMale")%>
                                                </td>
                                                <td class ="tdBorder">
                                              
                                                   <%# DataBinder.Eval(Container.DataItem,"HispanicOrLatinoFemale")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 <%# Eval("AmericanIndianOrAlaskanNativeM", "{0:N0}")%>
                                                    <%--<%# DataBinder.Eval(Container.DataItem, "AmericanIndianOrAlaskanNativeM")%>--%>
                                                </td>
                                                <td class ="tdBorder" >
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "AsianM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                              <%# DataBinder.Eval(Container.DataItem, "BlackOrAfricanAmericanM")%>
                                                </td>
                                                <td class ="tdBorder">
                                         
                                                  <%# DataBinder.Eval(Container.DataItem, "CaucasianWhiteM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                  <%# Eval("NoRaceM", "{0:N0}")%>
                                                   <%# DataBinder.Eval(Container.DataItem, "NoRaceM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "NativeHawaiianOrOtherPacificIslanderM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                    <%# DataBinder.Eval(Container.DataItem, "TwoOrMoreRacesM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 <%# Eval("AmericanIndianOrAlaskanNativeF", "{0:N0}")%>
                                                 <%--   <%# DataBinder.Eval(Container.DataItem, "AmericanIndianOrAlaskanNativeF")%>--%>
                                                </td>
                                                <td class ="tdBorder">
                                               
                                                   <%# DataBinder.Eval(Container.DataItem, "AsianF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                   <%# DataBinder.Eval(Container.DataItem, "BlackOrAfricanAmericanF")
                                                </td>
                                                 <td class ="tdBorder">
                                                 
                                                  <%# DataBinder.Eval(Container.DataItem, "CaucasianWhiteF")%>
                                                </td>
                                                <td class ="tdBorder">
                                              
                                                  <%# DataBinder.Eval(Container.DataItem, "NoRaceF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                  <%# DataBinder.Eval(Container.DataItem, "NativeHawaiianOrOtherPacificIslanderF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "TwoOrMoreRacesF")%>
                                                </td>
                                                <td class ="tdBorder" style ="font-weight:bold">
                                              
                                                    <%# DataBinder.Eval(Container.DataItem, "Total")%>
                                                </td>
                                            </tr>
       
                                    </ItemTemplate>
                                  
                               </telerik:GridTemplateColumn>
                               
                            </Columns>
                            
                        </MasterTableView>
                    </telerik:RadGrid>
                    </div>
                    <asp:HiddenField ID="HdnValue" runat="server" />
                      </telerik:RadAjaxPanel> 
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                        <ClientEvents OnRequestStart="RequestStart" />
                         <ClientEvents OnRequestStart="onRequestStart" />
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="showRpt">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="Panel" LoadingPanelID="RadAjaxLoadingPanel1" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                            <telerik:AjaxSetting AjaxControlID="RGrid">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="RGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" CssClass="MyModalPanel" Transparency="50"
                        runat="server">
                    </telerik:RadAjaxLoadingPanel>

C# Code:
  protected void ExpReport_Click(object sender, EventArgs e)
        {
            try
            {
              
                RGrid.ExportSettings.IgnorePaging = true;
                RGrid.ExportSettings.ExportOnlyData = true;
                RGrid.ExportSettings.OpenInNewWindow = true;
                RGrid.ExportSettings.FileName = " Report";
                RGrid.MasterTableView.ExportToCSV();
               
                
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
            
        }


Abbas
Top achievements
Rank 1
 answered on 06 Sep 2013
1 answer
90 views
A Telerik grid (Sorting, Paging enabled) with edit, delete & insert (popup) commands is used inside a user control. This user control is used in a webpage (Telerik Grid's Template Field column). When tried to use user control's grid events (edit, delete, insert, sorting, paging ...),  A Control is already associated with the element exception is thrown. 

<asp:UpdatePanel ID="updatePanel1" runat="server">
    <ContentTemplate>
        <ucl1:FormsControl ID="FormsControl1" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>

DRG
Top achievements
Rank 1
 answered on 06 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?