Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
54 views

Hello

Any hints on how to solve this in javascript ?

 I need radcombo to show normal selecttext list when open, but a different selecttext when closed.

 ex. Items a,b,c    

  when "b" selected and radcombo closes i should show "mytext"

 

any clues would be appreciated.

 

regards

Mark

 

 

Plamen
Telerik team
 answered on 10 Apr 2015
1 answer
74 views

I have a radPanelBar that is is bound to an SqlDataSource. Normally I would use findcontrol in the OnItemDataBound event to access the controls in the template as follows:

 

Private Sub rpbVehicles_ItemDataBound(sender As Object, e As RadPanelBarEventArgs) Handles rpbVehicles.ItemDataBound
 
       Dim imgThumb As Image = e.Item.FindControl("imgThumb")
 
End Sub

But apparently ItemDataBound is too early in the cycle to access controls as findcontrol always returns Nothing.

I can access the controls in the ItemCreated event, but how do I access the DataItems there?

I want to do something like:

Private Sub rpbVehicles_ItemCreated(sender As Object, e As RadPanelBarEventArgs) Handles rpbVehicles.ItemCreated
 
Dim vehicleID As Integer = e.Item.DataItem("ItemID")
Dim cbShow As CheckBox = e.Item.FindControl("cbShow")
cbShow.Attributes.Add("VehicleID", vehicleID.ToString)
 
End Sub

 

How do I access the DataItems?

 

Thanks

 

Charles

 

Ivan Danchev
Telerik team
 answered on 10 Apr 2015
1 answer
226 views

Hi, 

I have an AutoGenerate delete link in my aspx page.  

AutoGenerateDeleteColumn="True"

Currently, when the use clicks on the delete button, the record is deleted without any warning or confirmation. How can I ask the user if they are sure of the deleting the record or not? After confirmation only the record should be deleted. I am currently deleting the records from the DeleteCommand event in the code behind. 

I saw a thread about the same issue, but I am not able to understand, how can I set the ConfirmText property for the AutoGenerateDeleteColumn. Can anyone help me with addition of this feature without requiring to change my current set up. Thanks..

Pavlina
Telerik team
 answered on 10 Apr 2015
1 answer
102 views

Hi there,

I am trying to implement getting data for the Scheduler (Q1 2014) via a Web Service.

I have followed the instructions and created a new class derived from SchedulerInfo.

 

My aspx contains the following: <telerik:RadScheduler ID="RadScheduler1" runat="server" OnAppointmentsPopulating="RadScheduler1_AppointmentsPopulating" OnResourcesPopulating="RadScheduler1_ResourcesPopulating">
            <WebServiceSettings Path="SchedulerWebService.asmx" ResourcePopulationMode="ServerSide" />
  
        </telerik:RadScheduler>

 

I can add custom values to this in the server side code using

protected void RadScheduler1_ResourcesPopulating(object sender, Telerik.Web.UI.ResourcesPopulatingEventArgs e)

 so I seem to be on the right course.

 

However, when I try to do the same for the AppointmentsPopulating event, this is never fired.

 

 

 

Have I done something obviously wrong?

Bozhidar
Telerik team
 answered on 10 Apr 2015
2 answers
156 views

Hi All

 I have a question that might be easy to answer, but since I'm new to Telerik, I can't figure out the answer

my situation is like this

I have a RADGRID on a Webform , I changed the Columns backcolor at design time

 and i have to change some cells backcolor programatically according to certain condition 'i.e I change the color of a cell if it has negative value '

 my Problem is

 when i export the RADGRID to Excel with the EXPORT To Excel button of the Commanditem,

i get an excel sheet with the same colors for the columns as they are in the RADGRID

but the programatically changed backcolor for the negative cells are not exported

 it have no backcolor in the produced Excel sheet

 Although I welcome any solution whether C# or VB , I'll be grateful if you provide a solution in VB.NET

 Your Prompt response is highly appreciated

Regards

 

Eyup
Telerik team
 answered on 10 Apr 2015
7 answers
485 views
Hi,

I set a textbox to be focussed from server side inside the IsPostBack event as txtUserName.Focus(). Once the page gets rendered completely my focus is retained in that control but the empty mesage in that textbox is still there. My empty message is still there as normal text so once if i start typing the text also the empty message is still there like this,
If my empty message is like "Enter user name" and if i start typing it is like "adminEnter user name".

Rest of the textbox in the page is working as per functionality but only if i set focus to a textbox that textbox alone looses the style,,,

Any help......
Eyup
Telerik team
 answered on 10 Apr 2015
5 answers
1.5K+ views
Hi,

I want initilize text of my Rad Grid on the OnInit(EventArgs e) method. How set, for example, the text and HeaderText of this GridButtonColumn ?

<telerik:RadGrid runat="server" ID="grid1"  ....>
                <MasterTableView DataKeyNames="Id1" ....>
                    <Columns>
                        <telerik:GridButtonColumn CommandName="Edit" ButtonType="ImageButton" Text="Modifier" HeaderText="Edit" UniqueName="EditColumn"></telerik:GridButtonColumn>
...
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Thanks
Eyup
Telerik team
 answered on 10 Apr 2015
1 answer
68 views

Hi

I have a radGrid with template columns.

Inside one of them, there is radNumericTextBox which fire the client events onValueChanged, that go through each row to make some calculation.

I'd like to make everything client-side without any postback, but I'm not able to access the value of the radNumericTextBox.

Is there a way to do this?

 

Here is the code:

 

<telerik:RadGrid ID="GrdCartList" runat="server" AutoGenerateColumns="false" OnNeedDataSource="GrdCartList_NeedDataSource" Skin="Bootstrap">
    <MasterTableView DataKeyNames="ProductId">
        <Columns>
            <telerik:GridTemplateColumn DataField="ProductId" FilterControlAltText="Filter ProductId column" FilterControlWidth="100px"
                HeaderText="Id" UniqueName="ProductId" SortExpression="ProductId" AutoPostBackOnFilter="true">
                <ItemTemplate>
                    #<%# Eval("ProductId") %>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ProductName" FilterControlAltText="Filter ProductName column" FilterControlWidth="350px"
                HeaderText="Prodotto" UniqueName="ProductName" SortExpression="ProductName" AutoPostBackOnFilter="true">
                <ItemTemplate>
                    <%# Eval("BrandName") %> - <strong><%# Eval("ProductName") %></strong>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ProductSellPrice" FilterControlAltText="Filter ProductSellPrice column" FilterControlWidth="150px"
                HeaderText="Prezzo" UniqueName="ProductSellPrice" SortExpression="ProductSellPrice" AutoPostBackOnFilter="true">
                <ItemTemplate>
                    <%# Eval("ProductSellPrice") %>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ScProductQuantity" FilterControlAltText="Filter ScProductQuantity column" FilterControlWidth="150px"
                HeaderText="Quantita'" UniqueName="ScProductQuantity" SortExpression="ScProductQuantity" AutoPostBackOnFilter="true">
                <ItemTemplate>
                    <telerik:RadNumericTextBox ID="TxtQuantity" runat="server" Value='<%# Convert.ToInt32(Eval("ScProductQuantity")) %>' NumberFormat-DecimalDigits="0"
                        Type="Number" MinValue="1" ShowSpinButtons="true" >
                        <ClientEvents OnValueChanged="onClientValueChanged" />
                    </telerik:RadNumericTextBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 
 
 
<script type="text/javascript">
    function onClientValueChanged(sender, args) {
        calculateCart();
    }
 
    function calculateCart() {
        var grid = $find("<%=GrdCartList.ClientID %>");
        var masterTableView = grid.get_masterTableView();
        var selectedRows = masterTableView.get_dataItems();
        var total = 0;
 
        for (var i = 0; i < selectedRows.length; i++) {
            var row = selectedRows[i];
            var cellPrice = masterTableView.getCellByColumnUniqueName(row, "ProductSellPrice")
            var cellQty = masterTableView.getCellByColumnUniqueName(row, "ScProductQuantity")
            alert(cellQty.innerHTML);
                 
            // total += (cellPrice.innerHTML * cellQty.innerHTML);
 
        }
    }
</script>

 

 

 

Konstantin Dikov
Telerik team
 answered on 10 Apr 2015
1 answer
141 views

Hi I am having some difficulties after setting the Row height for the radscheduler to something other than the default.

It seems that after the row height is changed the end time of the actual appointment block created no longer matched what was set via the editor. i.e. I create an appoint from 12:00 - 15:00 and the scheduler will show the appointment running from 12:00 - 13:00.

I also noticed the same happens in the Scheduler demo (Scheduler - Day, Week and Multi-day Views) Is there any fix for this?

Plamen
Telerik team
 answered on 10 Apr 2015
2 answers
128 views

Hi,

i implemented an .aspx page, with a RadScheduler.

1. <telerik:RadScheduler ID="RadScheduler1" runat="server" Culture="Italian (Italy)"     ProviderName="AllotmentSchedulerData" SelectedView="TimelineView" DayEndTime="08:00:00" AdvancedForm-EnableCustomAttributeEditing="True" CustomAttributeNames="Contingente Camere,Release,Attivo,explode" RowHeight="55px" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" ShowHoursColumn="False" WorkDayEndTime="08:00:00"       OverflowBehavior="Expand" Style="top: 0px; left: 0px" MonthHeaderDateFormat="MMMM, yyyy" StartInsertingInAdvancedForm="True" >
   <AppointmentTemplate>
    <asp:Label runat="server" ID="RecurrenceIcon" />
    <%# Eval("Subject") %>
    <asp:Label runat="server" ID="TCpL" />
    <asp:Label runat="server" ID="TCL" />
   </AppointmentTemplate>
   <MonthView VisibleAppointmentsPerDay="5" HeaderDateFormat="MMMM, yyyy" />
   <TimelineView HeaderDateFormat="dd/MM/yyyy" NumberOfSlots="25" SlotDuration="1.00:00:00" ColumnHeaderDateFormat="dd/MM" ShowInsertArea="true" GroupBy="roomType" GroupingDirection="Vertical"  /><DayView DayEndTime="08:00:00" ShowHoursColumn="False" WorkDayEndTime="08:00:00" UserSelectable="False" /><WeekView UserSelectable="False"/>
</telerik:RadScheduler>

 

...and this is the code behind

 

1.<p>  Private Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated</p><p> .............</p><p>            Dim chk2 As CheckBox = e.Container.FindControl("AllDayEvent")<br>            Dim chk1 As CheckBox = e.Container.FindControl("RecurrentAppointment")<br>            Dim chk3 As RadTimePicker = e.Container.FindControl("StartTime")<br>            Dim chk4 As RadTimePicker = e.Container.FindControl("EndTime")<br><br>            CType(e.Container.FindControl("AllDayEvent"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")<br>            CType(e.Container.FindControl("RecurrentAppointment"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")<br>            CType(e.Container.FindControl("StartTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")<br>            CType(e.Container.FindControl("EndTime"), RadTimePicker).Style.Add(HtmlTextWriterStyle.Visibility, "none")</p><p>...............</p><p>End Sub</p>

 

the code "CType(e.Container.FindControl("RecurrentAppointment"), CheckBox).Style.Add(HtmlTextWriterStyle.Visibility, "hidden")" returns me an error, in the ScriptResource.axd file (Object reference not set to an instance of an object)

the variable chk1 is "Nothing".

 

 Any idea how to solve the issue?

 

Thanks in advance

 

Plamen
Telerik team
 answered on 10 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?