Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
124 views
I am using Telerik grid with edit form template. When ItemDataBound event fires for this gird i have written various logic which must be satisfied/set for this event. So is there any server side code which can be moved to client side or minimized by using any inbuilt feature provided by teelrik?
Mainly i am calling four methods inside this even which descriptions are:
1>SetTpcHeaderCheckBoxValues- This methos is used to set the attributes of a checkbox on grids header coloumn.
2>SetTpcControlsDefaultValueInReadMode: this method is used to set the controls in readonly mode.
3>SetTpcToolTipAndWrapping: used to set the wrap and tool tip properties.
4>SetTpcControlsDefaultValueInEditMode: used to set the controls for the grid column which is in edit mode.

I have written all details regarding to this methodas below:

Protected Sub RgThridPartyCommissionsItemDataBound(sender As Object, _
                                                        e As GridItemEventArgs)

        SetTpcHeaderCheckBoxValues(e)

        Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
        If (item IsNot Nothing) Then
            SetTpcControlsDefaultValueInReadMode(item)
            SetTpcToolTipAndWrapping(e, item)

        End If

        If e.Item.IsInEditMode Then
            SetTpcControlsDefaultValueInEditMode(e)
        End If

    End Sub

Private Sub SetTpcHeaderCheckBoxValues(ByVal e As GridItemEventArgs)

        Dim headerItem As GridHeaderItem = TryCast(e.Item, GridHeaderItem)
        If headerItem IsNot Nothing Then
            Dim headerCheckBox As CheckBox = DirectCast(headerItem("ClientSelectColumn").Controls(0), CheckBox)

            headerCheckBox.Attributes.Add("onclick", String.Format _
                              ("headerChecked(this,'{0}','{1}','{2}','lnkRemoveAllTpc','hdnTPCRowCount','hdnTPCRowChecked')", _
                               CacheDataSet.ThirdPartyCommissions, _
                              Master.InvoiceID.ToString(), _
                              rgThirdPartyCommissions.ClientID))

            If (Not CanDeleteRetailAgentCommissions) Then
                headerCheckBox.Enabled = False
            ElseIf hdnIsHeaderChecked.Value.Equals("false") Then
                hdnHeaderChbxId.Value = headerCheckBox.ClientID
            End If
        End If
    End Sub

Private Sub SetTpcControlsDefaultValueInReadMode(ByVal item As GridDataItem)

        Dim rowID = DirectCast(item.FindControl("lblRowID"), Label).Text
        Dim tpcRow = (From tpc In ThirdPartyCommissionRows
                Where (tpc.RowID = rowID AndAlso tpc.IsSelected = "True")
                Select tpc).FirstOrDefault()
        'Edit template Start
        Dim checkBox As CheckBox = DirectCast(item("ClientSelectColumn").Controls(0), CheckBox)
        checkBox.Enabled = CanDeleteRetailAgentCommissions
        checkBox.Attributes.Add("onclick", "chkClick(this,'lnkRemoveAllTpc','hdnTPCRowCount','hdnTPCRowChecked')")


        'used to maintain the state of the checkbox.
        If tpcRow IsNot Nothing Then
            item.Selected = tpcRow.IsSelected
        End If

        Dim imgBtnEdit As ImageButton = DirectCast(item.FindControl("imgbtnTpcEdit"), ImageButton)
        Dim imgBtnCopy As ImageButton = DirectCast(item.FindControl("imgbtnTpcCopy"), ImageButton)
        Dim imgBtnDelete As ImageButton = DirectCast(item.FindControl("imgbtnTpcDelete"), ImageButton)

        imgBtnEdit.OnClientClick = _
            String.Format("return onThirdPartyCommissionEditClick({0})", item.ItemIndex)
        imgBtnCopy.OnClientClick = _
            String.Format("return CanEditGrid('{0}','TPC','')", item.ItemIndex)
        imgBtnDelete.OnClientClick = _
            String.Format("return CanEditGrid('{0}','TPC','Remove')", item.ItemIndex)

        Dim lbTypeTpc As Label
        lbTypeTpc = DirectCast(item.FindControl("lbType"), Label)
        Dim lbFeeCode As Label = DirectCast(item.FindControl("lbFeeCode"), Label)

        'Fix start for defect 7877
        Dim fee As String
        If lbFeeCode IsNot Nothing Then
            fee = lbFeeCode.Text
            If (fee.Contains("Default1")) Then
                lbFeeCode.Text = fee
            End If

            If (fee.Contains("Default")) Then
                fee = fee.Replace("Default", "")
                lbFeeCode.Text = fee
            End If

            If (fee = "1") Then
                fee = fee.Replace("1", "")
                lbFeeCode.Text = fee
            End If
        End If
        'Fix end for defect 7877

        Dim radToolTipTpcDescription As RadToolTip = _
                DirectCast(item.FindControl("radToolTipTPCDescription"), RadToolTip)
        Dim radToolTipTpcCommissionOnType As RadToolTip = _
                DirectCast(item.FindControl("radToolTipTPCCommissionOnType"), RadToolTip)
        Dim type As String
        If lbTypeTpc IsNot Nothing Then
            type = lbTypeTpc.Text
            If type.Contains("/") Then
                lbTypeTpc.Text = type.Split("/")(0)
                lbFeeCode.Text = type.Split("/")(1)
                radToolTipTpcDescription.Text = type.Split("/")(1)
                radToolTipTpcCommissionOnType.Text = type.Split("/")(0)
            End If
        End If

        CheckRightsForGridControl _
            (CanAddRetailAgentCommission, CanEditRetailAgentCommission, _
             CanViewRetailAgentCommissions, CanDeleteRetailAgentCommissions, _
             imgBtnEdit, imgBtnCopy, imgBtnDelete)

        DisableLinksForHistory(imgBtnEdit, imgBtnCopy, imgBtnDelete)
    End Sub

Private Sub SetTpcToolTipAndWrapping(ByVal e As GridItemEventArgs, ByVal item As GridDataItem)

        '0th index column is hide so this attributes not required
        'Tpc grid columns count to apply wrap unwrap - 7
        For col As Integer = 1 To 7
            item(rgThirdPartyCommissions.Columns(col).UniqueName).Wrap = checkWrapPremium.Checked
        Next

        If (checkWrapPremium.Checked AndAlso e.Item.IsInEditMode = False) Then
            Dim radToolTip As RadToolTip

            radToolTip = DirectCast(item.FindControl("radToolTipTPCDescription"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCLOB"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCName"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCGroupType"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCBilling"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCCommissionOnType"), RadToolTip)
            radToolTip.Visible = False

            radToolTip = DirectCast(item.FindControl("radToolTipTPCRateType"), RadToolTip)
            radToolTip.Visible = False
        End If
    End Sub

Private Sub SetTpcControlsDefaultValueInEditMode(ByVal e As GridItemEventArgs)

        Dim itemEditForm As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
        Dim ddlTpcFeeCode As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCFeeCode"), RadComboBox)
        Dim ddlTpcInvoiceItemLevel As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCInvoiceItemLevel"), RadComboBox)
        Dim ddlTpcName As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCName"), RadComboBox)
        Dim ddlTpcRole As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCRole"), RadComboBox)
        Dim ddlTpcType As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCType"), RadComboBox)
        Dim ddlTpcRateType As RadComboBox = _
                DirectCast(itemEditForm.FindControl("rdcmbTPCRateType"), RadComboBox)
        Dim tbTpcRate As RadNumericTextBox = _
                DirectCast(itemEditForm.FindControl("rdtbTPCRate"), RadNumericTextBox)
        Dim tbTpcCommissionAmtCal As RadNumericTextBox = _
                DirectCast(itemEditForm.FindControl("rdtbTPCCommissionAmount"), RadNumericTextBox)
        Dim tbTpcBilling As RadTextBox = _
                DirectCast(itemEditForm.FindControl("rtbTCPBilling"), RadTextBox)

        Dim itemEdit As GridEditableItem = DirectCast(e.Item, GridEditableItem)
        Dim btnCancelOrDelete As Button = DirectCast(itemEdit.FindControl("btnCancel"), Button)

        If ViewState("IsNewRowAdded") = True Then
            btnCancelOrDelete.CommandName = "Delete"
            btnCancelOrDelete.Attributes.Add("OnClick", "DeleteRecord('TPC');")
        Else
            btnCancelOrDelete.CommandName = "Cancel"
            btnCancelOrDelete.Attributes.Add("OnClick", "resetEditIndex('TPC');")
        End If

        Dim tpcEditRowFilter = ThirdPartyCommissionRows.ElementAt(itemEditForm.DataSetIndex)

        EnableDisablePaging("TPCClassToHidePageSelector", "TPCClassToHidePageResizer", "true")

        'Assign the default values to the respective controls
        If Not (TypeOf e.Item Is IGridInsertItem) Then

            If TypeOf e.Item Is GridEditFormItem Then

                BindTpcNameCombo(ddlTpcName)

                ddlTpcName.SelectedValue = tpcEditRowFilter.MemberID

                BindTpcRoleCombo(ddlTpcRole)
                SetTpcRoleComboAsPerPartyType(ddlTpcName, ddlTpcRole)

                SetTpcBilling(tbTpcBilling, ddlTpcName)

                BindTpcTypeCombo(ddlTpcType)
                ddlTpcType.SelectedValue = tpcEditRowFilter.CommissionOnTypeID

                BindTpcInvoiceItemLevel(ddlTpcInvoiceItemLevel, _
                                        tpcEditRowFilter.CommissionOnTypeID)
                ddlTpcInvoiceItemLevel.SelectedValue = tpcEditRowFilter.InvoiceItemID

                BindTpcFeeCode(itemEditForm)

                If (Not tpcEditRowFilter.IsInvoiceItemNonPremiumFeeIDNull()) Then
                    ddlTpcFeeCode.SelectedValue = tpcEditRowFilter.InvoiceItemNonPremiumFeeID
                Else
                    ddlTpcFeeCode.SelectedValue = 0
                End If

                If (ddlTpcFeeCode.SelectedValue <> 0) Then
                    ddlTpcFeeCode.Enabled = True
                Else
                    ddlTpcFeeCode.Enabled = False
                End If

                tbTpcBilling.Text = tpcEditRowFilter.glAgencyBillRetAgentReceivableMethodText

                BindTpcRateType(ddlTpcType, ddlTpcInvoiceItemLevel, _
                                ddlTpcFeeCode, ddlTpcRateType)
                ddlTpcRateType.SelectedValue = tpcEditRowFilter.RateTypeID
                ddlTpcRateType.Focus()

                tbTpcRate.Text = PolicyInfoCommon.FormatRate(tpcEditRowFilter.Rate, _
                                                             tpcEditRowFilter.RateTypeID)

                'Set value for hdnPremiumFeeAmtForTpc
                ddlTpcRateType.Text = ddlTpcRateType.SelectedItem.Text
                CalculateTpcCommissionAmount(ddlTpcRateType)

                tbTpcCommissionAmtCal.Text = tpcEditRowFilter.AmountDueUI

                tbTpcRate.Attributes.Add _
                    ("onBlur", "return validateThirdPartyRate('" + tbTpcRate.ClientID + "','" _
                               + tbTpcCommissionAmtCal.ClientID + "' ,'" + ddlTpcRateType.ClientID + "')")

                'If record is new then enabled required dropdowns
                If (IsNewTpcRecord = True) Then
                    ddlTpcName.Focus()

                    ddlTpcType.Enabled = True
                    ddlTpcName.Enabled = True
                    ddlTpcInvoiceItemLevel.Enabled = True

                    ddlTpcInvoiceItemLevel.Items.Clear()
                    ddlTpcInvoiceItemLevel.Items.Insert _
                        (0, New RadComboBoxItem(PolicyInfoConstants.pleaseSelect, _
                                                ColumnnIndexes.Zero))
                    ddlTpcInvoiceItemLevel.SelectedValue = 0

                    ddlTpcRateType.Items.Clear()
                    ddlTpcRateType.Items.Insert(0, New RadComboBoxItem _
                                                   (PolicyInfoConstants.pleaseSelect, _
                                                    ColumnnIndexes.Zero))
                    ddlTpcRateType.SelectedValue = 0

                    ddlTpcFeeCode.Items.Insert(0, New RadComboBoxItem _
                                                  (PolicyInfoConstants.pleaseSelect, _
                                                   ColumnnIndexes.Zero))
                    ddlTpcFeeCode.SelectedValue = 0

                    ddlTpcType.SelectedValue = 0
                    ddlTpcRole.SelectedValue = 0
                    tbTpcBilling.Text = String.Empty

                    IsNewTpcRecord = False
                End If

                If (tbTpcCommissionAmtCal.Text.Equals("")) Then
                    tbTpcCommissionAmtCal.Text = 0
                End If

                If (IsClickOnCopy) Then
                    ddlTpcInvoiceItemLevel.Enabled = True
                    ddlTpcName.Enabled = True
                    ddlTpcType.Enabled = True
                    IsClickOnCopy = False
                End If

                If ddlTpcRateType.Text = PolicyInfoConstants.flat Then
                    tbTpcRate.NumberFormat.DecimalDigits = 2
                    tbTpcCommissionAmtCal.Text = FormatNumber _
                        (tbTpcCommissionAmtCal.Text, 2)
                Else
                    tbTpcRate.NumberFormat.DecimalDigits = 4
                End If

            End If

        End If

        'Fix start for defect 8512
        Dim controlClientId As String = Nothing

        'If new record then set focus on 'Name'
        If (ddlTpcName.Enabled) Then '
            controlClientId = ddlTpcName.ClientID + "_Input"
        ElseIf (ddlTpcRateType.Enabled) Then
            'If in Edit mode then set focus on 'Rate Type'
            controlClientId = ddlTpcRateType.ClientID + "_Input"
        End If

        hdnRemoveTabValue.Value = controlClientId

        ScriptManager.RegisterClientScriptBlock _
            (Me, GetType(Page), "ToggleScript", "SetFocusAfterPostBack('" & controlClientId & "');", True)
    End Sub
Himanshu
Top achievements
Rank 1
 answered on 04 Apr 2014
2 answers
187 views
Scenario:I have a RadCombobox and I have attached functions to most of the events. One event of the combobox is OnClientBlur and I am using this to check whether value in Combo is "Unassigned" or not. If it is "Unassigned" I need to cancel the onblur event and keep the focus on to the same combo.
Please refer screen shot 1.

This is the javascript which I has been used to cancel the event.
if (sender.get_text() === "Unassigned") {
eventArgs.get_domEvent().preventDefault();
return false;
}


Problem:When the user tabs out first time of the ComboBox the event gets cancelled and the focus stays on the same combo box (in this case it is the 3rd Combo).But when the user hits the tab button again the focus moves to the next control.When I debugged the code I found that when the user first hits the tab button, following line works
eventArgs.get_domEvent().preventDefault();

I can see the preventDefault function, see following snapshot. 
Please refer screen shot 2.

but when the user hits the tab button again I get an error and cannot see preventDefault function, see following snapshot
Please refer screen shot 3.

I am not able to understand what is going wrong here. Anyhelp would be appreciated.






Himanshu
Top achievements
Rank 1
 answered on 04 Apr 2014
2 answers
171 views

Hi everyone

Im trying to load data in RadGrid, everything is right except no paging, 

I click on page number to change the page but no paging occurs or no data is rendered

I use GetDataAndCount event to load the data, the output type of the method is ResultData (this class contains a generic list and counter) 

I think Im missing something, can you help me.

I provide some code:


<telerik:RadGrid ID="GvProfiles" runat="server" AllowPaging="true" AllowCustomPaging="false"
                AllowSorting="true" AllowFilteringByColumn="true" FilterType="CheckList" ShowFooter="true">
                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProfileID" ClientDataKeyNames="ProfileID" CheckListWebServicePath="ProfilesService.svc">
                    <PagerStyle Mode="NumericPages"></PagerStyle>
                    <Columns>
                        <telerik:GridBoundColumn FilterDelay="200" FilterCheckListWebServiceMethod="GetProfileNames"
                            DataField="ProfileName" HeaderText="Profile Name" UniqueName="ProfileID" DataType="System.String">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="true"></PagerStyle>
                </MasterTableView>
                <ClientSettings>
                    <ClientEvents OnDataBound="OnDataBound" OnGridCreated="OnGridCreated" />
                    <DataBinding SelectMethod="GetDataAndCount"     Location="ProfilesService.svc"
                    SortParameterType="String" FilterParameterType="String">
                    </DataBinding>
                </ClientSettings>
                <FilterMenu CssClass="RadFilterMenu_CheckList">
                </FilterMenu>
            </telerik:RadGrid>




[DataContract]
public class Profiles
{
    [DataMember]
    public Int64 ProfileID { get; set; }

    [DataMember]
    public String ProfileName { get; set; }
}

public class ResultData
{
    public int Count { get; set; }
    public List<Profiles> Data { get; set; }
}

[ServiceKnownType(typeof(Profiles))]
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class ProfilesService
{
    [OperationContract]
    public RadListBoxItemData[] GetProfileNames(Dictionary<string, object> context)
    {
        BusinessLayer.ProfilesBL objProfilesBL = new BusinessLayer.ProfilesBL();
        List<DataLayer.Profiles> listProfiles = new List<DataLayer.Profiles>();
        List<Profiles> listWcfProfiles = new List<Profiles>();

        try
        {
            listProfiles = objProfilesBL.Select(new DataLayer.Profiles());

            listProfiles.ForEach(delegate(DataLayer.Profiles item)
            {
                listWcfProfiles.Add(new Profiles { ProfileID = item.ProfileID, ProfileName = item.ProfileName });
            });

            return listWcfProfiles.Select(o => new RadListBoxItemData { Text = o.ProfileName, Value = o.ProfileID.ToString() }).ToArray<RadListBoxItemData>();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            objProfilesBL = null;
            listProfiles = null;
            listWcfProfiles = null;
        }
    }

    [OperationContract]
    public ResultData GetDataAndCount(int startRowIndex, int maximumRows, string sortExpression, string filterExpression)
    {
        BusinessLayer.ProfilesBL objProfilesBL = new BusinessLayer.ProfilesBL();
        List<DataLayer.Profiles> listProfiles = new List<DataLayer.Profiles>();

        IQueryable iQueryable;
        GridLinqBindingData gridLinqBindingData;
        ResultData resultData = new ResultData();
        List<Profiles> listProfilesService = new List<Profiles>();

        try
        {
            listProfiles = objProfilesBL.Select(new DataLayer.Profiles());

            iQueryable = listProfiles.AsQueryable();

            gridLinqBindingData = RadGrid.GetBindingData(iQueryable, startRowIndex, maximumRows, string.Empty, string.Empty);

            if (string.IsNullOrEmpty(sortExpression))
                sortExpression = "ProfileName ASC";

            if (!string.IsNullOrEmpty(filterExpression))
            {
                filterExpression = filterExpression.Replace("[", string.Empty);
                filterExpression = filterExpression.Replace("]", string.Empty);
                filterExpression = filterExpression.Replace("'", "\"");
            }
            else
                filterExpression = "ProfileID > 0";

            resultData.Data = gridLinqBindingData.Data.OfType<DataLayer.Profiles>().Select(o => new Profiles()
            {
                ProfileID = o.ProfileID,
                ProfileName = o.ProfileName
            }).Where(filterExpression).OrderBy(sortExpression).ToList();

            resultData.Count = listProfiles.Count;

            return resultData;
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            objProfilesBL = null;
            listProfiles = null;
            iQueryable = null;
            gridLinqBindingData = null;
            resultData = null;
        }
    }

Antonio Stoilkov
Telerik team
 answered on 04 Apr 2014
1 answer
141 views
In BasePage class I overrided OnPreRender method:
    public class BaseMainPage : BaseDataPage
    {
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (!string.IsNullOrWhiteSpace(ExceptionHelper.MessageUI)) 
            {
                string script2run = @" $(window).load(function () { alert('" + ExceptionHelper.MessageUI + "'); }); ";

                // handle exception
                ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), script2run, true);

                // reset the message
                ExceptionHelper.MessageUI = null;
            }
        }
    }

This code displays alert message to user. The problem is when I have more than one partial postbacks the code doesn't work because once the method run then ExceptionHelper.MessageUI is null.

How can I solve the problem?


Eyup
Telerik team
 answered on 04 Apr 2014
3 answers
353 views
I have a grid and within your GridTemplateColumn have a RadNumericTextBox that can be edited. The problem that when I edit a field and press TAB (to go below the line), the value was 1459,14 145914,00 is if I go back into the field above to change the value of the first line, the second line changes again and is 14591400,00 . 
I have attached an example with fictitious data in a list.

Put the DLLs in the file in the bin folder, I removed because the file was too large, making it impossible to upload.

Version: UI for ASP.NET AJAX Q3 2013

* Change the extension from. Jpg to. Rar
Kostadin
Telerik team
 answered on 04 Apr 2014
5 answers
1.8K+ views
How to disable days in RadDatePicker?
If I google to find, everyone is referring to article which doesn't work in vs2013.
http://www.telerik.com/support/code-library/disabling-calendar-days

I also tried to do with following functions but it only disables like 10 total weekends.  It doesn't disable any previous months weekends. Any suggestions!
    Protected Sub Calendar_OnDayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs)
        If (e.Day.Date.DayOfWeek = DayOfWeek.Saturday Or e.Day.Date.DayOfWeek = DayOfWeek.Sunday) Then     
            ' disable the selection for the specific day
            Dim calendarDay As RadCalendarDay = New RadCalendarDay
            calendarDay.Date = e.Day.Date
            calendarDay.IsSelectable = False
            calendarDay.IsDisabled = True
            'calendarDay.ItemStyle.CssClass = otherMonthCssClass
            calendarDay.ItemStyle.BackColor = Color.CadetBlue
            RadDatePicker1.Calendar.SpecialDays.Add(calendarDay)
        End If    End Sub
Viktor Tachev
Telerik team
 answered on 04 Apr 2014
1 answer
84 views
We are mainly using RADGrid Telerik control in our site. But we are facing many difficulties in it when Compatibility View of IE9 changes such as column of the grid get shrink, footer row stop working, dropdown autopostback doesn’t respond, textbox size changes on mouse over, page sizing error, page changed error and many more. Will you please help me to resolve this problem? Is there any compatibility issues with RADGrid or we are going somewhat in different direction.
Galin
Telerik team
 answered on 04 Apr 2014
14 answers
741 views
I have a custom user control that I use within a Master Page.  The user control has a mix of Telerik and asp.net controls.  I am using an Ajax manager on the Master Page with a Proxy on the user control.  Everything updates fine but 2 of my Label controls loose there formatting when they are "Ajaxified".  Removing the Ajax manager from the Master page immediately restores the formatting, but of course the Proxy won't work without the manager.  Placing the manager directly in the user control has the same effect.

Basically I am using the label controls as tokens and I need them to remain inline. e.g.  Hello<asp:Label> NOT
Hello
<asp:Label>

Here is some sample code.  I shortened it for brevity as my user control has lots of fields and panels (a survey type user control).
FYI.  This is all being done in a Sitefinity site.

MasterPage
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="SingleCenterColumn.master.cs" 
    Inherits="App_Master_SingleCenterColumn" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <div id="wrapper"
        <form id="form2" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="AjaxManager1" runat="server"
        </telerik:RadAjaxManager> 
        <div id="centerwrapper"
            <div id="header" class="borders"> ...
UserControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NeedsSurvey.ascx.cs" Inherits="NeedsSurvey_NeedsSurvey" 
    ClassName="NeedSurvey" %> 
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="Button1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="percentage" /> 
                <telerik:AjaxUpdatedControl ControlID="number" /> 
                <telerik:AjaxUpdatedControl ControlID="panel1" /> 
                <telerik:AjaxUpdatedControl ControlID="panel2" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
</telerik:RadAjaxLoadingPanel> 
<h1> 
    Needs Assessment Survey</h1> 
<div id="slider"
    <asp:Label ID="percentage" runat="server" Text="0"></asp:Label>% Complete. Question 
    <asp:Label ID="number" runat="server" Text="0"></asp:Label>&nbsp;of 12 Completed. 
    <telerik:RadSlider ID="RadSlider1" runat="server"
    </telerik:RadSlider> 
</div> 
<asp:Panel runat="server" ID="panel1"
    1. Which of the following best describes the personal needs you feel are the most 
    immediate? 
    <br /> 
    <br /> 
    <asp:RadioButtonList ID="RadioButtonList1" runat="server"
        <asp:ListItem>Help with everday expenses</asp:ListItem> 
        <asp:ListItem>Paying off debt</asp:ListItem> 
        <asp:ListItem>Taking a vacation</asp:ListItem> 
        <asp:ListItem>Home improvements</asp:ListItem> 
        <asp:ListItem>Better medical coverage</asp:ListItem> 
    </asp:RadioButtonList> 
    <br /> 
    <asp:Button ID="Button1" runat="server" OnClick="btn_Click1" /> 
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadioButtonList2" 
        ErrorMessage="Please select an answer"></asp:RequiredFieldValidator> 
</asp:Panel>... 
On each button click the code behind updates the visibility of the current and next panel, updates the label control, and changes the status of a slider (like a progress bar).
CodeBehind ascx.cs
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Net.Mail; 
using System.Net.Mime; 
using System.Reflection; 
using System.Collections.Specialized; 
 
 
public partial class NeedsSurvey_NeedsSurvey : System.Web.UI.UserControl 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        
    } 
 
    #region EventHandlers 
 
   protected void btn_Click1(object sender, EventArgs e) 
    { 
        panel1.Visible = false
        panel2.Visible = true
        RadSlider1.Value = 1; 
        percentage.Text = "8"
        number.Text = "1"
    } 
    protected void btn_Click2(object sender, EventArgs e) 
    { 
        panel2.Visible = false
        panel3.Visible = true
        RadSlider1.Value = 2
        percentage.Text = "16"
        number.Text = "2"
    }... 
CSS
#centercolumn 
    width: 900px; 
    margin-top: 25px; 
    margin-left: auto; 
    margin-right: auto; 
    padding: 10px 25px 25px 25px; 
    background-color: #fff; 
    color: #000; 
#slider 
    width: 300px; 
    margin: 0 auto; 
It would be great if after all of this someone pointed out a CSS problem, but I don't think thats it.  Remove AJax and everything formats properly.  What is interesting is that when Ajax is used the controls in question stack exactly as they are displayed in the Ajax Tree.

???
Thanks.
Joe
Venelin
Telerik team
 answered on 04 Apr 2014
3 answers
128 views
Currently, I'm using the grouping headers (grid header item) as a rollup for values (double) when the data is grouped, by summing the data and manually adding it to the group header item cell.

What I'm seeing is that when the user clicks to sort the column, it is sorting the item values within the groups, but is not sorting the actual groups.

For example:

Name        Team    Year1 Year2 Year3
John                        30        50        40
                    Red     20        30        10
                    Blue    10        20        30
Jane                        100      50        70
                    Red     60        10        30
                    Blue    40        40        40

If I were to sort by Year1 Desc, I would expect Jane to be first and John to be second.

Does anyone know how to sort the groups as well as the items?

Thanks in advance.
Konstantin Dikov
Telerik team
 answered on 04 Apr 2014
4 answers
106 views
I have a grid and within your GridTemplateColumn have a RadNumericTextBox that can be edited. The problem that when I edit a field and press TAB (to go below the line), the value was 1459,14 145914,00 is if I go back into the field above to change the value of the first line, the second line changes again and is 14591400,00 . 
I have attached an example with fictitious data in a list.

Put the DLLs in the file in the bin folder, I removed because the file was too large, making it impossible to upload.

Version: UI for ASP.NET AJAX Q3 2013

Change the extension from. Jpg to. Rar
Kostadin
Telerik team
 answered on 04 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?