Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
485 views

I am trying to format a date column to MM/dd/yyyy but reguardless of what formatting I attempt it continues to return M/d/yyyy hh:mm:ss AM.

On load of the page I set the ObjetDataSource and convert to a datatable

public static DataTable LoadGrid()
        {
            using (Model.Entities db = new Model.Entities())
            {
                List<Model.FileDetailViewNew> fileView = (from filing in db.FileDetailViewNews
                                                          select filing).ToList();
 
                DataTable table = ToDataTable(fileView);
                return table;
            }
 
        }
 
        private static DataTable ToDataTable<T>(List<T> items)
        {
            DataTable dataTable = new DataTable(typeof(T).Name);
 
            //Get all the properties
            PropertyInfo[] Props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
            foreach (PropertyInfo prop in Props)
            {
                //Setting column names as Property names
                dataTable.Columns.Add(prop.Name);
            }
            foreach (T item in items)
            {
                var values = new object[Props.Length];
                for (int i = 0; i < Props.Length; i++)
                {
                    //inserting property values to datatable rows
                    values[i] = Props[i].GetValue(item, null);
                }
                dataTable.Rows.Add(values);
            }
            //put a breakpoint here and check datatable
            return dataTable;
        }
 

 I then on the page set the grid to the datasource

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="AllFilings" SelectMethod="LoadGrid"></asp:ObjectDataSource>
 
                                <div id="load" style="display: none; color: Red">
                                    <b> Updating filing status please wait...</b>
                                </div>
                                <div id="status" style="color: Red">
                                </div>
                                <telerik:RadGrid ID="gridFilings" runat="server" PageSize="20" AllowPaging="True" AllowSorting="True"
                                    AutoGenerateColumns="False" EnableAJAX="True" DataSourceID="ObjectDataSource1"
                                    EnableAJAXLoadingTemplate="True" GridLines="None" LoadingTemplateTransparency="50" EnableLinqExpressions="false"
                                    ShowStatusBar="True" Skin="Outlook" Width="98%" ShowGroupPanel="True">
                                    <ClientSettings AllowDragToGroup="True">
                                        <Selecting AllowRowSelect="True" />
                                    </ClientSettings>
                                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                                    <MasterTableView DataKeyNames="FileID" DataSourceID="ObjectDataSource1" AllowCustomSorting="true">
 

 and then on the grid item

 

<telerik:GridTemplateColumn DataField="DateIn" HeaderText="Date In" SortExpression="DateIn"                                                UniqueName="DateIn" GroupByExpression="DateIn Group By DateIn">
         <ItemTemplate>
                 <%# Eval("DateIn","{0:yyyy MMMM/dd}")%>
         </ItemTemplate>
         <HeaderStyle CssClass="headerLeft" />
</telerik:GridTemplateColumn>

 I have tried  numerous different formatting styles with no success.  I have also tried to change it to a DateTimeColumn and format it there and it stiil continues to show  for example 6/4/2014 12:00:00 AM

 

 

 

Kostadin
Telerik team
 answered on 15 Jun 2015
2 answers
377 views

Hi 

 

I have incorporated a RadHtmlChart on my application and have all the data binding and series set up done client side. The chart displays and has the required functionality except for one thing:

The first time I click on a legend item nothing happens. After this any subsequent clicks have the desired outcome i.e. the series' and legend item's visibility changes. I am not sure why the initial click does not perform these default functions but the 2nd, 3rd, etc clicks do. Can you help? Is there an initialisation I am missing that is triggered by the first click? Is there an extra bind/refresh/redraw needed?

 I appreciate there is no code listed but I'm hoping this is a generic question that someone can help me with.

 

Thanks

Michael

Danail Vasilev
Telerik team
 answered on 15 Jun 2015
25 answers
1.0K+ views
I am having trouble modifying files via RadFileExplorer. 

I can see my trees and I can upload files no problem. However, I cannot delete files or folders and I cannot rename files or folders. 

Whenever I try a delete or rename operation on a file, I get this popup:
The selected file could not be deleted because the application did not have enough permissions.

When I try to create a new folder, I get this popup:
The selected folder could not be created because the application did not have enough permissions.

I have granted the ASP.NET user full rights to the folders and files in question. I can see that the ASP.NET user is the owner of the files I am uploading, so that should be the right user. That didn't work, so I explicitly granted full rights to myself and Everyone just to see if that would fix it... no luck.

My environment is IIS 5 on XP SP3. My ASP.NET application is setup to use Windows authentication.

This is clearly a security issue, but I don't see what I am missing. Please advise.

Thanks - Jeff




Antony
Top achievements
Rank 1
Iron
 answered on 15 Jun 2015
4 answers
175 views
I have followed all the posts I can find, looked at the Demo's online and tried some of them synergetically. Here is where I am at.

I have a RadGrid "Prometheus" running in a DNN module on the 3.5 framework using the OnNeedDataSource event.

The grid is using AJAX, a RadLoadingPanel, and a RadAjaxManager to handle all the AJAX events.

I am also using the RadGrid Reporting Functionalities but not within the Pager - they are image buttons on the page.

I included the two panels, one asp:panel one telerik:RadAjaxPanel and set the asp:panel's default button but that doesn't seem to work for me. So here is my code:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<script type="text/javascript"
     
    function OnRequestStart(sender, args) 
    { 
                 
        args.set_enableAjax(true); 
     
    } 
     
    function OnResponseEnd(sender, args) 
    { 
         
        args.set_enableAjax(false); 
         
    } 
     
</script> 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="radGrid"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="alpGrid" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
    <ClientEvents OnRequestStart="OnRequestStart" OnResponseEnd="OnResponseEnd" /> 
</telerik:RadAjaxManager> 
<telerik:RadAjaxPanel ID="radPanel" runat="server" ClientEvents-OnRequestStart="OnResponseEnd" ClientEvents-OnResponseEnd="OnRequestStart"
    <asp:ImageButton ID="cmdExportToExcel" Style="cursor: pointer;" ImageUrl="~/DesktopModules/Slideshow/Images/excel-tips-tricks.png" 
        AlternateText="Export to Excel" runat="server"  
        onclick="cmdExportToExcel_Click"></asp:ImageButton> 
    <asp:ImageButton ID="cmdExportToWord" Style="cursor: pointer;" ImageUrl="~/DesktopModules/Slideshow/Images/word-tips-tricks.png" 
        AlternateText="Export to Word" runat="server"  
        onclick="cmdExportToWord_Click"></asp:ImageButton> 
    <asp:ImageButton ID="cmdExportToPdf" Style="cursor: pointer;" ImageUrl="~/DesktopModules/Slideshow/Images/pdf_icon.gif" Width="35px" 
        AlternateText="Export to Pdf" runat="server"  
        onclick="cmdExportToPdf_Click"></asp:ImageButton> 
    <asp:Label ID="lblExport" runat="server" /> 
</telerik:RadAjaxPanel> 
<telerik:RadAjaxLoadingPanel ID="alpGrid" runat="server" Transparency="30"
     <asp:Image ID="Image1" ImageUrl="~/DesktopModules/Slideshow/images/loading.gif" AlternateText="Loading. Please wait..." BorderWidth="0px" runat="server"></asp:Image> 
</telerik:RadAjaxLoadingPanel> 

By setting the javascript args this way, I know that the grid will behavior will exhibit AJAX functionality.

What I would like to do is use the JavaScript to disable the AJAX and produce the needed result. In this scenario if I had only one button (Excel, Pdf, or Word) everything would work fine and I wouldn't be writing this post. So here is the crux of the issue.

No matter which button I press first - the page will attempt to export that type.
so if I click excel it works. Then I decide to click pdf - it exports excel again.

If I simply change the sorting on the radGrid, then click pdf it works normally again. Then I decide to export Word. It once again attempts to export pdf.

And so on...

Obviously, there is something that is storing the export type here... I am thinking that its somewhere in the DOM. Where is it stored, and can I reset or clear it using a JavaScript function?

Thanks In Advance!

John
Allen
Top achievements
Rank 2
Iron
Veteran
 answered on 14 Jun 2015
9 answers
191 views
I have the following css file for my slider :
/* RadSlider for ASP.NET AJAX Default Skin */
  
.RadSlider .rslTrack
{
    border-color:#b9b9b9 #939393 #939393 #b9b9b9;
    height:400px;
  
  
}
  
.RadSlider .rslHorizontal a.rslHandle
{
    background-image:url('Slider/Handles.gif');
          
}
  
.RadSlider .rslHorizontal a.rslDraghandle
{
    background-image:url('Slider/DragHandle.gif');
          
}
  
.RadSlider .rslTop a.rslDraghandle
{
    background-image:url('Slider/DragHandleDown.gif');
          
}
  
.RadSlider .rslHorizontal .rslTrack
{
    background:url('Slider/TrackBgr.gif') repeat-x;
      
}
  
.RadSlider .rslHorizontal .rslSelectedregion
{
    background:url('Slider/SelectedRegionHorizontalBgr.gif') right top no-repeat;
          
}
  
/* vertical slider */
.RadSlider .rslVertical
  
}
  
.RadSlider .rslVertical a.rslHandle
{
  
    background-image:url('Slider/HandlesVertical.gif');
}
  
.RadSlider .rslVertical .rslTrack
{
    height:500px;
   
    background: url('Slider/TrackVerticalBgr.gif') repeat-y ;
      
}
  
.RadSlider .rslVertical .rslSelectedregion
{
   height:100px;
    background:url('Slider/SelectedRegionVerticalBgr.gif') left bottom no-repeat;
}
  
.RadSlider .rslVertical a.rslDraghandle
{
     
    background:url('Slider/DragVerticalHandle.gif') no-repeat;
}
  
.RadSlider .rslLeft a.rslDraghandle
{   
    background:url('Slider/DragVerticalHandleRight.gif') no-repeat;
}
  
.RadSlider .rslItem,
.RadSlider .rslLargeTick span
{   
    color:#333;
      
}
  
.RadSlider .rslItemsWrapper .rslItemSelected
{   
    color:#000;
}
  
/* horizontal slider items */
.RadSlider .rslHorizontal .rslItem
{   
    background-image:url('Slider/ItemHorizontalBgr.gif');
}
  
/* vertical slider items */
.RadSlider .rslVertical .rslItem
{
      
    background-image:url('Slider/ItemVerticalBgr.gif');
}
  
/* horizontal slider - TrackPosition=Top/Bottom */
.RadSlider .rslTop .rslSmallTick,
.RadSlider .rslBottom .rslSmallTick
{   
    background-image:url('Slider/SmallChangeHorizontal.gif');
}
  
.RadSlider .rslTop .rslLargeTick,
.RadSlider .rslBottom .rslLargeTick
{   
    background-image:url('Slider/LargeChangeHorizontal.gif');
}
  
/* vertical slider - TrackPosition=Left/Right */
.RadSlider .rslLeft .rslSmallTick,
.RadSlider .rslRight .rslSmallTick
    background-image:url('Slider/SmallChangeVertical.gif');
}
  
.RadSlider .rslLeft .rslLargeTick,
.RadSlider .rslRight .rslLargeTick 
{   
    background-image:url('Slider/LargelChangeVertical.gif');
}
  
/* horizontal slider - TrackPosition=Center */
.RadSlider .rslMiddle .rslSmallTick
{   
    background-image:url('Slider/SmallChangeMiddleHorizontal.gif');
}
  
.RadSlider .rslMiddle .rslLargeTick  
{   
    background-image:url('Slider/LargeChangeMiddleHorizontal.gif');
}
  
/* vertical slider - TrackPosition=Center */
.RadSlider .rslCenter .rslSmallTick
{   
    background-image:url('Slider/SmallChangeCenterVertical.gif');
}
  
.RadSlider .rslCenter .rslLargeTick
{   
    background-image:url('Slider/LargelChangeCenterVertical.gif');
}
  
  
 DIV.RadSlider .rslTrack {
  
  
    WIDTH: 500px;
  
}


How can i change it's height?i tried to add height:500px; in several places but nothing worked
Sajad
Top achievements
Rank 1
 answered on 14 Jun 2015
4 answers
317 views
Hi,

I'm trying to position my pie chart at the left side of the div.

I've found the title position:

<ChartTitle Text="Total">
    <Appearance Align="Center" BackgroundColor="White" Position="Top"></Appearance>
</ChartTitle>

And the legend position:

<Legend>
    <Appearance BackgroundColor="White" Position="Right" Visible="true"></Appearance>
</Legend>

But I didn't find how to position the chart itself, to be aligned to the left, and not to the center.
Currently it's always at the center of its containing div.

Thanks,
Guy Segev.
Stewart
Top achievements
Rank 1
 answered on 13 Jun 2015
3 answers
333 views
We have an application that uses a RadEditor on a RadWindow to allow our users to edit HTML content, which works perfectly in IE (versions 7 and above tested) but not Firefox (various 3.x versions tested).  In IE, if the content extends beyond the viewable RadEditor content area in any of the 3 modes (Design, HTML, or Preview), a vertical scrollbar appears.  In FF, if the content extends beyond the viewable RadEditor content area, a vertical scrollbar appears in HTML mode but not in Design or Preview mode.  Any thoughts on why this might happen and how to correct it?  Please see the attached images to see the different views in FF and how they appear versus the screenshot of the same popup window in IE.
Praveen
Top achievements
Rank 1
 answered on 13 Jun 2015
7 answers
363 views
Hi

I need to access the value of a GridTemplateColumn in the iteminsertet event.
It is working fine with GridBoundColumn.

 

<telerik:GridBoundColumn DataField="contactmobile" HeaderText="Mobile"
SortExpression="mobile" UniqueName="contactmobile">
</telerik:GridBoundColumn>

<telerik:GridTemplateColumn DataField="address" HeaderText="Address"
         SortExpression="Address" UniqueName="Address">
<EditItemTemplate>
     <asp:TextBox ID="addressTextBox" TextMode="MultiLine" Width="300px" Height="75px"
     runat="server" Text='<%# Bind("address") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="addressLabel" runat="server" Text='<%# Eval("address") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>

 


code behind:
        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
        {
            GridEditFormInsertItem editformItem = (GridEditFormInsertItem)e.Item;
            TextBox contactmobile = (TextBox)editformItem["contactmobile"].Controls[0];
            // working fine
            TextBox address = (TextBox)editformItem["address"].Controls[0];
            // working fine not working 
            // dumps with Cannot find cell bound to column with unique name 'address'
     }

How do I read the value from Address here ??
Thx
Torben

 

Mangal
Top achievements
Rank 1
 answered on 13 Jun 2015
5 answers
472 views
Good day:

grid.get_masterTableView().rebind() not firing after any of the following process:

Insert
Delete
Update

Leaving me to manually refreshing the page before seeing the updates inside the grid. I'm doing client side dataBinding and using the ClientDataSource.

I'm not sure if it is my coding giving the problem or there is a bug in both later versions of the Telerik UI for ASP.Net AJAX 2014 (Q2 - 2104.2.618 and Q3 - 2014.3.1209)

I'm attaching the link to my projects for you to review.

https://drive.google.com/folderview?id=0BzWUZQhT9G4oZWwyN2NNcEJBUXc&usp=sharing


Anticipating a speedy response.

Thanks you
Jonathan
Top achievements
Rank 1
 answered on 12 Jun 2015
1 answer
86 views

Hello,

I have implemented a drag-drop from one Radgrid to another. When the target grid receives a drop, it updates a SQL table. The target grid is using a DataSourceID to the said SQL table. I have placed a Radgrid.Rebind() in the postback call. Everything works great - except for the first time. When I drop the first item, the target grid does not update but I can see that it updated the SQL table. After the first item, I can continuously drop more items from the source grid and the target grid will refresh every time to represent the data in the SQL table using the Rebind in postback. What would cause the first instance of a rebind to not work properly?

I saw on some posts to place the Rebind in the page's PreRender event but that also did not work. Any suggestions are much appreciated. Thank you.

Jonathan
Top achievements
Rank 1
 answered on 12 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?