Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
651 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.6K+ 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
95 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
168 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
146 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
0 answers
72 views

hi,

i am adding dynamic radcombox boxes with checkboxes .

 

example code:

for(int i=0;i<44;i++)

{

 RadComboBox DdlSections = new RadComboBox();
                                    DdlSections.CheckBoxes = true;

 DdlSections.ID = "DdlSections_" + (i + 1);

 DdlSections.DataSource = GetCCDSTemplates;//getting from database
                                            DdlSections.DataTextField = "SectionName";
                                            DdlSections.DataValueField = "SectionID";
                                            DdlSections.DataBind();

    divsection.Controls.Add(DdlSections);// adding these controls to div

}

now i want to read these radcomboboxes in button click

is it possible? please send me answer asap

raju
Top achievements
Rank 1
 asked on 10 Apr 2015
2 answers
207 views
We have some users with IE8 that during editing if they highlight some text and select bold and italics it adds some question marks to the beginning of the text they changed.  If I attempt the same thing with IE11 I never see the question marks appear.   The HTML code shows "<strong>?<em>?" has been inserted for the users with IE8.  Anyway to keep this from happening? (other than upgrading IE)
brijesh
Top achievements
Rank 1
 answered on 10 Apr 2015
1 answer
371 views

Upon clicking btnSearch, it disables it with telerik's SingleClick=true property. If validation fails it doesn't postback and I try to set the button back to being enabled but it doesn't get set. It still is disabled with the text saying "Searching...".What I am trying to do is if it fails the validation, I want the button to be enabled again. Right now if i click on it and validation fails, it gets stuck being disabled.

 

<telerik:RadButton ID="btnSearch"  Text="Search" SingleClick="true" OnClick="btnSearch_Click" OnClientClicking="Validate" SingleClickText="Searching..." ></telerik:RadButton>

 

function Validate(button, args) {
     if (error) {
button.set_autoPostBack(true);               
} else { //validation fails                           
button.set_autoPostBack(false);                 
button.set_enabled(true); // i have currently              
 }

Misho
Telerik team
 answered on 10 Apr 2015
1 answer
149 views

i have createtd grids commanditemtemplate programmaticly according to the code you provide in your documentation.

         addButton = new LinkButton();
         addButton.ID = "addButton";
         addButton.Text = "Add record";
         addButton.CommandName = "InitInsert";

Clicking addButton doesnt show a new empty record but postbacks an opens an edittemplate (witch was never defined).

I'd like to have the same behavoir as by using the built in save-button (add a new, empty record).

Is this possible with Rad-Grid ??

 

Thanks for any help.

 

 

 

 

Eyup
Telerik team
 answered on 10 Apr 2015
6 answers
185 views
I have a page that has a list of available companies on the left and the list of selected companies on the right.  I can successfully transfer (move) items from left to right, but not right to left.  I have done the same functionality in a different project and it works just fine.  I event copied that code into this project and it doesn't transfer right to left.  My original code is running under Telerik version 2014.1.403.40.  This code is using  2015.1.225.45.
Markup:
<tr>
    <td>
        <telerik:RadListBox runat="server" ID="radCompany" Sort="Ascending" AllowTransfer="True" TransferToID="radSelectedCompanies" Width="300px"
            Height="200px" AutoPostBackOnTransfer="True" AllowTransferOnDoubleClick="True" EnableDragAndDrop="True" TransferMode="Move"
            SelectionMode="Multiple" OnTransferred="radCompany_OnTransferred" EnableMarkMatches="True">
            <ButtonSettings TransferButtons="TransferFrom,TransferTo" ShowTransfer="True"></ButtonSettings>
        </telerik:RadListBox>
    </td>
    <td>
        <telerik:RadListBox runat="server" ID="radSelectedCompanies" Sort="Ascending" Width="265px" Height="200px" SelectionMode="Multiple"
            EnableMarkMatches="True">
        </telerik:RadListBox>
    </td>
</tr>

Code behind (C#):
//loads list of companies
private void LoadUserCompanies(int loginId)
{
    var dtCompanies = _admin.GetMASCustomersForUser(loginId);
 
    radSelectedCompanies.ClearSelection();
    radSelectedCompanies.Items.Clear();
 
    radSelectedCompanies.DataSource = dtCompanies;
    radSelectedCompanies.DataValueField = "company_id";
    radSelectedCompanies.DataTextField = "company_id";
    radSelectedCompanies.DataBind();
}
 
protected void radCompany_OnTransferred(object sender, RadListBoxTransferredEventArgs e)
{
    Sort();
}
 
private void Sort()
{
    if (radCompany.Items.Any())
    {
      radCompany.SortItems();
    }
    if (radSelectedCompanies.Items.Any())
    {
      radSelectedCompanies.SortItems();
    }
}

Is there something I'm missing?
Mike
Top achievements
Rank 1
 answered on 09 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?