Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
138 views
I have a RadNumericTextBox set to Type="Percent". I want the user to be able to enter numbers 0 - 100 with one decimal place. "100.0" is 5 characters so I set the MaxLength to 5. The code is below:

<telerik:RadNumericTextBox ID="textInput" Type="Percent" MaxLength="5" runat="server" />
<asp:Button ID="buttonUpdate" Text="Calculate" OnClick="ButtonUpdate_Click" runat="server" />

This works as expected in IE8 and Firefox4. But in Chrome 10 it does not work. When I click the button the focus goes to the text box because an error is detected in the input even if the number of characters entered is less than 5. If I increase the MaxLength to 20 it works in Chrome. It seems that Chrome is applying the MaxLength value to the formatted value ("2.00 %"), but IE and Firefox apply the MaxLength to the characters that the user enters. Is there a workaround for this problem?

I am using Telerik 2010 Q2.
Radoslav
Telerik team
 answered on 18 Apr 2011
1 answer
536 views
so far, I've figured out how to get and set values of a RadNumericTextBox within a RadGrid during edit mode using the following Javascript.

                //GET QUANTITY
                var quantityId = $telerik.$("[id$='Quantity']").attr('id'); //get Client ID of RadNumericTextbox with Id 'Quantity'
                var quantityControl = $find(quantityId);                    //get control
                var quantityValue = quantityControl.get_value();             //get value stored in control


                //SET QUANTITY
                quantityControl .set_value(5);                //set value in control


My problem is that in edit mode, this code only works for RadNumericTextBoxes in the very first row. It simply fails for all other rows. I believe it's because the $telerik.$("[id$='Quantity']").attr('id'); isn't able to find the client id for the other rows correctly.

I've look at several examples here and in forums and I'm unable to find a solution.

Also, speed is a primary concern. When the user changes the value for one textbox in the row, I use these gets and sets to perform instantaneous calculations on values contained within other textboxes within that same row.

Thanks for any help you can provide!
Princy
Top achievements
Rank 2
 answered on 18 Apr 2011
1 answer
57 views
Hello,

I have a radtooltip with a description and some priceinfo. Is it possible to put htmltags (<br /> and <p>) in a radtooltip. And if so, how can I accomplish this.

Thanx in advance.

Patrick

Patrick
Top achievements
Rank 1
 answered on 18 Apr 2011
1 answer
245 views
i put rad binary image in asp:hyperlink and disply image from sql server2005 with size 100 X 100 now when i click on image i want to open 500 X 500 size image i give in hyperlink targer="_blank" means display large image on new page 

as soon as posible please help me for this type of senario 

tanking You
Veli
Telerik team
 answered on 18 Apr 2011
7 answers
367 views
I have a combobox in a grid popup edit form that I'm creating programatically and I'm trying to set the SelectedIndexChanged event, but I can't seem to get it to fire.

there are some data points that get read in to determine whether or not to set the SelectedIndexChanged event, but here is the code
if (optionType == "ComboBox")
{
    RadComboBox combo = new RadComboBox();
    combo.ID = "dd_" + option.ToString();
    combo.Font.Size = 8;
 
    if (optionName == "Report Date")
    {
        combo.AutoPostBack = true;
        combo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(dd_RptDate_SelectedIndexChanged);
    }
 
    foreach (var optionValue in q_optionValues)
    {
        combo.Items.Add(new RadComboBoxItem(optionValue.tReportOptionValue.OptNm, optionValue.tReportOptionValue.OptVal));
 
        // if option is Report Date, determine additional controls depending on dropdown value
        if (optionName == "Report Date")
        {
            //if optionvalue is specific date, set the datepickers bool to true
            if (optionValue.tReportOptionValue.OptNm == "Specific Date")
            {
                datepickers = true;
            }
            //if optionvalue is specific months, set the monthpickers bool to true
            if (optionValue.tReportOptionValue.OptNm == "Specific Months")
            {
                //datepickers = true;
            }
        }
    }
 
    panelContent.Controls.Add(combo);
}

I know I'm getting to the point where it should assign the SelectedIndexChanged event because the AutoPostBack attribute right above it is working (I can comment out that line and the combobox doesn't postback).

Here is the associated event code
protected void dd_RptDate_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    string url = "/";
    Response.Redirect(url);
 
    RadComboBox combo = (RadComboBox)sender;
 
    GridEditFormInsertItem editFormItem = (GridEditFormInsertItem)combo.NamingContainer;
    BuildOptions(editFormItem);
}

I put in the Response.Redirect just to see if the event was firing and it's not.

Am I not going about this correct way? I need to be able to fire off this event so the BuildOptions event gets run when the postback occurs.

Thanks
Helen
Telerik team
 answered on 18 Apr 2011
3 answers
96 views
Hi,

I am using RadScheduler timeline view.
Please find an attached telerik demo screenshot. Is it possible to show a resource title in timeline view?

Thanks,
 
Peter
Telerik team
 answered on 18 Apr 2011
2 answers
65 views
Hello, I am attempting to implement a series of Master / Child RadGrids, similar to the example located:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx


In fact, I copied most of this code and modified it to work with my database structure.

The problem I have is as follows:

When clicking on a row in Grid #1 to select it, the child Grids #2 and #3 update correctly to reflect the appropriate data associated with Grids #1 and #2, respectively

However, when I use the Next/Previous buttons located in Grid #1 to move between records, only the data in Grid #2 updates. The data in Grid#3 never updates.

The online example posted above exhibits the same behavior. At first I thought that I did something wrong in my program, and have been wracking my brains for a day trying to figure out what I did wrong. Only after I went back to the online example did I see the online example exhibits the same behavior. You can see for yourself... if you go to the example, and click on one of the rows in Grid #1, the data in Grids #2/3 will update... but if you click on the nav buttons in Grid #1, only Grid #2 updates, Grid#3 remains unchanged.

Two questions:

a. Is this a bug in the control, and

b. How can I get Child Grid #3 to update correctly from Grid #2's key value when the user clicks a navigation button on Master Grid #1?
Daniel
Telerik team
 answered on 18 Apr 2011
1 answer
90 views
Hi,

I used grid but I have a method as a class. I bind  datasourse of grid like,
                  
             DataSet dsCategories = null;
                   dsCategories = ct.GetAllCategories();
                    RadGrid2.DataSource = dsCategories;
Problem is paging in the grid. Becouse you suggested to us flowwing using.
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"
            runat="server"></asp:SqlDataSource>

Instead of it, I want to use datasourse for paging or filtering etc.. How I bind it? Thanks.
Pavlina
Telerik team
 answered on 18 Apr 2011
1 answer
116 views
When I edit the grid shows me the following error.

I'm trying to create as many columns as there are data in thedatabase. And the only way I can create the template editing is by using the "autogenerated"

But whenever I have the same problem. I've tried so many ways to fix it but I can not think of anything.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index


Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index]
   System.Web.UI.ControlCollection.get_Item(Int32 index) +8690450
   Telerik.Web.UI.GridTextBoxColumnEditor.LoadControlsFromContainer() +70
   Telerik.Web.UI.GridColumnEditorBase.InitializeFromControl(Control containerControl) +50
   Telerik.Web.UI.GridEditFormItem.InitializeEditorInCell(IGridEditableColumn column) +1083
   Telerik.Web.UI.GridEditManager.GetColumnEditor(IGridEditableColumn column) +175
   Telerik.Web.UI.GridBoundColumn.FillValues(IDictionary newValues, GridEditableItem editableItem) +82
   Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues) +164
   Telerik.Web.UI.GridEditFormItem.ExtractValues(IDictionary newValues) +169
   Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem) +115
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +1037
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +193
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1607
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +802
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +161
   System.Web.UI.Control.EnsureChildControls() +102
   Telerik.Web.UI.GridTableViewBase.get_Controls() +33
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +24
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +148
   System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +225
   System.Web.UI.Page.LoadAllState() +312
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +747



All columns are inserted from C# code. The reason is that thenumber of columns depends on the number of fields in thedatabase.


protected void uxrdgrid_Deficiencias_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
            DaoDeficiencias servicioDeficiencias = new DaoDeficiencias();
            DaoMetodoRehabilitacion servicioMetodoRehabilitacion = new DaoMetodoRehabilitacion();
            DaoDeficienciaMetodoRehabilitacion servicioDefienciaMetodoRehabilitacion = new         DaoDeficienciaMetodoRehabilitacion();
            DaoTipoValidezMetodoRehabilitacion servicioTipoValidezMetodoRehabilitacion = new DaoTipoValidezMetodoRehabilitacion();
             
            IList listaDeficiencias = servicioDeficiencias.ObtenerTodos();
            IList listaMetodosRehabilitacion = servicioMetodoRehabilitacion.ObtenerTodos();
            IList listaDeficienciaMetodoRehabilitacion = servicioDefienciaMetodoRehabilitacion.ObtenerTodos();
            IList listaTipoValidezMetodoRehabilitacion = servicioTipoValidezMetodoRehabilitacion.ObtenerTodos();
 
            GridTableView tableview = new GridTableView(uxrdgrid_Deficiencias);
            GridColumnCollection coleccionColumnas = new GridColumnCollection(tableview);
            List<ListDictionary> listaDataSource = new List<ListDictionary>();
            GridDropDownColumn column;
             
            DataTable tablaDatos = new DataTable();
            DataColumn columnaDatos;
            DataRow filaDatos;
 
            uxrdgrid_Deficiencias.Columns.Clear();
 
            GridBoundColumn columnBound = new GridBoundColumn();
            columnBound.DataField = "Codigo_deficiencia";
            columnBound.UniqueName = "Codigo_deficiencia";
            columnBound.HeaderText = "Código Deficiencia";
            columnBound.ReadOnly = true;
           
            columnBound.ShowFilterIcon = false;
            columnBound.AllowSorting = true;
            uxrdgrid_Deficiencias.Columns.Add(columnBound);
 
            GridTextBoxColumnEditor GridTextBoxColumnEditor1 = new GridTextBoxColumnEditor();
            GridTextBoxColumnEditor1.ID = "GridTextBoxColumnEditor1";
 
            GridDropDownListColumnEditor GridDropDownListColumnEditor1 = new GridDropDownListColumnEditor();
            GridDropDownListColumnEditor1.ID = "GridDropDownListColumnEditor1";
 
            columnaDatos = new DataColumn();
            columnaDatos.DataType = Type.GetType("System.String");
            columnaDatos.ColumnName = "Codigo_deficiencia";
 
            tablaDatos.Columns.Add(columnaDatos);
 
            foreach (T_METODO_REHABILITACION metodoRehabilitacion in listaMetodosRehabilitacion)
            {
                column = new GridDropDownColumn();
                column.AllowFiltering = false;
                column.DataSourceID = tiposValidezMetodoDataSource.ID;
                column.HeaderText = metodoRehabilitacion.Nombre;
               
                column.DataField = ("Validez." + metodoRehabilitacion.Nombre).Trim();
                column.UniqueName = ("Validez." + metodoRehabilitacion.Nombre).Trim();
                column.ListValueField = "Id";
                column.ListTextField = "Nombre";
 
                uxrdgrid_Deficiencias.Columns.Add(column);
                 
                columnaDatos = new DataColumn();
                columnaDatos.DataType = Type.GetType("System.Int32");
                columnaDatos.ColumnName = ("Validez." + metodoRehabilitacion.Nombre).Trim();
 
                tablaDatos.Columns.Add(columnaDatos);
            }
 
 
            foreach (T_DEFICIENCIA deficienciaItem in listaDeficiencias)
            {
                filaDatos = tablaDatos.NewRow();
                filaDatos["Codigo_deficiencia"] = deficienciaItem.Codigo;
 
                foreach (T_METODO_REHABILITACION metodRehaItem in listaMetodosRehabilitacion)
                {
                    foreach (T_DEFICIENCIA_METODO_REHABILITACION defMetRehItem in listaDeficienciaMetodoRehabilitacion)
                    {
                        if (defMetRehItem.Deficiencia.Id == deficienciaItem.Id && defMetRehItem.MetodoRehabilitacion.Id == metodRehaItem.Id)
                        {
                            filaDatos[("Validez." + defMetRehItem.MetodoRehabilitacion.Nombre).Trim()] = defMetRehItem.Validez.Id;
                        }
                    }
                }
 
                tablaDatos.Rows.Add(filaDatos);
            }
 
            uxrdgrid_Deficiencias.DataSource = tablaDatos;
             
}

And ASPX

       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function EditRow(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
 
    <asp:Label ID="Label4" runat="server" CssClass="PageTitle">Métodos de rehabilitación segun deficiencias</asp:Label>
 
    <telerik:RadGrid ID="uxrdgrid_Deficiencias" runat="server" AllowFilteringByColumn="False"
                    AllowSorting="True" AllowPaging="True" PageSize="15" GridLines="None"
                    width="100%" Skin="Vista"
                    AllowAutomaticDeletes="False" AllowAutomaticInserts="False"
                    AllowAutomaticUpdates="False" onneeddatasource="uxrdgrid_Deficiencias_NeedDataSource"
                    ondeletecommand="uxrdgrid_Deficiencias_DeleteCommand"
                    oninsertcommand="uxrdgrid_Deficiencias_InsertCommand"
                    onupdatecommand="uxrdgrid_Deficiencias_UpdateCommand" onitemcommand="uxrdgrid_Deficiencias_ItemCommand">
        <ClientSettings EnableRowHoverStyle="false" AllowKeyboardNavigation="true">
            <Selecting AllowRowSelect="True" />
            <ClientEvents OnRowDblClick="EditRow" />
            <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" />
        </ClientSettings>
         
        <GroupingSettings  CaseSensitive="false"/>
         
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="Codigo_deficiencia" ClientDataKeyNames="Codigo_deficiencia" EditMode="PopUp" CommandItemDisplay="Bottom">
            <CommandItemSettings AddNewRecordText="Añadir nuevo registro" RefreshText="Refrescar" />
 
            <EditFormSettings InsertCaption="Crear nuevo Detalle de Inspección" CaptionFormatString="Editar Detalle de Inspección: {0}"
            CaptionDataField="Codigo_Deficiencia" EditColumn-CancelText="Cancelar" EditColumn-Display="True" EditFormType="AutoGenerated">
             
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
 
                <FormMainTableStyle GridLines="None" CellSpacing="5" CellPadding="3" Width="100%" />
             
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="60px" />
 
                <EditColumn ButtonType="ImageButton"
                    InsertText="Guardar" UpdateText="Guardar cambios"
                    UniqueName="EditCommandColumn1" CancelText="Cancelar edición" >
                </EditColumn>
             
                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
 
                <PopUpSettings Modal="True" Width=""></PopUpSettings>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
     
<asp:ObjectDataSource ID="tiposValidezMetodoDataSource" runat="server"
    OldValuesParameterFormatString="original_{0}" SelectMethod="ObtenerTodos"
    TypeName="Aquatec.MetresaWeb.Web.DaoServices.DaoTipoValidezMetodoRehabilitacion">
</asp:ObjectDataSource>

Thanks!

Radoslav
Telerik team
 answered on 18 Apr 2011
1 answer
64 views
Hello,

I am using a same grid for the different datasources. I want there non of the row will be double lined. I used  ItemStyle-Wrap="false" but was not useful.
Pavlina
Telerik team
 answered on 18 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?