Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
61 views
Hi,
      I want to print a grid data, I am Using browser IE9.
When i print a grid data after printed data not display well on paper just like as  Grid  Column Header are not shown, scroll shown, all column data not shown.
please find the attach and provide solutions.

And My grid code is:
<asp:UpdatePanel ID="update_lease__report" runat="server">
<ContentTemplate>
        <telerik:RadGrid CssClass="MyGrid"  ID="gv_Lease_Report" runat="server"                                                 AllowFilteringByColumn="True" AllowSorting="True"   ShowGroupPanel="True" AutoGenerateColumns="False"  PageSize="10"    ShowStatusBar="true" onneeddatasource="gv_Lease_Report_NeedDataSource"  OnItemCreated="gv_Lease_Report_ItemCreated"                                            OnHTMLExporting="gv_Lease_Report_HtmlExporting"           onexcelexportcellformatting="gv_Lease_Report_ExcelExportCellFormatting" >
     <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
             <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
                  BorderStyle="Medium" BorderColor="#666666" PaperSize="A4" >
    </Pdf>                                                       
    </ExportSettings>
     <ClientSettings AllowDragToGroup="True" >
                  <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"  />       </ClientSettings>
       <MasterTableView  AutoGenerateColumns="false">
                  <FilterItemStyle HorizontalAlign="Left" />
                          <NoRecordsTemplate>
                                 <asp:Label ID="lbl_no_record" runat="server" Text="No record exist"></asp:Label>
                          </NoRecordsTemplate>
          <Columns>                                                                   
                 <telerik:GridBoundColumn  Display="false" DataField="UnitContractId" DataType="System.String" HeaderText="Unit Contract Id" FilterControlAltText="Filter column column" UniqueName="UnitContractId" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">                                                                                                                                                                                </telerik:GridBoundColumn>
    <telerik:GridBoundColumn  DataField="ParcelName" DataType="System.String" HeaderText="Parcel Name" FilterControlAltText="Filter column column" UniqueName="ParcelName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
   </telerik:GridBoundColumn>                                                          
         <telerik:GridBoundColumn  DataField="UnitNo" DataType="System.String" HeaderText="Unit Number" FilterControlAltText="Filter column column" UniqueName="UnitNo" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >
  </telerik:GridBoundColumn>
       <telerik:GridBoundColumn  DataField="TenentName" DataType="System.String" HeaderText="Tenent Name" FilterControlAltText="Filter column column" UniqueName="TenentName" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
     </telerik:GridBoundColumn>                                                                      
          <telerik:GridDateTimeColumn DataField="ContractStartDate" HeaderText="Contract Start Date"  FilterControlAltText="Filter column column" UniqueName="ContractStartDate" PickerType="DatePicker" FilterDateFormat="dd/MM/yyyy" DataFormatString="{0:dd/MM/yyyy}"   ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" > </telerik:GridDateTimeColumn>     
     <telerik:GridDateTimeColumn DataField="ContractEndDate" HeaderText="Contract End Date" FilterControlAltText="Filter column column" UniqueName="ContractEndDate" PickerType="DatePicker" FilterDateFormat="dd/MM/yyyy" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"></telerik:GridDateTimeColumn>                                                              
          <telerik:GridBoundColumn  DataField="ContractAmount" DataType="System.Decimal" HeaderText="Contract Amount" FilterControlAltText="Filter column column" UniqueName="ContractAmount" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" >                                                                                                                                 
           </telerik:GridBoundColumn>
   </Columns>
 </MasterTableView>                                                    
    </telerik:RadGrid>
          </ContentTemplate>                                             
    </asp:UpdatePanel>
Kostadin
Telerik team
 answered on 18 Mar 2014
1 answer
104 views
Hello All,

I have using a RadFileExplorer for uploading a images/docs . So when i click on the upload toolbar and then uploaded a images from that after i images uploadingh the toolbar became disabled like the attach files.Please Provide me the solution for this problem . it is urgent  for me
Vessy
Telerik team
 answered on 18 Mar 2014
1 answer
72 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="MultipleExpandedItems"
                    Width="80%">
                    <Items>
                         <telerik:RadPanelItem Expanded="True" Text="Verbruik" runat="server"
                              Selected="true">
                              <Items>
                                   <telerik:RadPanelItem Value="Verbruik" runat="server">
                                        <ItemTemplate>
                                            <div>
                                                <!--radgrid + datasource Verbruik-->
                                                <div id="radgridVerbruik">
                                                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
                                                        <telerik:RadGrid ID="RadGridVerbruik" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                                                            AllowAutomaticUpdates="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik">
                                                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik"
                                                                EditMode="Batch" CommandItemDisplay="Top" CommandItemSettings-ShowSaveChangesButton="false"
                                                                CommandItemSettings-AddNewRecordText="Nieuwe vector" CommandItemSettings-CancelChangesText="Annuleer">
                                                                <BatchEditingSettings EditType="Row" />
                                                                <Columns>
                                                                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" HeaderText="ID"
                                                                        ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
                                                                    </telerik:GridBoundColumn>
                                                                     
                                                                    <telerik:GridTemplateColumn DataField="vectorID" FilterControlAltText="Filter Vector column"
                                                                        HeaderText="Vector" SortExpression="Vector" UniqueName="vectorID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Vector") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList2" runat="server" DataSourceID="SqlDataSourceVectorenVerbruik"
                                                                                DataTextField="omschrijving" DataValueField="vectorID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataField="eenheidID" FilterControlAltText="Filter Eenheid column"
                                                                        HeaderText="Eenheid" SortExpression="Eenheid" UniqueName="eenheidID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Eenheid") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList3" runat="server" DataSourceID="SqlDataSourceEenheden"
                                                                                DataTextField="omschrijving" DataValueField="eenheidID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
Angel Petrov
Telerik team
 answered on 18 Mar 2014
1 answer
186 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'


Jeffrey
Angel Petrov
Telerik team
 answered on 18 Mar 2014
1 answer
242 views
My requirement is that when the user clicks the edit command on the parent row, all rows in the child table should be put into edit mode. I tried the following in the grid's itemcommand event, but it didn't work:

                   Dim dataitem As GridDataItem = DirectCast(e.CommandSource, GridDataItem)
                   For Each editItem As GridDataItem In dataitem.ChildItem.NestedTableViews(0).Items
                        editItem.Edit = True
                   Next
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Mar 2014
2 answers
743 views

Hello, I have a RadGrid with an EditFormType set to 'Template'. I can't figure out how to access form elements inside this FormTemplate from the code behind. I'm trying to make one drop down change its options when another one is selected.

When I try to compile this code, it tells me "The name 'drpEditTarget' does not exists in the current context.". If I move that drop-down outside of the RadGrid, it's suddenly accessible again. I guess my two questions are...
--1) How can I access this element from the code behind?
--2) What's the difference between elements outside and inside the Grid? Why can I access the former but not the latter? (the answer to this might be a more broad asp.net question)

Default.aspx

<Telerik:RadGrid ID="RequestsGrid"runat="server" OnNeedDataSource="RequestsGrid_NeedDataSource" OnCancelCommand="RequestGrid_CancelCommand" OnDeleteCommand="RequestsGrid_DeleteCommand" OnItemCommand="RequestGrid_ItemCommand" OnItemDataBound="RequestsGrid_ItemDataBound" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="true" DataSourceID="requests">
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="id,requester,output,notes" DataSourceID="requests" CommandItemDisplay="Bottom">
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditColumn"></EditColumn>
            <FormTemplate>
                        <b>First Target:</b>
                        <asp:DropDownList runat="server" SelectedValue='<%# Eval("target") %>' ID="drpEditTarget" AutoPostBack="true" DataSource='<%# getPossibleTargets( (string)Eval("output") ) %>' OnSelectedIndexChanged="drpEditTarget_SelectedIndexChanged"></asp:DropDownList>
                        <b>Second Target:</b></td>
                        <asp:DropDownList runat="server" ID="drpEditSecondTarget"></asp:DropDownList>
                <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" />
                <asp:Button ID="btnCancel" CommandName="Cancel" Text="Cancel" runat="server" />
            </FormTemplate>
        </EditFormSettings>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditButton" Visible="false" ItemStyle-CssClass="skinny"/>
            <telerik:GridButtonColumn Text="Delete" UniqueName="DeleteButton" CommandName="Delete"></telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="id" HeaderText="ID" UniqueName="id"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="requester" HeaderText="Requester" UniqueName="requester"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="output" HeaderText="Output" UniqueName="output"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="notes" HeaderText="Notes" UniqueName="notes"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn Text="Approve" UniqueName="ApproveButton" CommandName="Approve"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn Text="Deny" UniqueName="DenyButton" CommandName="Deny"></telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</Telerik:RadGrid>

Default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        populateGrid();
  
        if (!Page.IsPostBack)
        {
            setFilterOptions();
            RequestsGrid.Rebind();
        }
    }
      
    protected void drpEditTarget_SelectedIndexChanged(object sender, EventArgs e)
    {
        drpEditSecondTarget.DataSource = getPossibleDestinations( drpEditTarget.SelectedValue.ToString() );
        drpEditSecondTarget.DataBind();
    }
}
Jay
Top achievements
Rank 1
 answered on 18 Mar 2014
4 answers
77 views
 I have a column named Rate and another Named LaborHours

The rate column can be two values:  REGULAR and OVERTIME

I want the to totals in the footer:  REGULAR 5,  OVERTIME 10

The code below works in my MS DataGrid, cannot figure out how to get it to work under RadGrid

You help is much appreciated!

If e.Row.RowType = DataControlRowType.DataRow Then
   Dim MilesOrHours As String
   MilesOrHours = (DataBinder.Eval(e.Row.DataItem, "Rate"))

   If MilesOrHours = "MI" Then
     Dim HourTotal As Decimal
     HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
     grdMilesTotal = grdMilesTotal + HourTotal
     Session("grandMilesTotal") = Session("grandMilesTotal") + grdMilesTotal

  Else

     Dim HourTotal As Decimal
     HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
     grdHoursTotal = grdHoursTotal + HourTotal
     Session("grandHoursTotal") = Session("grandHoursTotal") + grdHoursTotal

   End If

End If



If e.Row.RowType = DataControlRowType.Footer Then
    Me.txtHrs.Text = Session("grandHourstotal")
    Me.txtMiles.Text = Session("grandMilesTotal")

    Session("grandMilestotal") = "0"
    Session("grandHourstotal") = "0"
End If

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Mar 2014
5 answers
384 views
I am using AutoGeneratedColumns for checkbox but I can only use integer for datasource. help me to find right way to convert int value(as 1 or 0) to checkbox column and also how to enable that  AutoGenerated checkbox column.
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
5 answers
816 views
I upgraded to new Telerik version 2013.1.220.35 from 2010.3.1109.35. and compatibility issues started...

 

<telerik:RadGrid runat="server" ID="FileListView" AutoGenerateColumns="false" Skin="Windows7" 

Width="100%" OnDeleteCommand="FileListView_DeleteCommand">

<MasterTableView>

<Columns>

<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete"

ConfirmTitle="Confirm" ConfirmText="Continue deleting file?" /> <telerik:GridBoundColumn UniqueName="file" DataField="file" Visible="false" ReadOnly="true" />

 <telerik:GridBoundColumn UniqueName="Attachedfiles" DataField="Attached files" HeaderText="File" />

 <telerik:GridBoundColumn UniqueName="Attachedby" DataField="Editor" HeaderText="Attached by" />

 <telerik:GridBoundColumn UniqueName="Attachedat" DataField="Modified" HeaderText="Attached at" />

 </Columns>

 </MasterTableView>

 </telerik:RadGrid>

 

protected void FileListView_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 {
GridEditableItem editedItem = e.Item as GridEditableItem;

 string filename = editedItem["file"].Text;
logic continues...

but in the above code filename has &nbsp as the value. means filename contains empty space as it value instead of actual file name

Please suggest. 

Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
3 answers
121 views
Hello Team,

I needed to select RadCombox1 and disable using javascript but I found $find with RadCombox returns null.Is there any work around for this because I am currently blocked on this?
 
1.<telerik:RadComboBox ID="RadCombox1" runat="server" >
2.     <Items>
3.         <telerik:RadComboBoxItem Text="Aba" Value="1" />
4.         <telerik:RadComboBoxItem Text="Enugu" Value="2" />
5.     </Items>
6. </telerik:RadComboBox>
7. 
8. var badRad = $find("<%= RadCombox1.ClientID %>");

the value of badRad  is null. Can someone help?

Thanks,
Nsi.
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
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?