Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
497 views
Hi  folks, this is particularly difficult to explain, however I will try by best
at the moment I have a raddatetimepicker on a page,

I have a pagemethod that accepts  the value of the raddatetimepicker field and saves it to the database.
at present I am in New Zealand and the hosted application is on our server in the UK. if I enter in a date of say 23/apr/2010 13:00 the date is saved on the server as 23/apr/2010 01:00.  which I understand and accept.

However when I go to view the record back on my browser it shows the server time (this is because the date &time is actually bound to the control server side)  . I am sure that if  I save  the record again  that the time on the server will go to 22/apr/20101 13:00

what is the best way to ensure that times are correct,  I believe that using  UTC format may be the best way to go, but as yet I've not seen a good example for how to use this. or do I  supply the current time zone of the client to the  server and do my calculations there?

Many Thanks 

Mark



Radoslav
Telerik team
 answered on 29 Apr 2010
1 answer
131 views
I have attached code and sample output.  I have a binary image control in a column.  I load the control for each row in the grid and it displays correctly.  When I click on a row the corresponding PDF document is displayed correctly. however, the grid looks empty but the contents have actually moved way down the page.  Could you please tell me what I am doing wrong?

Thanks

{
    DocGrid = sender;
}
function DocRowSelected(sender, eventArgs) {
    // alert("Click on row with index: " + rowIndex);
    var MasterTable = DocGrid.get_masterTableView();
    var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
    var path = MasterTable.getCellByColumnUniqueName(row, "DT_FilePath").innerHTML;
    var Filename = MasterTable.getCellByColumnUniqueName(row, "DT_FileName").innerHTML;
    var Pgm
    Pgm = "DisplayDocument.aspx?File=" + path + Filename;
    open(Pgm);

}


<telerik:RadGrid ID="DocGrid" runat="server" AutoGenerateColumns="False"  Visible="False"
    DataSourceID="docDS" Skin="" OnItemDataBound="DocGrid_ItemDataBound" 
    Width="1000px" Height="800px" HorizontalAlign="Center" AllowSorting="True" >
            <ClientSettings >
                <Selecting AllowRowSelect="True"></Selecting>
                <ClientEvents OnRowClick="DocRowSelected" OnGridCreated="DocGridCreated">
                </ClientEvents>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
<MasterTableView DataSourceID="docDS" GridLines="Both">
    <Columns>
        <telerik:GridTemplateColumn UniqueName="imageColumn">
            <ItemTemplate>
                <telerik:RadBinaryImage ID="myPDF" runat="server" Height="260" Width="200" />
            </ItemTemplate>
            <HeaderStyle Width="200px" />
            <ItemStyle Height="260px" Width="200px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="DT_FileNum" Display="False"
            HeaderText="DT_FileNum" SortExpression="DT_FileNum" UniqueName="DT_FileNum">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_Desc" HeaderText="Document"
            SortExpression="DT_Desc" UniqueName="DT_Desc">
            <HeaderStyle Font-Bold="true" Font-Size="Medium" HorizontalAlign="Center"
                Width="400px" />
            <ItemStyle Font-Bold="True" Font-Size="Medium" HorizontalAlign="Left"
                Width="400px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_DateTime"
            DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
            HeaderText="Create Date" SortExpression="DT_DateTime" UniqueName="DT_DateTime">
            <HeaderStyle Font-Bold="true" Font-Size="Medium" HorizontalAlign="Center"
                Width="150px" />
            <ItemStyle Font-Bold="True" Font-Size="Medium" HorizontalAlign="Center"
                Width="150px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_Clerk" HeaderText="Clerk"
            SortExpression="DT_Clerk" UniqueName="DT_Clerk">
            <HeaderStyle Font-Bold="true" Font-Size="Medium" HorizontalAlign="Center"
                Width="200px" />
            <ItemStyle Font-Bold="True" Font-Size="Medium" HorizontalAlign="Center"
                Width="200px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_FilePath" Display="False"
            HeaderText="DT_FilePath" SortExpression="DT_FilePath" UniqueName="DT_FilePath">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_FileName" Display="False"
            HeaderText="DT_FileName" SortExpression="DT_FileName" UniqueName="DT_FileName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DT_DocumentCategory" Display="False"
            HeaderText="Category" SortExpression="DT_DocumentCategory"
            UniqueName="DT_DocumentCategory">
            <HeaderStyle Font-Bold="True" Width="80px" />
            <ItemStyle Font-Size="Small" />
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
  
</telerik:RadGrid>

    Protected Sub DocGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
        Dim GridItem As GridDataItem
        Dim myImage As PdfRasterizer
        Dim MyControl As RadBinaryImage
        Dim myImageSize As FixedImageSize = New FixedImageSize(196, 254)
        If Not TypeOf (e.Item) Is GridDataInsertItem Then
            If (TypeOf (e.Item) Is GridDataItem) Then
                Dim databounditem As GridDataItem = e.Item
                GridItem = e.Item
                ceTe.DynamicPDF.Rasterizer.PdfRasterizer.AddLicense("RST10NXDFAAALGWbGdA/Ngn6wTGmkU9PgO+wQPvVJHzsB7defcssnA4G1RG1bjmjlNG8QillITKUiVQt7T27hvFr1kacZA0rklJg")
                Try
                    If Left(databounditem("DT_Desc").Text, 11) = "Unspecified" Then
                        databounditem("DT_Desc").Text = Replace(databounditem("DT_Desc").Text, "Unspecified Service - ", "")
                    End If
                    myImage = New PdfRasterizer(Server.MapPath(BLLayer.ImagingVirtualPath) & "\" & databounditem("DT_FilePath").Text & databounditem("DT_FileName").Text)
                    MyControl = DirectCast(GridItem("imageColumn").FindControl("MyPDF"), RadBinaryImage)
                    MyControl.DataValue = myImage.Pages(0).Draw(ceTe.DynamicPDF.Rasterizer.BmpImageFormat.Bmp, myImageSize)
                Catch ex As Exception
                    If BLLayer.EmailErrors Then
                        BLLayer.MailException(ex, "QueryFinal error on Document tab.")
                    Else
                        Session("EX") = ex.Message
                        Session("EX2") = "QueryFinal error on Document tab."
                        Response.Redirect("ProgramError.aspx")
                    End If
                End Try
            End If
        End If
       
    End Sub
Veli
Telerik team
 answered on 29 Apr 2010
1 answer
72 views
Dear team,

I want to use the form template in radgrid edit mode to include the upload from the GridAttachmentColumn. I am using the form template becaue it gives me more flexibility.  Howver, i tried to use the radupload control but  i did not know how to access the binary data inorder to assign it to a byte field. Can you tell me how to format and place the upload field that is imbedded in the 

GridAttachmentColumn.

Thans in advance
Troy Horsford
troyhorsford@yahoo.com

Veli
Telerik team
 answered on 29 Apr 2010
1 answer
459 views
i wanto true ISInEditMode property of RadGrid But Its Give Below message.

Property or indexer 'Telerik.Web.UI.GridItem.IsInEditMode' cannot be assigned to -- it is read only 
Princy
Top achievements
Rank 2
 answered on 29 Apr 2010
4 answers
289 views
Hi,
i've got a RadTabStrip with few tabs, and i need to set a focus to a first element in javascript when clicking on tab.

already tryed solution provided in this thread :
but it throws me an exception :
 Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

Would be glad to hear any solituion or advice how to achieve such functionality.

Thank You !

Here is my code
        <table cellpadding="0" cellspacing="0" border="0" width="100%"> 
            <tr> 
                <td> 
                    <cc3:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" 
                        Width="100%" OnTabClick="RadTabStrip1_OnTabClick"> 
                        <Tabs> 
                            <cc3:RadTab Value="Profiles"> 
                            </cc3:RadTab> 
                            <cc3:RadTab Value="OtherInfomations"> 
                            </cc3:RadTab> 
                            <cc3:RadTab Value="Location"> 
                            </cc3:RadTab> 
                        </Tabs> 
                    </cc3:RadTabStrip> 
                    <cc3:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Width="100%"> 
                        <cc3:RadPageView ID="RadPageView1" runat="server"> 
                            <table cellpadding="0" cellspacing="0" border="0" width="100%"> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelUpdateStatus ID="lblUpdateStatus" runat="server"></cc2:LabelUpdateStatus> 
                                    </td> 
                                </tr> 
                            </table> 
                            <table cellpadding="2" cellspacing="2" border="0" width="100%" class="InputBox"> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreVisible" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <asp:CheckBox ID="chkStoreVisible" runat="server" Checked="true" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreOrder" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc3:RadNumericTextBox ID="txtStoreOrder" runat="server"> 
                                        </cc3:RadNumericTextBox> 
                                        <cc6:RequiredFieldValidator ID="RequiredField_StoreOrder" ControlToValidate="txtStoreOrder" 
                                            runat="server"></cc6:RequiredFieldValidator> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreName" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox150 ID="txtStoreName" runat="server"></cc4:TextBox150> 
                                        <cc6:RequiredFieldValidator ID="RequiredField_StoreName" ControlToValidate="txtStoreName" 
                                            runat="server"></cc6:RequiredFieldValidator> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreSlogan" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox150 ID="txtStoreSlogan" runat="server"></cc4:TextBox150> 
                                        <cc6:RequiredFieldValidator ID="RequiredField_StoreSlogan" ControlToValidate="txtStoreSlogan" 
                                            runat="server"></cc6:RequiredFieldValidator> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStorePhone" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox150 ID="txtStorePhone" runat="server"></cc4:TextBox150> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreFax" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox150 ID="txtStoreFax" runat="server"></cc4:TextBox150> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreType" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc3:RadComboBox ID="dropStoreTypes" runat="server"> 
                                        </cc3:RadComboBox> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreEmail" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox150 ID="txtStoreEmail" runat="server"></cc4:TextBox150> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreLogo" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <uc1:ChoseFile ID="txtStoreLogo" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreImage" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <uc1:ChoseFile ID="txtStoreImage" runat="server" /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <cc2:LabelBold ID="lblStoreAddress" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc4:TextBox500 ID="txtStoreAddress" runat="server"></cc4:TextBox500> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td valign="top"> 
                                        <cc2:LabelBold ID="lblStoreDescription" runat="server"></cc2:LabelBold> 
                                    </td> 
                                    <td> 
                                        <cc3:RadEditor ID="txtStoreDescription" runat="server" Width="100%"> 
                                        </cc3:RadEditor> 
                                    </td> 
                                </tr> 
                            </table> 
                        </cc3:RadPageView> 
                        <cc3:RadPageView ID="RadPageView2" runat="server"> 
                            <table cellpadding="2" cellspacing="2" border="0" width="100%" class="InputBox"> 
                                <tr> 
                                    <td> 
                                        <cc7:DataList ID="dtlInfos" runat="server" DataKeyField="InfoID" OnItemDataBound="dtlInfos_ItemDataBound"> 
                                            <HeaderTemplate> 
                                                <table cellpadding="2" cellspacing="2" border="0" width="100%"> 
                                            </HeaderTemplate> 
                                            <ItemTemplate> 
                                                <tr> 
                                                    <td style="text-align: right; padding-right: 5px; width:120px;"> 
                                                        <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("WebControl_ID") %>' /> 
                                                        <cc2:LabelBold ID="lblInfoName" runat="server" Text='<%# Eval("InfoName") %>'></cc2:LabelBold> 
                                                        <asp:CheckBox ID="chkInfoEnable" runat="server" /> 
                                                    </td> 
                                                    <td> 
                                                        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
                                                </tr> 
                                            </ItemTemplate> 
                                            <FooterTemplate> 
                                                </table> 
                                            </FooterTemplate> 
                                        </cc7:DataList> 
                                    </td> 
                                </tr> 
                            </table> 
                        </cc3:RadPageView> 
                        <cc3:RadPageView ID="RadPageView3" runat="server"> 
 
                            <script type="text/javascript" language="javascript"> 
 
                                var geocoder = null; 
                                var map = null; 
 
                                function initialize() { 
                                    if (GBrowserIsCompatible()) { 
                                        geocoder = new GClientGeocoder(); 
 
                                        map = new GMap2(document.getElementById('map_canvas')); 
                                        map.setCenter(new GLatLng(45.05, 7.6667), 13); 
                                        //map.addControl(new GLargeMapControl()); 
                                        //map.addControl(new GMapTypeControl()); 
                                        map.setUIToDefault(); 
                                        geocoder = new GClientGeocoder(); 
                                    } 
                                } 
 
                                function showAddress() { 
                                    var address = document.getElementById('<%= txtAddress.ClientID %>').value; 
                                    //alert(address.value); 
 
                                    if (geocoder) { 
                                        geocoder.getLatLng(address, 
                        function(point) { 
                                if (!point) { 
                                    var hiddendField_AddressNotFound = document.getElementById('<%= HiddenField_AddressNotFound.ClientID %>').value; 
                                    alert(address + ' ' + hiddendField_AddressNotFound); 
                                } else { 
                                    map.setCenter(point, 13); 
 
                                    // Set up icon 
                                    var blueIcon = new GIcon(G_DEFAULT_ICON); 
                                    blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png"; 
                                    // Set up our GMarkerOptions object 
                                    markerOptions = { icon: blueIcon, draggable: true }; 
 
                                    var marker = new GMarker(point, markerOptions); 
                                    GEvent.addListener(marker, 'dragstart', function() { map.closeInfoWindow(); }); 
                                    GEvent.addListener(marker, 'dragend', function() { 
                                        var vitri = map.getCenter(); 
                                        var test = marker.getLatLng(); 
                                        var vido = test.lat().toString(); 
                                        var kinhdo = test.lng().toString(); 
 
                                        var txtLatitude = document.getElementById('<%= txtLatitude.ClientID %>'); 
                                        txtLatitude.value = vido; 
                                        var txtLongitude = document.getElementById('<%= txtLongitude.ClientID %>'); 
                                        txtLongitude.value = kinhdo; 
                                    }) 
                                    map.addOverlay(marker); 
 
                                    var hiddenField_InfoWindowHtml = document.getElementById('<%= HiddenField_InfoWindowHtml.ClientID %>').value; 
                                    marker.openInfoWindowHtml(hiddenField_InfoWindowHtml); 
                                    } 
                                    }); 
                                    } 
                                } 
                            </script> 
 
                            <asp:HiddenField ID="HiddenField_AddressNotFound" runat="server" /> 
                            <asp:HiddenField ID="HiddenField_InfoWindowHtml" runat="server" /> 
                            <table cellpadding="2" cellspacing="2" border="0" width="100%" class="InputBox"> 
                                <tr> 
                                    <td> 
                                        <cc4:TextBox500 ID="txtAddress" runat="server"> Doan ke thien, Hanoi </cc4:TextBox500> 
                                        <cc5:Button ID="btnSearch" OnClientClick="showAddress(); return false;" runat="server" /><br /> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        <table cellpadding="2" cellspacing="2" border="0" width="100%"> 
                                            <tr> 
                                                <td> 
                                                    <cc2:LabelBold ID="lblLatitude" runat="server"></cc2:LabelBold> 
                                                </td> 
                                                <td> 
                                                    <cc4:TextBox150 ID="txtLatitude" Text="0" runat="server"></cc4:TextBox150> 
                                                </td> 
                                                <td> 
                                                    <cc2:LabelBold ID="lblLongitude" runat="server"></cc2:LabelBold> 
                                                </td> 
                                                <td> 
                                                    <cc4:TextBox150 ID="txtLongitude" Text="0" runat="server"></cc4:TextBox150> 
                                                </td> 
                                            </tr> 
                                        </table> 
                                    </td> 
                                </tr> 
                                <tr> 
                                    <td> 
                                        &nbsp; 
                                        <asp:Literal ID="js" runat="server"></asp:Literal> 
                                        <div id="map_canvas" style="width: 80%; height: 768px;"> 
                                        </div> 
                                    </td> 
                                </tr> 
                            </table> 
                        </cc3:RadPageView> 
                    </cc3:RadMultiPage> 
                </td> 
            </tr> 
        </table> 
        <table cellpadding="2" cellspacing="2" border="0" width="100%" class="InputBox" style="margin: 10px 0 0 0;"> 
            <tr> 
                <td> 
                    <cc5:ButtonAdd ID="btnAdd" runat="server" OnClick="btnAdd_Click" /> 
                    <cc5:ButtonDelete ID="btnDelete" runat="server" OnClick="btnDelete_Click" /> 
                    <cc5:ButtonCancel ID="btnCancel" runat="server" OnClick="btnCancel_Click" /> 
                    <cc5:ButtonBack ID="btnBack" runat="server" OnClick="btnBack_Click" /> 
                </td> 
            </tr> 
        </table> 


VnDevil
Top achievements
Rank 2
 answered on 29 Apr 2010
1 answer
41 views
Hello,

I have a strange problem, maybe someone else encountered it.
I'm using a RadGrid with a NestedTemplate for each row, inside the NestedTemplate I'm displaying a DetailsView control with Edit and Delete buttons.
The Edit button works fine, but the Delete button doesn't work at first! If the user enter the edit mode, even if only to press Cancel, the Delete button works fine, but otherwise it doesn't work.
I tried to catch the Delete button OnClick event but there is no event. The button itself has an OnClientClick event that does work everytime.
Another strange feature is, then I remove the AjaxManager that enable the RadGrid to update the Delete Button works fine. But I must use it for other controls.

I hope it makes sense to someone

Thanks

Eyal
Yavor
Telerik team
 answered on 29 Apr 2010
7 answers
136 views
I am trying to set the Box2's value to (100 - Box1.value). I tried several things but it seems that OnTextChanged does not work as expected. I get method not supported error. In other cases i get an error } is missing. Any ideas? Link? thanks

Dimo
Telerik team
 answered on 29 Apr 2010
4 answers
134 views
Hi,
When i go to tools in IDE of VS2008 and click on generate local resources, a .resx file is created. but it contains entries of only asp controls.Is there any tool or any setting that i can do to get the entries for telerik controls as well as the as controls inside the telerik controls? Please help
Manasi Vartak
Top achievements
Rank 1
 answered on 29 Apr 2010
1 answer
122 views
I am using radcalendar with multi-month view. When a date is selected, I can use the following code to obtain the exact date selected:

e.SelectedDates[e.SelectedDates.Count - 1].Date

However, if the user clicks on the same date again to de-select it, how do I obtain that date? I need to get that date to continue with some business logic.

Thanks!

Frank
Maria Ilieva
Telerik team
 answered on 29 Apr 2010
1 answer
163 views
Hello,

I have a RadChart in Gantt Mode showing project management related information
I am opening a Radalert window when user clicks on different zones of this chart, that shows some additional information.

I am building a Java Script in the 'code behind' module following the known method documented on the site, i.e.:
(http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind.aspx). Works ok.

What I would like to do is to show the radalert window as non-modal so that the user can have several windows opened at the same time. Is this possible or should  to use a different technique and not a radAlert?
If this is the case, then  can you please provide a resource showing how to do it?
Please note that I don't click a control (button, etc) it's just a zone on the chart.

Thank you,
M. Rusu

Georgi Tunev
Telerik team
 answered on 29 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?