Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
105 views
Hello All,

I have using a RadFileExplorer for uploading a images/docs . So when i click on the upload toolbar and then uploaded a images from that after i images uploadingh the toolbar became disabled like the attach files.Please Provide me the solution for this problem . it is urgent  for me
Vessy
Telerik team
 answered on 18 Mar 2014
1 answer
73 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="MultipleExpandedItems"
                    Width="80%">
                    <Items>
                         <telerik:RadPanelItem Expanded="True" Text="Verbruik" runat="server"
                              Selected="true">
                              <Items>
                                   <telerik:RadPanelItem Value="Verbruik" runat="server">
                                        <ItemTemplate>
                                            <div>
                                                <!--radgrid + datasource Verbruik-->
                                                <div id="radgridVerbruik">
                                                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
                                                        <telerik:RadGrid ID="RadGridVerbruik" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                                                            AllowAutomaticUpdates="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik">
                                                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSourceInstallatieJaarVectorVerbruik"
                                                                EditMode="Batch" CommandItemDisplay="Top" CommandItemSettings-ShowSaveChangesButton="false"
                                                                CommandItemSettings-AddNewRecordText="Nieuwe vector" CommandItemSettings-CancelChangesText="Annuleer">
                                                                <BatchEditingSettings EditType="Row" />
                                                                <Columns>
                                                                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" HeaderText="ID"
                                                                        ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
                                                                    </telerik:GridBoundColumn>
                                                                     
                                                                    <telerik:GridTemplateColumn DataField="vectorID" FilterControlAltText="Filter Vector column"
                                                                        HeaderText="Vector" SortExpression="Vector" UniqueName="vectorID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Vector") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList2" runat="server" DataSourceID="SqlDataSourceVectorenVerbruik"
                                                                                DataTextField="omschrijving" DataValueField="vectorID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn DataField="eenheidID" FilterControlAltText="Filter Eenheid column"
                                                                        HeaderText="Eenheid" SortExpression="Eenheid" UniqueName="eenheidID">
                                                                        <ItemTemplate>
                                                                            <%# Eval("Eenheid") %>
                                                                        </ItemTemplate>
                                                                        <EditItemTemplate>
                                                                            <telerik:RadDropDownList ID="RadDropDownList3" runat="server" DataSourceID="SqlDataSourceEenheden"
                                                                                DataTextField="omschrijving" DataValueField="eenheidID">
                                                                            </telerik:RadDropDownList>
                                                                        </EditItemTemplate>
                                                                    </telerik:GridTemplateColumn>
Angel Petrov
Telerik team
 answered on 18 Mar 2014
1 answer
188 views
For my internship I have to work with Telerik which is going great since the forums is up to date and I can find many tutorials.
I started to combine tricks etc for the better effect.

For the project I have to do, I have to change the values in a dropdownlist whenever the values of the other dropdownlist is changed.
Not that difficult normally.

However I am trying to do this when both dropdownlists are in the editmode(batch) of a radgrid, which is in a radpanel. I can't figure out how to acces the changeselectedvalue event

Now my question is, is it possible to trigger this event while the dropdownlists is in a Radgrid in editmode batch?
In the first attachment is a part of my code with both the columns selected.
In the second is how my page looks right now (all data from 'Eenheid'). I wanna change the databound of 'Eenheid' whenever I change the value of 'Vector'


Jeffrey
Angel Petrov
Telerik team
 answered on 18 Mar 2014
1 answer
248 views
My requirement is that when the user clicks the edit command on the parent row, all rows in the child table should be put into edit mode. I tried the following in the grid's itemcommand event, but it didn't work:

                   Dim dataitem As GridDataItem = DirectCast(e.CommandSource, GridDataItem)
                   For Each editItem As GridDataItem In dataitem.ChildItem.NestedTableViews(0).Items
                        editItem.Edit = True
                   Next
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Mar 2014
2 answers
749 views

Hello, I have a RadGrid with an EditFormType set to 'Template'. I can't figure out how to access form elements inside this FormTemplate from the code behind. I'm trying to make one drop down change its options when another one is selected.

When I try to compile this code, it tells me "The name 'drpEditTarget' does not exists in the current context.". If I move that drop-down outside of the RadGrid, it's suddenly accessible again. I guess my two questions are...
--1) How can I access this element from the code behind?
--2) What's the difference between elements outside and inside the Grid? Why can I access the former but not the latter? (the answer to this might be a more broad asp.net question)

Default.aspx

<Telerik:RadGrid ID="RequestsGrid"runat="server" OnNeedDataSource="RequestsGrid_NeedDataSource" OnCancelCommand="RequestGrid_CancelCommand" OnDeleteCommand="RequestsGrid_DeleteCommand" OnItemCommand="RequestGrid_ItemCommand" OnItemDataBound="RequestsGrid_ItemDataBound" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="true" DataSourceID="requests">
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="id,requester,output,notes" DataSourceID="requests" CommandItemDisplay="Bottom">
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditColumn"></EditColumn>
            <FormTemplate>
                        <b>First Target:</b>
                        <asp:DropDownList runat="server" SelectedValue='<%# Eval("target") %>' ID="drpEditTarget" AutoPostBack="true" DataSource='<%# getPossibleTargets( (string)Eval("output") ) %>' OnSelectedIndexChanged="drpEditTarget_SelectedIndexChanged"></asp:DropDownList>
                        <b>Second Target:</b></td>
                        <asp:DropDownList runat="server" ID="drpEditSecondTarget"></asp:DropDownList>
                <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" />
                <asp:Button ID="btnCancel" CommandName="Cancel" Text="Cancel" runat="server" />
            </FormTemplate>
        </EditFormSettings>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditButton" Visible="false" ItemStyle-CssClass="skinny"/>
            <telerik:GridButtonColumn Text="Delete" UniqueName="DeleteButton" CommandName="Delete"></telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="id" HeaderText="ID" UniqueName="id"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="requester" HeaderText="Requester" UniqueName="requester"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="output" HeaderText="Output" UniqueName="output"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="notes" HeaderText="Notes" UniqueName="notes"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn Text="Approve" UniqueName="ApproveButton" CommandName="Approve"></telerik:GridButtonColumn>
            <telerik:GridButtonColumn Text="Deny" UniqueName="DenyButton" CommandName="Deny"></telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</Telerik:RadGrid>

Default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        populateGrid();
  
        if (!Page.IsPostBack)
        {
            setFilterOptions();
            RequestsGrid.Rebind();
        }
    }
      
    protected void drpEditTarget_SelectedIndexChanged(object sender, EventArgs e)
    {
        drpEditSecondTarget.DataSource = getPossibleDestinations( drpEditTarget.SelectedValue.ToString() );
        drpEditSecondTarget.DataBind();
    }
}
Jay
Top achievements
Rank 1
 answered on 18 Mar 2014
4 answers
87 views
 I have a column named Rate and another Named LaborHours

The rate column can be two values:  REGULAR and OVERTIME

I want the to totals in the footer:  REGULAR 5,  OVERTIME 10

The code below works in my MS DataGrid, cannot figure out how to get it to work under RadGrid

You help is much appreciated!

If e.Row.RowType = DataControlRowType.DataRow Then
   Dim MilesOrHours As String
   MilesOrHours = (DataBinder.Eval(e.Row.DataItem, "Rate"))

   If MilesOrHours = "MI" Then
     Dim HourTotal As Decimal
     HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
     grdMilesTotal = grdMilesTotal + HourTotal
     Session("grandMilesTotal") = Session("grandMilesTotal") + grdMilesTotal

  Else

     Dim HourTotal As Decimal
     HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
     grdHoursTotal = grdHoursTotal + HourTotal
     Session("grandHoursTotal") = Session("grandHoursTotal") + grdHoursTotal

   End If

End If



If e.Row.RowType = DataControlRowType.Footer Then
    Me.txtHrs.Text = Session("grandHourstotal")
    Me.txtMiles.Text = Session("grandMilesTotal")

    Session("grandMilestotal") = "0"
    Session("grandHourstotal") = "0"
End If

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Mar 2014
5 answers
391 views
I am using AutoGeneratedColumns for checkbox but I can only use integer for datasource. help me to find right way to convert int value(as 1 or 0) to checkbox column and also how to enable that  AutoGenerated checkbox column.
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
5 answers
821 views
I upgraded to new Telerik version 2013.1.220.35 from 2010.3.1109.35. and compatibility issues started...

 

<telerik:RadGrid runat="server" ID="FileListView" AutoGenerateColumns="false" Skin="Windows7" 

Width="100%" OnDeleteCommand="FileListView_DeleteCommand">

<MasterTableView>

<Columns>

<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete"

ConfirmTitle="Confirm" ConfirmText="Continue deleting file?" /> <telerik:GridBoundColumn UniqueName="file" DataField="file" Visible="false" ReadOnly="true" />

 <telerik:GridBoundColumn UniqueName="Attachedfiles" DataField="Attached files" HeaderText="File" />

 <telerik:GridBoundColumn UniqueName="Attachedby" DataField="Editor" HeaderText="Attached by" />

 <telerik:GridBoundColumn UniqueName="Attachedat" DataField="Modified" HeaderText="Attached at" />

 </Columns>

 </MasterTableView>

 </telerik:RadGrid>

 

protected void FileListView_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 {
GridEditableItem editedItem = e.Item as GridEditableItem;

 string filename = editedItem["file"].Text;
logic continues...

but in the above code filename has &nbsp as the value. means filename contains empty space as it value instead of actual file name

Please suggest. 

Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
3 answers
123 views
Hello Team,

I needed to select RadCombox1 and disable using javascript but I found $find with RadCombox returns null.Is there any work around for this because I am currently blocked on this?
 
1.<telerik:RadComboBox ID="RadCombox1" runat="server" >
2.     <Items>
3.         <telerik:RadComboBoxItem Text="Aba" Value="1" />
4.         <telerik:RadComboBoxItem Text="Enugu" Value="2" />
5.     </Items>
6. </telerik:RadComboBox>
7. 
8. var badRad = $find("<%= RadCombox1.ClientID %>");

the value of badRad  is null. Can someone help?

Thanks,
Nsi.
Shinu
Top achievements
Rank 2
 answered on 18 Mar 2014
0 answers
95 views
Hi, I'm using 2013 Q1 SP1 controls and AjaxControlsToolKit 4.5, I have a RadComboBox and a ModalPopupExtender with a panel, In the Site.Master I'm put the ToolKitScriptManager. When I run locally the application run good! But when I publish on Azure (http://test1bam.azurewebsites.net/webform1.aspx) both controls don't work, the radcombox dont show the list of items and the panel show the content, dont show any error. I attach two images  where locally work fine, my web.config, the webform1.aspx, and the site1.master.


[WebForm1.aspx]
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="testRadControl.WebForm1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="descripcion" DataValueField="id"></telerik:RadComboBox>
&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button1" runat="server" Text="Abrir Modal" />
    <br />
    <br />
    <asp:Panel ID="Panel1" runat="server">
        hola<asp:Button ID="Button2" runat="server" Text="Cerrar Modal" />
    </asp:Panel>
    <asp:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server"  Enabled="True" PopupControlID="Panel1" TargetControlID="Button1">
    </asp:ModalPopupExtender>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT [descripcion], [id] FROM [producto]"></asp:SqlDataSource>
</asp:Content>


[Site1.Master]
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="testRadControl.Site1" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
       <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">    
            
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>



[web.config]
<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="DefaultConnection" connectionString="Server=tcp:e9jnq1pavz.database.windows.net,1433;Database=xx;User ID=xx;Password=xx.;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5" />
    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
    </handlers>
  </system.webServer>
</configuration>
Omar
Top achievements
Rank 1
 asked on 17 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?