Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
921 views
Hi,
Export to csv modifies datetime data. DateTime column in my grid has data in following format""11/11/2011 1:50:51 PM
but after export it is modified to "11/11/2011 13:50:51".

How can I persist data on exporting/ modify it during  this event. I tried to use  "ExportCellFormatting" but it never fired for csv export.

Thanks,
Prava
Kostadin
Telerik team
 answered on 22 Jan 2013
3 answers
128 views
I am using RadAsyncUpload and cannot get it to work with more than one file.  

Basically, I'm using the FileUploaded event to save the file as a different filename (using a GUID) to ensure uniqueness.

This is what i am seeing (an example that I stepped through):

1. I upload two files on my form
2. After selecting the files and the status says they are complete, they are in the App_Data\Uploasd folder as:

fvcjn4uc.ls0
RadUploadTestFile
skhgx0p0.0at

3. I post the page

4. I step through and let it go through the first file, and it works, and I see that fvcjn4uc.ls0 is removed from App_Data\Uploads (e.g. only skhgx0p0.0at and RadUploadTestFile remains).

5. I then go through the next item in the foreach loop and it can access the filename and extension fine but when it does e.File.SaveAs(newFilename) I get (full path removed w/"HIDDEN"):

Could not find file 'C:\TFS\2010\[HIDDEN]\App_Data\Uploads\fvcjn4uc.ls0'.

But that's the filename of the FIRST file that was removed, why is it trying to access this again?
   
Code:


        protected void RadAsyncUploadAttachments_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            try
            {
                foreach (UploadedFile newfile in RadAsyncUploadAttachments.UploadedFiles)
                {
                    if (newfile != null)
                    {
                        string originalFilename = newfile.FileName;
                        string filename = Guid.NewGuid().ToString() + newfile.GetExtension();
                        string newFilename = RadAsyncUploadAttachments.TargetFolder + @"\" + filename;

                        e.File.SaveAs(newFilename);
                    }
                }
            }

            catch (Exception ex)
            {
                log.Error(ex);
            }
        }      

What am I missing?

Thanks,

Dave
Dave
Top achievements
Rank 1
 answered on 22 Jan 2013
1 answer
92 views

This is probably a newbie question, and is perhaps more of a javascript general question than a Telerik specific one. However, I guess many Telerik-developers know the answer :-)

In many cases, we need to keep track of some kind of state in client:

var someState;
  
function SomeEventHandler() {
      someState = someState + 1;
}

In the code-behind, we hook-up the event to some Telerik event:
theRadGrid.ClientSettings.ClientEvents.OnRowClick = "SomeEventHandler";

This works, if there is only one "theRadGrid" on the page, but if there are multiple instances of the control, we have problem, since "someState" is shared across instances, it is global to the page.

What is the best way to make state variables local to the instance?

Hope I made myself understood :-)

/Fredrik
Angel Petrov
Telerik team
 answered on 22 Jan 2013
1 answer
71 views
Hi,

I am using Telerik RadAsyncUpload and trying to get the keyboard control using the demo URL. I am using 2011.2.915.40 version.

http://demos.telerik.com/aspnet-ajax/asyncupload/examples/keyboardsupport/defaultcs.aspx

I am using the same code given in the demo URL, but unable to get the focus on Select button on Tab key press. Please suggest me what I am missing in the attached code.

Thanks!
Abhinav
Plamen
Telerik team
 answered on 22 Jan 2013
7 answers
526 views
Hello, Telerik,
I´m using a radgrid with 100% height and it works fine with Internet Explorer but I can not get it work with Chrome, where it seems to have 1% height, instead of 100%, so my grid is not visible.
This was working for me with Chrome and radcontrols for asp.net version, but now with rad controls for asp.net ajax and Chrome, it does not work,
Here is some parts of my code, I know I have to put height=100% to all the parent tags:
Can you help me, please.

<

 

body style="height:100%;margin:0px;padding:0;" scroll="no">
<form id="form1" enctype="multipart/form-data" runat="server" style="height:100%"

 

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

 

 

 

<asp:Panel ID="pnlExterior" runat="server" Width="100%" Height="100%" DefaultButton="ibtEnter">

 

<

 

telerik:RadCodeBlock ID="radcodigo" runat="server">

 

...

 

</telerik:RadCodeBlock>

 

<

 

telerik:RadSplitter ID="radsplitPagina" runat="server" Width="100%" Height="100%" Skin="Outlook" Orientation="horizontal" OnClientLoaded="FocoSplitterLoad">

 

 

 

<telerik:RadPane ID="radpanArriba" runat="server" Width="100%" Height="116px" Scrolling="None" CssClass="CeldaFondoClara">

 

...

 

</

 

telerik:RadPane>

 

 

 

<telerik:RadPane ID="radpanPagina" runat="server" Width="100%" Height="100%" Scrolling="None" CssClass="PosicionRelativa">

 

 

 

<table style="width: 100%" border="0" cellpadding="0" cellspacing="0">

 

...

 

 

 

 

 

</table>

 

 

 

<table style="width:100%;height:100%" border="0" cellspacing="0" cellpadding="0">

 

 

 

<tr>

 

 

 

<td valign="top" style="width:100%;height:100%">

 

<

 

telerik:RadGrid ID="gvw1" runat="server" AllowPaging="True" PageSize="25" Width="99.5%" Height="99%"

 

 

 

AllowSorting="True" AutoGenerateColumns="False" DataSourceID="odsClientes" GridLines="Horizontal" Skin="Yunke" EnableEmbeddedSkins="false"

 

 

 

OnItemDataBound="gvw1_ItemDataBound" OnSelectedIndexChanged="gvw1_SelectedIndexChanged">

 

...

 

 

 

<MasterTableView DataSourceID="odsClientes" DataKeyNames="intIDCodigoCliente_fl" Width="100%" TableLayout="Fixed"">

 

...

 

</

 

telerik:RadGrid>

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadPane>

 

</

 

telerik:RadSplitter>

 

 

 

 

 


Thanks for your time,
Daniel.

Galin
Telerik team
 answered on 22 Jan 2013
8 answers
522 views
i am trying with both gridboundColumn and with gridDatetime column but its is not working for any of ane.below is my code for sorting .
Please let me know if i had done any mistake in this ASAP.


<telerik:RadGrid ID="gvMessages" runat="server" AllowSorting="true" ShowGroupPanel="true"
                                                        PageSize="20" AllowPaging="True" AutoGenerateColumns="False" GridLines="Horizontal"
                                                        OnItemDataBound="gvMessages_ItemDataBound" OnNeedDataSource="gvMessages_NeedDataSource"
                                                        OnGroupsChanging="gvMessages_GroupsChanging" OnItemCreated="gvMessages_ItemCreated"
                                                        OnItemCommand="gvMessages_ItemCommand" AllowMultiRowSelection="true" OnRowDrop="gvMessages_RowDrop">
                                                        <HeaderContextMenu EnableAutoScroll="True" />
                                                        <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="MessageID,PhaseID"
                                                            ClientDataKeyNames="MessageID">
                                                            <SortExpressions>
                                                                <telerik:GridSortExpression FieldName="DateCreated" SortOrder="Descending" />
                                                                <telerik:GridSortExpression FieldName="DateCreated" SortOrder="Descending" />
                                                            </SortExpressions>
                                                            <Columns>
                                                                <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="MessageID" DataField="MessageId">
                                                                    <HeaderStyle Width="20px" />
                                                                    <ItemTemplate>
                                                                        <asp:Image ID="imgFiles" runat="server" ImageUrl="~/Images/attachment-icon.png" Height="18px"
                                                                            Width="17px" />
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                                <telerik:GridBoundColumn SortExpression="Email" AutoPostBackOnFilter="true" HeaderText="From"
                                                                    HeaderButtonType="TextButton" DataField="Email" UniqueName="Email">
                                                                    <HeaderStyle Width="150px" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn SortExpression="MessageSubject" AutoPostBackOnFilter="true"
                                                                    HeaderText="Subject" HeaderButtonType="TextButton" DataField="MessageSubject"
                                                                    UniqueName="MessageSubject">
                                                                    <HeaderStyle Width="200px" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn DataFormatString="{0:MM/dd/yyyy 00:00:00}" SortExpression="DateCreated"
                                                                    AutoPostBackOnFilter="true"  AllowSorting=true DataType="System.TimeSpan" HeaderText="Date" HeaderButtonType="TextButton"
                                                                    DataField="DateCreated" UniqueName="DateCreated">
                                                                    <HeaderStyle Width="200px" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn SortExpression="SenderName" AutoPostBackOnFilter="true"
                                                                    HeaderText="Created By" HeaderButtonType="TextButton" DataField="SenderName"
                                                                    UniqueName="SenderName">
                                                                    <HeaderStyle Width="200px" />
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="Phase Name" UniqueName="PhaseID"
                                                                    DataField="PhaseID">
                                                                    <HeaderStyle Width="200px" />
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblPhase" runat="server" Text='<%#Eval("TagName").ToString() %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                            </Columns>
                                                        </MasterTableView>
                                                        <ClientSettings>
                                                            <ClientEvents OnRowContextMenu="RowContextMenu1"></ClientEvents>
                                                            <Selecting AllowRowSelect="true" />
                                                        </ClientSettings>
                                                        <ClientSettings AllowDragToGroup="True" AllowRowsDragDrop="true" ReorderColumnsOnClient="True"
                                                            AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True">
                                                            <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True"
                                                                ClipCellContentOnResize="False"></Resizing>
                                                            <ClientEvents OnRowDblClick="ShowMessage" />
                                                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
                                                            <Selecting AllowRowSelect="True" />
                                                            <ClientEvents OnRowDropping="onRowDropping" />
                                                        </ClientSettings>
                                                        <GroupingSettings CaseSensitive="false" />
                                                    </telerik:RadGrid>

Thanks.
Mike
Top achievements
Rank 1
 answered on 22 Jan 2013
3 answers
64 views
Hi I was wondering when I click "Add New Record" on a Radgrid, and then click Insert, it will not show anything, all it says "No records to display." What do I need?
Kostadin
Telerik team
 answered on 22 Jan 2013
1 answer
76 views
How to change the text of the no records to display? 
Shinu
Top achievements
Rank 2
 answered on 22 Jan 2013
13 answers
1.4K+ views
I have seen demo of radgrid export to excel. but when I try to use this feature. I could not find it working for me. Grid shows the export button on commend item display but when I press that button page gets refreshed but there is no export behavior. Can anybody help me out on this issue?

Thanks.
Charan
Top achievements
Rank 1
 answered on 22 Jan 2013
1 answer
133 views
Why does your example of the AsyncUpload Control use Byte instead of Kb?
Plamen
Telerik team
 answered on 22 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?