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

From a hyperlink I need default values to appear when a RadGrid PopUp opens in "Add New" mode. It works fine when a RadButton is clicked (CommandName="InitInsert"). For that I set defaults in the RadGrid_ItemCommand:

if (e.CommandName == RadGrid.InitInsertCommandName)
{
    e.Canceled = true;
    Hashtable values = GetDefaultValues();
    e.Item.OwnerTableView.InsertItem(values);
}

The RadGrid's MasterTableView has EditMode="PopUp". To cause the PopUp to appear from a link I've passed the text "AddNew" in the queryString. Then in PageLoad I set RadGrid.MasterTableView.IsItemInserted = true; as described here. What I can't figure out is how do I get default values to appear in the PopUp that is triggered from a hyperlink? What event? A code sample would be much appreciated.

Konstantin Dikov
Telerik team
 answered on 07 Mar 2016
1 answer
84 views

I have radgrid, with 3 command buttons(Edit, Save and Cancel)

On Edit click Save and cancel buttons should be visible. (By default they should be disabled)

after Save or Cancel click grid goes to read only mode and only Edit command button should be displayed.

i tried all the possibilities by finding the command button and disabling it. Though there is no exception or anything still couldn't achieve this functionality.

Please help me out..it is needed immediately.

CODE :

  <telerik:RadGrid ID="gridMilitaryPension" runat="server" AutoGenerateColumns="false" AllowMultiRowEdit="true"  RenderMode="lightweight"
                     Skin="Office2007" PagerStyle-Mode="NextPrevAndNumeric" AllowPaging="True" PageSize="30" OnNeedDataSource="gridMilitaryPension_NeedDataSource"
                      OnItemCommand="gridMilitaryPension_ItemCommand" >
                        <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" Font-Size="10pt">                          
                            <Columns>                           
                             
                                 <telerik:GridBoundColumn UniqueName="ID" DataField="ID" HeaderText="ID" Display="true" ReadOnly="True"
                                    ForceExtractValue="Always">
                                </telerik:GridBoundColumn>

                                 <telerik:GridBoundColumn UniqueName="slottype" DataField="slottype" HeaderText="Slot Type" SortExpression="slottype" ReadOnly="True"
                                    ForceExtractValue="Always">
                                </telerik:GridBoundColumn>
                                 
                                 <telerik:GridTemplateColumn DataField="total" UniqueName="total" HeaderText="Total Seats" SortExpression="total">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTotalSeats" runat="server" Text='<%# Eval("total") %>' class="classLblTotal"></asp:Label>
                                      
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtTotalSeats" runat="server" Text='<%# Eval("total") %>' Width="100%"  class='<%# Eval("slottype") %>'  onblur="addition(this)" onchange="DataChanged(this)"></asp:TextBox>
                                    </EditItemTemplate>
                                 </telerik:GridTemplateColumn>

                            </Columns>
                          
                              <CommandItemTemplate>
                                  <table>
                                      <tr>                                     
                                         <td> <asp:Button runat="server" ID="btnSaveAllChanges" Text="Save All Changes"  CommandName="SaveAllChanges"  /></td>
                                         <td> <asp:Button runat="server" ID="btnCancel" Text="Cancel"  CommandName="Cancel" /></td>
                                         <td> <asp:Button runat="server" ID="btnEdit" Text="Edit Total Seats" CommandName="Edit"  onclick="btnEdit_Click"/></td>
                                       </tr>

                                  </table>
                                 
                              </CommandItemTemplate>
                           
                        </MasterTableView>
                      
                    
                    </telerik:RadGrid>

 

 

In code Behind:

 protected void gridMilitaryPension_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
           
            if (e.CommandName == "Edit")
            {

//Below i am capturing the controls and trying to hide/unhide. used visible property also but no luck
                GridCommandItem cmditem = (GridCommandItem)e.Item;
                Button btnSaveAllChanges = cmditem.FindControl("btnSaveAllChanges") as Button;
                Button btnCancel = cmditem.FindControl("btnCancel") as Button;
                Button btnEdit = cmditem.FindControl("btnEdit") as Button;
                btnSaveAllChanges.Enabled = true;
                btnCancel.Enabled = true;
                btnEdit.Enabled = false;            
             
                }                
            }
            if (e.CommandName == "SaveAllChanges")
            
            {
               //after logic, Edit button should be enabled.
                  
                }

             
                return;
            }
            if (e.CommandName == "Cancel")
            {
               
                gridMilitaryPension.MasterTableView.ClearEditItems();

                gridMilitaryPension.Rebind();  
            }
        }     

Konstantin Dikov
Telerik team
 answered on 07 Mar 2016
6 answers
377 views
I want to use radscheduler but am wondering if anyone has done syncing of radscheduler to Outlook. Is this a possibility? I'm not looking for an export feature but a sync.
Plamen
Telerik team
 answered on 07 Mar 2016
4 answers
93 views

I am trying to only show 5 min intervals but no matter what I do in code its only showing ie 10:10 ,10:20

Here is what I have tried so far I am using the demo to evulate it for our company.

 

                <telerik:RadScheduler runat="server" Skin="Bootstrap" ID="apertureAppointments" Width="100%" DataKeyField="ID" DataSubjectField="Subject"
                    DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"
                    DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="EntityDataSource1" StartInsertingInAdvancedForm="True"
                     RowHeight="30px" RenderMode="Auto" EnableDescriptionField="True" EnableExactTimeRendering="True"
                    DayStartTime="10:00:00"  DayView-DayStartTime="10:00:00" FirstDayOfWeek="Monday"  HoursPanelTimeFormat="H:mm:ss" LastDayOfWeek="Friday"     MinutesPerRow="5"
                        
                    >
                         
                    <ExportSettings OpenInNewWindow="True">
                        <Pdf PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" />
                    </ExportSettings>
                    <AdvancedForm Modal="True" />
 
                     
 
 
                    <TimeSlotContextMenus>
                        <telerik:RadSchedulerContextMenu ID="SchedulerTimeSlotContextMenu" runat="server">
                            <Items>
                                <telerik:RadMenuItem Text="New Appointment" Value="CommandAddAppointment" />
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadMenuItem Text="New Recurring Appointment" Value="CommandAddRecurringAppointment" />
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" />
                                <telerik:RadMenuItem Text="Show 24 hours..." Value="CommandShow24Hours" />
                            </Items>
                        </telerik:RadSchedulerContextMenu>
                    </TimeSlotContextMenus>
 
                    <AppointmentContextMenus>
                        <telerik:RadSchedulerContextMenu runat="server" ID="ContextMenu1">
                            <Items>
                                <telerik:RadMenuItem Text="Open" Value="CommandEdit" />
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadMenuItem Text="Categorize">
                                    <Items>
                                        <telerik:RadMenuItem Text="Development" Value="1" />
                                        <telerik:RadMenuItem Text="Marketing" Value="2" />
                                        <telerik:RadMenuItem Text="Personal" Value="3" />
                                        <telerik:RadMenuItem Text="Work" Value="4" />
                                    </Items>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
                            </Items>
                        </telerik:RadSchedulerContextMenu>
                    </AppointmentContextMenus>
                      <ResourceTypes>
    <telerik:ResourceType KeyField="ID" Name="Room" TextField="RoomName" ForeignKeyField="RoomID"
        DataSourceID="RoomsDataSource"></telerik:ResourceType>
    
</ResourceTypes>
                       <ResourceStyles>
                            
    <telerik:ResourceStyleMapping Type="User" Text="Alex" ApplyCssClass="rsCategoryBlue"></telerik:ResourceStyleMapping>
    <telerik:ResourceStyleMapping Type="User" Text="Bob" ApplyCssClass="rsCategoryOrange"></telerik:ResourceStyleMapping>
    <telerik:ResourceStyleMapping Type="User" Text="Charlie" ApplyCssClass="rsCategoryGreen"></telerik:ResourceStyleMapping>
</ResourceStyles>
                </telerik:RadScheduler>

 

Bozhidar
Telerik team
 answered on 07 Mar 2016
15 answers
265 views
Hello, I recently had to upgrade Telerik.Web.UI.dll on a client's server (DNN 06.01.05) to 2013.2.717.35 (previous version installed was 2011.*.*.35). I had to do this because I installed some customizations where I use the latest Telerik.dll version that is suitable for IE10 and all that stuff. Then I set up an assembly binding on web.config forcing old functionallity to use new version of the library.

Everything went fine until we discovered a problem trying to upload a file using FileExplorer on a DNN built in feature (not my customization)

[MissingMethodException: Method not found: 'Int32 Telerik.Web.UI.UploadedFile.get_ContentLength()'.]
   DotNetNuke.Providers.RadEditorProvider.TelerikFileBrowserProvider.StoreFile(UploadedFile file, String path, String name, String[] arguments) +0
   Telerik.Web.UI.RadFileExplorer.ProcessUploadedFiles() +1134
   Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +248
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Control.LoadRecursive() +190
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064

It seems that the signature of get_ContentLength() has changed in latest builds from returning an Int32 to an Int64.

The horror!

I'm in DNN 6. I tried to set an assembly binding on web.config to use both versions of the dll (previous DNN functionality using telerik version 2011 and my assemblies using Telerik version 2013). This seems to be working but now I'm getting an internal DNN error:

The base class includes the field '<componentName>', but its type (Telerik.Web.UI.RadWindowManager) is not compatible with the type of control (Telerik.Web.UI.RadWindowManager).

Since DNN is a very popular CMS I thought may be someone faced the same scenario and could give me a hand.

Any ideas on how to solve this problem?

Thanks in advance.

Juan
Ianko
Telerik team
 answered on 07 Mar 2016
1 answer
190 views

Hi,

Please let me know how to add RadclientDatasource in toolbox

I refer the following link : http://docs.telerik.com/devtools/aspnet-ajax/controls/clientdatasource/connecting-to-web-service

But there is no RadClientDataSource in toolbox.

While copying the code from the sample application , I got the error " Unknown server tag 'telerik:RadClientDataSource'.

Kindly advise.


Daniel
Telerik team
 answered on 04 Mar 2016
3 answers
316 views
Hi All,

I am using Radgrid into User Control. that user control defined into RadWindow in aspx page. when i am clicking the link button that window will popup and i want to assign datasource like. radgrid.get_masterTableView().set_dataSource(new Array()). but radgrid.get_masterTableView() return null values. i want to assign datasource only in client side. please let me know how to solve this issue.

Here i have attached code.

in aspx page

<asp:LinkButton ID="lnkSymptoms" runat="server" Text="Symptoms : " OnClientClick="return lnkSymptom_clientClick()"></asp:LinkButton>
<telerik:RadWindow runat="server" ID="rwSymptoms" Title="Symptoms" VisibleStatusbar="false"
                    Width="600px" Height="430px" Modal="true" EnableShadow="true" Skin="Web20" Opacity="100">
                    <ContentTemplate>
                        <div id="divSymptoms" runat="server">
                            <ucSymptom:ucSymptom ID="ucSymptomsCtrl" runat="server" />
                        </div>
                    </ContentTemplate>
                </telerik:RadWindow>

javascript

 function lnkSymptom_clientClick(sender, args) {
var rgSymptoms = $find("ctl00_ContentPlaceHolder1_rwSymptoms_C_ucSymptomsCtrl_rgSymptoms").get_masterTableView();             
                    rgSymptoms.set_dataSource(new Array());
                    rgSymptoms.dataBind();
}

ascx page

<telerik:RadGrid ID="rgSymptoms" runat="server" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"
                Width="370px" EnableViewState="false" PagerStyle-Visible="false" >
                <ClientSettings ClientEvents-OnCommand="function() {}" >                  
                </ClientSettings>
                <MasterTableView CommandItemDisplay="None" AutoGenerateColumns="false" AllowSorting="true"
                    AllowPaging="true" DataKeyNames="sys_con_id" ClientDataKeyNames="sys_con_id">
                    <NoRecordsTemplate>
                        <center>
                            No records to be displayed</center>
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="Description" HeaderText="Condition">
                            <ItemStyle VerticalAlign="Top" Wrap="false" HorizontalAlign="Left" />
                            <HeaderStyle Width="220px" />
                            <ItemTemplate>
                                <asp:Label ID="Description" runat="server" SkinID="NoBold"></asp:Label>
                                <asp:TextBox runat="server" ID="txtDesc" Style="display: none;" onchange="javascript:return UpdateOtherValue(this)"></asp:TextBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                    
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Thanks in Advance,
Dhamodharan.S


Eyup
Telerik team
 answered on 04 Mar 2016
1 answer
1.1K+ views
Hi, I am looking for the old version of Kendo UI (2014.1.624). Can you please let me know from where I can download it?
Peter Filipov
Telerik team
 answered on 04 Mar 2016
1 answer
109 views

Hello,

I need to change the text inside the ContextHeaderMenu in  a radgrid.

I have the following code on my Page_Load:

AddHandler RadGridTransmission.HeaderContextMenu.ItemCreated, AddressOf Me.ContextHeaderMenu_ItemCreated

And the following code to change text in the context menu:

Protected Sub ContextHeaderMenu_ItemCreated(ByVal sender As Object, _
ByVal e As RadMenuEventArgs)

If (e.Item.Value = "ColumnsContainer") Then
e.Item.Text = "Show/Hide columns"

ElseIf (e.Item.Level = 2) AndAlso (TryCast(e.Item.Parent, RadMenuItem).Value = "ColumnsContainer") Then
If (e.Item.Value.EndsWith("ReceiverID")) Then
  e.Item.Text = "Source Receiver ID"
End If

End Sub

 

The part that changes the text to "Show/Hide columns" works but the one to change the text for items in "ColumnsContainer" doesn't.

It finds the item, sets the text but does not change when I run the code.

Any idea?

Thanks!

Eyup
Telerik team
 answered on 04 Mar 2016
1 answer
618 views

Hi,
I am using version 2015.1.401.40 of the ASP.NET controls for AJAX.

I am hiding the expand / collapse icon for mastertable rows where the detailed table has no rows.  I am also setting the detail table to visible false. I'm doing both of these in the DetailTableDataBind like so:

e.DetailTableView.Visible = False

parentItem("ExpandColumn").Controls(0).Visible = False

I want the users to be able to expand and collapse all rows that have child data, so I added this property to the RadGrid:  EnableHierarchyExpandAll="true"

However, that expands EVERY SINGLE ROW, even the rows where I've removed the expand / collapse button and set the detail table to invisible.

Question:  Is there any way I can expand ONLY the rows that have an expand / collapse icon (only the rows that actually have detail data)?

I've looked a bit at the javascript you all use _expandAll, but don't think I can implement what I want to do...

Thanks,

Brent

 

Eyup
Telerik team
 answered on 04 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?