Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views
I am attempting to upgrade a .Net web app with Telerik RadControls Q3 2011 to Q3 2013 and have run into skinning issues with the RadGrid.  The browser is also being upgraded from IE8 running in Compatibility View to IE11 in Edge Mode.

​Attached (IE8_RadGrid_Border.jpg) is what the RadGrid used to look like and needs to maintain its appearance.

Attached (IE11_RadGrid_Border.jpg) is what the RadGrid looks like after upgrading the Telerik .dll's and running in IE11. 

The issue is the gray border at the top and bottom of each cell is missing. 

Could this be a sizing issue?

Thanks,

Rob
Venelin
Telerik team
 answered on 31 Mar 2014
5 answers
671 views
Hello folks.

I was looking for a way to export my Telerik Chart image for use in documents and for printing, but didn't find a clean "Telerik solution" to the problem. The chart components features the Save(..) method, allowing us to save the generated image to the web-server. However, this is not what I wanted - I want to serve the image directly to the user as a download without writing it to the filesystem on the server.

Fortunately it is possible to save the image to a MemoryStream, so the following few lines does exactly what I need:

System.IO.MemoryStream ms = new System.IO.MemoryStream();  
this.chart.Save(ms, System.Drawing.Imaging.ImageFormat.Png);  
this.Page.Response.Clear();  
this.Page.Response.ClearHeaders();  
this.Page.Response.AddHeader("Content-disposition""attachment; filename=Chart.png");  
this.Page.Response.AddHeader("Content-type""image/png");  
this.Page.Response.BinaryWrite(ms.ToArray());  
this.Page.Response.End(); 

The browser will now pop up with the download dialog, allowing the user to either open or save the file.

If you want to have the image displayed in the browser, simply comment out the following line:
this.Page.Response.AddHeader("Content-disposition""attachment; filename=Chart.png");

Hopefully this tip will be useful to someone else :)

Telerik team: Wouldn't it be possible to implement the code above in an Export function, allowing less expirenced users to do export without worrying about memory streams, response headers and so on?

Best regards
Jimmy Thomsen
kishan
Top achievements
Rank 1
 answered on 31 Mar 2014
7 answers
98 views
Hi,

The combination of GridCellSelectionMode MultiColumn and UseStaticHeaders does not work, nothing happens onclick. 
Without UseStaticHeaders theres no problem to multiselect columns.
I have generic grid columns, all added programmatically.
Any solutions?

Best Regards
Angel Petrov
Telerik team
 answered on 31 Mar 2014
3 answers
166 views
Hello.

I have a quick question.

Is ther any way to use the Ajax Loading Panel for all Controls on my site that doing a Postback?
I don't want to define all controls in the manager that do a postback.

I just want the ajax loading panel to show up every postback.

Is this possibile?

Thank you for reading.
Daniel
Shinu
Top achievements
Rank 2
 answered on 31 Mar 2014
1 answer
63 views
Dear all,

I am trying to create a raddock control with title bar handle that can be expand/collapse horizontally rather than the vertically like in traditional demo http://demos.telerik.com/aspnet-ajax/dock/examples/overview/defaultcs.aspx

Any brilliant idea to share? Greatly appreciated.

Kind regards,

Jonathan
Shinu
Top achievements
Rank 2
 answered on 31 Mar 2014
1 answer
86 views
I have created some custom commands in the grid as follows.

<telerik:GridButtonColumn CommandName="Remove" FilterControlAltText="Filter Remove column"
    Text="Remove" UniqueName="Remove"><br>                   
</
telerik:GridButtonColumn>


I would like to place this column at the end of the grid similar to how the auto generated edit column is placed at the end.  Is this possible?
Shinu
Top achievements
Rank 2
 answered on 31 Mar 2014
2 answers
63 views
 <telerik:RadGrid
         ID="rgOfficersToCallIn"
         runat="server"
         AutoGenerateColumns="False"
         AllowPaging="True"
         AllowSorting="True"
         PageSize="17"
         CellSpacing="0" GridLines="None"
         OnSortCommand="rgOfficersToCallIn_SortCommand"
         OnPageIndexChanged="rgOfficerToCallIn_PageIndexChanged"
         EnableHeaderContextFilterMenu="True" 
         Width="1200px"
         Height="640px">
            <ClientSettings EnablePostBackOnRowClick="true">              
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="true" />
            </ClientSettings>
            <MasterTableView ShowHeadersWhenNoRecords="true" NoMasterRecordsText="No Employees Records to display" GridLines="None" ItemStyle-Height="23px" Font-Size="11px" TableLayout="Auto">
                <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle>
                <Columns>             
                    <telerik:GridBoundColumn HeaderText="HR EmployeeID" HeaderStyle-Width="120px" Display="false" DataField="HREmployeeID" FilterControlWidth="40px" ShowFilterIcon="false" SortExpression="HREmployeeID"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Employee Number" HeaderStyle-Width="100px" DataField="EmployeeNumber" FilterControlWidth="95px" ShowFilterIcon="false" SortExpression="EmployeeNumber"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="First Name" HeaderStyle-Width="70px" DataField="FirstName" FilterControlWidth="105px" ShowFilterIcon="false"  SortExpression="FirstName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Last Name" HeaderStyle-Width="70px" DataField="LastName" FilterControlWidth="84px" ShowFilterIcon="false"  SortExpression="LastName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="City" HeaderStyle-Width="90px" DataField="City" FilterControlWidth="78px" ShowFilterIcon="false" SortExpression="City"></telerik:GridBoundColumn>
                   <%-- <telerik:GridBoundColumn HeaderText="Guard Card Number" HeaderStyle-Width="110px" DataField="GuardCardNumber" FilterControlWidth="72px" ShowFilterIcon="false" SortExpression="GuardCardNumber"></telerik:GridBoundColumn>                    --%>
                    <telerik:GridDateTimeColumn  HeaderText="Guard Card Expired" HeaderStyle-Width="110px" DataField="GuardCardExpired" FilterControlWidth="63px" ShowFilterIcon="false"></telerik:GridDateTimeColumn>
                   <%-- <telerik:GridBoundColumn HeaderText="Fire Arm Number" HeaderStyle-Width="90px" DataField="FireArmNumber" FilterControlWidth="72px" ShowFilterIcon="false" SortExpression="FireArmNumber"></telerik:GridBoundColumn>                   
                    <telerik:GridDateTimeColumn  HeaderText="Fire Arm Expired" HeaderStyle-Width="90px" DataField="FireArmExpired" FilterControlWidth="63px" ShowFilterIcon="false"></telerik:GridDateTimeColumn>--%>
                    <telerik:GridTemplateColumn HeaderText="On Call" HeaderStyle-Width="80px" AllowFiltering="false" UniqueName="OnCallButton">
                    <ItemTemplate>
                      <telerik:RadButton ID="btnOnCall" runat="server" Text="On Call" CommandName="OnCall" >
                          <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4"></Icon>
                      </telerik:RadButton>
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>


**************************************************VB CODE****************************************
  Protected Sub rgOfficersToCallIn_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgOfficersToCallIn.ItemCommand
        Try
            lblMessage.Text = ""
            divMessage.Visible = False            Dim setDate As Date? = rdtpCallIn.SelectedDate.ToString()
            If setDate Is Nothing Then
                Return
            End If
            Dim cellEmployeeID As TableCell = e.Item.Cells(DirectCast(eOfficersCallInColumns.HREmployeeID, Int32))
            If e.CommandName.ToString() = "OnCall" Then
                Dim dba As New DBAccess
                If dba.InsertCallInOfficer(m_SessionID, Convert.ToInt32(cellEmployeeID.Text), setDate) Then
                    If e.Item.Selected = True Then
                        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
                        Dim btn As RadButton = DirectCast(item("OnCallButton").FindControl("btnOnCall"), RadButton)
                        btn.Enabled = False
                    End If
                    rgCallIn.Rebind()
                    upCallIn.Update()
                    divMessage.Visible = True
                    lblMessage.Text = "Officer is now on call for " + setDate
                Else
                    rgCallIn.DataSource = New String() {}
                    rgCallIn.DataBind()
                End If
            End If


        Catch ex As Exception
        End Try
    End Sub

Avihai
Top achievements
Rank 1
 answered on 31 Mar 2014
2 answers
194 views
Hi

I have a RadGrid with 3 columns. One of them is a GridDateTimeColumn of type DateTimePicker. I'm trying to set the default time to 4pm instead of midnight when a date is selected.

I found code on another post that shows how to set the default time for a RadDateTimePicker by using a client event for OnDateSelected but I can't get it to work if the datetimepicker is in a grid.

I added a client event for onDateSelected in the code behind (in the RadGrid1_ItemCreated sub) and it does get called when I select a date but it gives me an error when I try to set the time. The error is "Sys.ArgumentNullException: Value cannot be null. Parameter name: instance"

The client event code is

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
   <script type="text/javascript">  
       var isTimeSet = false;
       function timeSelecting(sender, args) {
           isTimeSet = true;
       }
       function dateSelected(sender, args) {
                        if (args.get_oldDate() == null && !isTimeSet) {
                            args.set_cancel(true);
                            isTimeSet = true;
                            sender.get_timeView().setTime(16, 0, 0, 0); //I'm getting the error on this line
                        }
                        if (isTimeSet) {
                            isTimeSet = false;
                        }
        }
    </script>
   </telerik:RadCodeBlock>

This code does work with a RadDateTimePicker on the page but won't work for the RadDateTimepicker on the RadGrid. Is there any other way I can set the default time? I'm using version 2013.3.1114.40

My RadGrid -

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" AutoGenerateDeleteColumn="True"
                        AutoGenerateEditColumn="True" AutoGenerateColumns="False" Width="75%">
<MasterTableView CommandItemDisplay="Top" EditMode="InPlace" DataKeyNames="TEST_ID"
        nomasterrecordstext="No records entered">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
        visible="False"></RowIndicatorColumn>
<ExpandCollapseColumn Visible="True"
        FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
    <Columns>
        <telerik:GridDateTimeColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST_DATE" DataType="System.DateTime"
            FilterControlAltText="Filter column column" HeaderText="Test Date and Time"
            PickerType="DateTimePicker" ShowSortIcon="False" UniqueName="TEST_DATE" >
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ForeColor="Red" ErrorMessage="!"></RequiredFieldValidator>                   
                </ColumnValidationSettings>               
        </telerik:GridDateTimeColumn>
        <telerik:GridNumericColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST" DecimalDigits="1" FilterControlAltText="Filter column1 column"
            HeaderText="Test Column" UniqueName="TEST">
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator ForeColor="Red" ErrorMessage="!"></RequiredFieldValidator>                                                
                </ColumnValidationSettings>
        </telerik:GridNumericColumn>
        <telerik:GridBoundColumn AllowFiltering="False" AllowSorting="False"
            DataField="TEST_ID" FilterControlAltText="Filter column2 column"
            HeaderText="Test ID" UniqueName="TEST_ID" Visible="False">    
        </telerik:GridBoundColumn>
    </Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    <CommandItemTemplate>
        <table class="style1">
            <tr>
                <td align="right">
                    <asp:LinkButton ID="add" runat="server" CommandName="InitInsert"
                        ForeColor="#0066FF" Text="Add more"></asp:LinkButton>
                </td>
            </tr>
        </table>
    </CommandItemTemplate>
</MasterTableView>
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
<FilterMenu EnableImageSprites="False"></FilterMenu>
                    </telerik:RadGrid>

Adding Client Event in code behind

 Protected Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
   If TypeOf e.Item Is GridEditFormInsertItem OrElse TypeOf e.Item Is GridDataInsertItem Then
               
   Dim editor1 As GridDateTimeColumnEditor = CType(item.EditManager.GetColumnEditor("TEST_DATE"), GridDateTimeColumnEditor)
               
   Dim dtp1 As RadDateTimePicker = editor1.PickerControl                
               
                 dtp1.ClientEvents.OnDateSelected = "dateSelected"
                 Dim rtv1 As RadTimeView = editor1.SharedTimeView
                 rtv1.Interval = New TimeSpan(0, 30, 0)
   rtv1.OnClientTimeSelected = "timeSelecting"
             End If
     End If
 End Sub


Thanks
JJ
Top achievements
Rank 1
 answered on 30 Mar 2014
2 answers
190 views
I have an aspx web application develop with the Telerik ajax control suite version 2012.2.812.40 which is running on a Win2003 server and IIS version 6.

When the app is deployed under a virtual directory off one of the existing web sites it runs correctly, but when it is deployed on its own site, the Telerik controls are rendered with a different look and do not function properly.  The textbox control is used on the login page and in the latter case the width is smaller and the control always return a blank string to the logic, regardless of what is entered (the app therefore can't get past the login page).  See the attachments below; the urls for the sites are as follows:

Main Site: www.happc360.com
Virtual Directory Site: www.westernesse.com/happc360

Both deployments are pointing to the SAME location on the web server and therefore are running exactly the same code, style sheets, config, etc.  They are also running in the same application pool.

I have gone over the IIS properties of the main site and the virtual directory with a fine tooth comb, but can't see any significant differences.

What would be causing this?




Richard
Top achievements
Rank 1
 answered on 30 Mar 2014
0 answers
67 views
I need to make an empty RadGrid so that a user can click on add button  or remove button and start adding or deleting his information to the RadGrid and insert those information into a sql server table.( I just want to manipulate the data of that sql server table but I don't want to show the data of the table in the RadGrid)   I have tried all the example but it doesn't work for me. Please help me to find my way in this concept.
shemein
Top achievements
Rank 1
 asked on 30 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?