Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
80 views
Hi,
I have used the Advance edit template for my scheduler,I which I'm trying to Bind the Date value but some how Its not binding and giving me the the error "Specified cast is Invalid".The Dateformat is "MM/dd/yyyy" ,used the raddatepicker.
advanceusercontrol.ascx.cs
 [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
       
public DateTime Start
        {          
get          {                    return  Convert.ToDateTime(dpDtofVisit.DbSelectedDate.ToString());                      }            set          {               dpDtofVisit.DbSelectedDate = value;                      }      }

webform1.aspx 
<AdvancedEditTemplate><br><span class="Apple-tab-span" style="white-space:pre">               </span>    <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"  Subject='<%# Bind("Reason") %>'<br><span class="Apple-tab-span" style="white-space:pre">                  </span>    Name='<%# Bind("Name") %>'   Office='<%# Bind("Office") %>' Status='<%# Bind("Status") %>' Start='<%# Bind("DATE") %>'  <br>                      <span class="Apple-tab-span" style="white-space:pre">   </span> PatientName='<%# Bind("PatNum") %>'  /><span class="Apple-tab-span" style="white-space:pre">      </span>                       <span class="Apple-tab-span" style="white-space:pre">      </span>   <br><span class="Apple-tab-span" style="white-space:pre">           </span>    </AdvancedEditTemplate>

I have placed the sample code which i tried .
"Start='<%# Bind("DATE") %>'   " this section gives me the error

Regards
"
Ivana
Telerik team
 answered on 24 Apr 2012
3 answers
125 views
Hello,
I just downloaded the latest version of the Scheduler and am trying to make a year long calendar of people's schedule,  pretty similar to a Gantt chart.  My schedule is not granular enough to consider time, so I believe the Timeline view is the best fit.  However, I am running into some very frustrating configuration with the Scheduler while trying to do this.

First, I thought it would be easy to simply pick a date range that I wanted to view...it's not.  You have to pick a start date and calculate the "NumberOfSlots" and set the "SlotDuration" to 1 day.  While this is not complicated, it certainly was not the experience I expected from a Schedule control, let alone a Telerik control, and it took playing around with it awhile to get it to do this.
On a side note, when I try to show 365 slots, 1 per day, I have been receiving a javascript, but that's a issue for another forum post.

Second, I have not found a way to display an entire year, with each time slot being 1 month.  The closest I can come is to set the "NumberOfSlots" to 12 and the "SlotDuration" to 30...but this isn't at all accurate.  Is there a way that I have not found to do this?

Any thoughts would be greatly appreciated,
Thanks,
-Aaron


Peter
Telerik team
 answered on 24 Apr 2012
5 answers
524 views
I know I must be doing something wrong here, but cannot figure out what it is.

Scenario:

I've got an ajaxified radGrid. It has a link button within one of the columns. I've added a conditionalpostback for this link button so when it fires it does a regular postback. but when the link button is pressed, the ItemCommand event gets fired twice for some reason. on clicking the linkbutton, i'm showing/hiding panels. Also, the grid exists within a user control, if that would make any difference.

any help is appreciated.


 <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"
    <script type="text/javascript"
 
 
           function conditionalPostback(sender, eventArgs) { 
               debugger; 
                if (eventArgs.get_eventTarget().indexOf("lbtnViewInfo") > -1) { 
                    eventArgs.set_enableAjax(false); 
                } 
 
            } 
               </script> 
    </telerik:RadScriptBlock> 
<telerik:RadAjaxManager ID="ramSearch" runat="server"
    <AjaxSettings>     
        <telerik:AjaxSetting AjaxControlID="rgGrid"
                <UpdatedControls>                     
                  <telerik:AjaxUpdatedControl ControlID="rgGrid" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                </UpdatedControls>                                   
            </telerik:AjaxSetting>   
    </AjaxSettings> 
        <ClientEvents OnRequestStart="conditionalPostback" /> 
    </telerik:RadAjaxManager>  

 <telerik:RadGrid ID="rgGrid" runat="server" Width="100%" ShowStatusBar="False"  
           AutoGenerateColumns="False" PageSize="10" EnableViewState="true" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" Visible="true"
          
         
          <MasterTableView Width="100%" DataKeyNames="IDNumber"  AllowMultiColumnSorting="False">   
           <NoRecordsTemplate><div class="noRecords">Your search criteria did not return any results, or you did not first select any criteria to search on.</div> 
            </NoRecordsTemplate>       
         
                               
                <Columns> 
                    
                  <telerik:GridTemplateColumn UniqueName="FullName" SortExpression="FullName" HeaderText="Student Name" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Left"  HeaderStyle-HorizontalAlign="Center">   
                        <ItemTemplate>  
                        <asp:LinkButton ID="lbtnViewInfo" Font-Underline="true"  runat="server" CausesValidation="false" CommandName="ViewInfo" Width="100%" Text='<%#Eval("FullName") %>' />  
                        </ItemTemplate>  
                    </telerik:GridTemplateColumn>                                                                                                                                                         
                    </telerik:GridBoundColumn>                     
 
                </Columns> 
           </MasterTableView> 
       </telerik:RadGrid>    
Private Sub rgGrid_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgGrid.ItemCommand 
           
            Select Case e.CommandName 
                Case "ViewInfo" 
                 
                     panelInfo.Visible = True 
                     pnlsearch.Visible = False 
                     pnlGrid.Visible = False 
 
                Case Else 
                    Exit Sub 
            End Select 
        End Sub 

Radoslav
Telerik team
 answered on 24 Apr 2012
2 answers
192 views
The subject says it all :) I have a GridBinaryImageColumn in a RadGrid as:
<telerik:GridBinaryImageColumn
    DataAlternateTextField="Title"
    DataField="BinaryContent"
    HeaderText="Image"
    ImageAlign="NotSet"
    ImageHeight="120px"
    ImageWidth="120px"
    ResizeMode="Fit"
    UniqueName="BinaryContent">
</telerik:GridBinaryImageColumn>

I'm using code-behind and Entity Framework and want to take the binary content of the selected file and set that to the appropriate entity property (which is of course byte[]).

How? All the samples I can find are declarative or not quite what I want. Here's an example of where I'd like to place such functionality:

protected void SetValues(GridCommandEventArgs e)
{
    if (e == null)
    {
        return;
    }
 
    if (!(e.Item is GridEditableItem))
    {
        return;
    }
 
    var editedItem = e.Item as GridEditableItem;
 
    var hashTable = new Hashtable();
 
    e.Item.OwnerTableView.ExtractValuesFromItem(hashTable, editedItem);
 
    // Simpler form of access naturally won't work.
    if (hashTable.ContainsKey("BinaryContent"))
    {
        // I KNOW I can't access the content like this:
        //  this.EntityBinaryContent = hashTable["BinaryContent"] == null
        //     ? null
        //     : SomeUtility.ConvertToBytes(hashTable["BinaryContent"]);
 
        // But at this stage, with what I have to work with (e) etc.
        // How can I easily get hold of the upload bytes?
    }
}

Edit: Should mention the intention is that the binary data goes into the database and the file is never saved to a file system. So, I can't work with an uploaded file as there won't be one.

Many thanks,
Richard
Richard Weeks
Top achievements
Rank 2
 answered on 24 Apr 2012
1 answer
93 views
I have a page that uses three RadMenus—one is horizontal and two vertical. I need to use a different properties on the horizontal menu than on the vertical ones. What is the simplest way to accomplish this?

Thanks!
John
Princy
Top achievements
Rank 2
 answered on 24 Apr 2012
1 answer
521 views
i want to change date format ( mm/dd/yyyy to dd/mm/yyyy) at Scheduler control.

e.g
http://demos.telerik.com/aspnet-ajax/scheduler/examples/outlook2007/defaultcs.aspx

at scheduler control, month view, when i point today (20) then pop up 4/20/2012
i want to change 20/4/2012
Plamen
Telerik team
 answered on 24 Apr 2012
11 answers
736 views
Hi,
I've have to radgrid binded from List in asp.net.
Each row in radgrid has action column, ImageButton which has VIEW|EDIT|DELETE
when Edit is clicked radwindow should display selected row details in popup and save button just displays modified row text on the radgrid back

Thanks
Krishna
Princy
Top achievements
Rank 2
 answered on 24 Apr 2012
2 answers
66 views
Can't get to the forums using Chrome. Had to use IE9 to post this thread!
Jeremy
Top achievements
Rank 1
 answered on 24 Apr 2012
2 answers
259 views

I have a rad menu with several items.  The menu items lead to different places depending on a few things, so i'm trying to implement an OnClick handler in the code behind to redirect appropriately.  I've tried all kinds of combinations and scoured the forums and nothing has worked so far.  

   My OnClick method is just a stub right now with a breakpoint so I can see when it gets called, only it isn't getting called, and I'm redirected to the default.aspx page. 

Ths is within a user control, if that matters.  Are you aware of anything that could cause this behavior? 

protected void RadMenu_ItemClick(object sender, RadMenuEventArgs e)
        {
            int i = 0;
            String s = e.Item.Value;
        }

<radM:RadMenu ID="RadMenu" runat="server"  OnItemClick="RadMenu_ItemClick" >
    <Items>
         <radM:RadMenuItem runat="server" ID="sampleItem" Text="Click Me" />
    </Items>
</radM:RadMenu>
Phil
Top achievements
Rank 2
 answered on 24 Apr 2012
2 answers
101 views
I have a link that looks like;

<a href="javascript:;" onclick="xlaAFMopenfaq(1);" class="HeaderLink">Customer Service</a>


How do I add it to a NavigateURL in a menu item?
Phil
Top achievements
Rank 2
 answered on 24 Apr 2012
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?