Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
125 views
Hello Forum,
we are using the RadAsyncUpload for an ImageUpload.
I am currently working on the user friendliness of our application.
When i change the name of for example a Message-File from "MyMessage.msg" to "MyMessage.png" it will pass through the validation but the Visual Studio shows a exception. For the user however its just like everything went well.
Except it leads to problems later because the uploaded file is not really an Image...

Is there any way to catch this error, so i can show an alert to the user?
Torben
Top achievements
Rank 1
 answered on 19 Mar 2013
2 answers
113 views
I'm looking at your demo http://www.telerik.com/help/aspnet-ajax/grid-linq-to-sql-manual-crud-operations.html.

I've used it successfully in the past but now I need a combo box dropdown and I'm getting nowhere.  It crashes on Object reference not set to an instance of an object.

Where is a decent example?
-----------------------
Here's my code.  I've already verified that the correct data is being returned to the DataSource.

  GridDropDownListColumnEditor rcb = ((GridDropDownListColumnEditor)editableItem.EditManager.GetColumnEditor("Field1"));
  rcb.DataTextField = "text";
 rcb.DataValueField = "value";           
 rcb.DataSource = HSSDDataLayerStatic.getFieldStatus();
 rcb.DataBind();            
 inputSetting.TargetControls.Add(new TargetInput(rcb.UniqueID, true));


Boris
Top achievements
Rank 1
 answered on 19 Mar 2013
2 answers
132 views

In a older version of asp controls, I create a simple validation on the OnItemCreated event of radgrid and works great, but in the latest version of asp controls every time I click edit or create new record throws exception"Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: Editor cannot be initialized for column: [Name column]". I've the same code in several places in my website.

here is my code:

.cs
        protected void gridFases_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = e.Item as GridEditableItem;
                GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("Nombre");
                TableCell cell = (TableCell)editor.TextBoxControl.Parent;

                RequiredFieldValidator validator = new RequiredFieldValidator();
                editor.TextBoxControl.ID = "Nombre";
                validator.ControlToValidate = editor.TextBoxControl.ID;
                validator.ErrorMessage = "El nombre de la fase es obligatorio.";
                cell.Controls.Add(validator);

            }
        }

.aspx

<telerik:RadGrid ID="gridFases" runat="server"
                OnNeedDataSource="gridFases_NeedDataSource"
                OnInsertCommand="gridFases_InsertCommand" 
                OnUpdateCommand="gridFases_UpdateCommand" 
                OnItemCreated="gridFases_ItemCreated">
            <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="Id" InsertItemPageIndexAction="ShowItemOnCurrentPage" >
                <NoRecordsTemplate>
                    <div>
                        No hay fases asociadas
                    </div>
                </NoRecordsTemplate>
                <CommandItemSettings  AddNewRecordText="Nueva fase" RefreshText="Refrescar" ShowRefreshButton="false"  />
                <EditFormSettings>
                    <EditColumn EditText="Guardar" CancelText="Cancelar"  UpdateText="Actualizar" InsertText="Guardar"></EditColumn>
                </EditFormSettings>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="OrdenEjecucion" SortOrder="Ascending" />
                </SortExpressions>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton"  />
                    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" UniqueName="Id" Visible="false" ReadOnly="true" />
                    <telerik:GridTemplateColumn DataField="OrdenEjecucion" HeaderText="Orden de ejecución" UniqueName="OrdenEjecucion">
                        <InsertItemTemplate>
                            <telerik:RadNumericTextBox ID="txtOrdenEjecucion" MinValue="1" MaxValue="100" runat="server" ShowSpinButtons="True" Value="1">
                                <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" DecimalDigits="0"/>
                            </telerik:RadNumericTextBox>
                        </InsertItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="txtOrdenEjecucion" MinValue="1" MaxValue="100" runat="server" ShowSpinButtons="True" Value='<%#Convert.ToDecimal( Eval("OrdenEjecucion")) %>'>
                                <NumberFormat AllowRounding="True" KeepNotRoundedValue="False" DecimalDigits="0"/>
                            </telerik:RadNumericTextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "OrdenEjecucion")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="Nombre" HeaderText="Nombre de la fase" UniqueName="Nombre" Visible="true"/>
                    <telerik:GridCheckBoxColumn DataField="Obligatorio" HeaderText="¿Fase obligatoria?" UniqueName="Obligatorio"  Visible="true"/>
                </Columns>
            </MasterTableView>
            <ValidationSettings EnableValidation="true" />
        </telerik:RadGrid>
Maria Ilieva
Telerik team
 answered on 19 Mar 2013
1 answer
125 views
Hi All

I've a RadTextbox in one of my .ascx files in a Sitefinity 5.4 website.. When a form containing the RadTextbox is submitted and there is some error thrown by the server, and the user goes back and tries to resubmit the form, there is validation message appearing even if there is input showing from the initial submission. It looks like the input from the first submission is treated as watermark.

Any idea why this is happening?

Thanks
Maria Ilieva
Telerik team
 answered on 19 Mar 2013
3 answers
101 views

Good morning.

I have a form of low Additions and changes, in which data is stored in a DB, to consult on a GRID shown in this way I have a RadComboBox with opchion of CheckedBox, the start page is read the first record in the grid , which puts on the combo records check (this is in the gRID rowselected the client side) and is correct, but when clicking on another grid record, this does not mark that must be left with the same selection of combos.

Schedule the code, the GRID and RowSelected the generating function to mark records, thanks in advance for your support.

functionRowSelected(sender, eventArgs) {

 var comboPais = $find('<%=RCbo_int_pkpaicvepais.ClientID%>');

 var comboEstado = $find('<%=RCbMs_Var_pbcCveEstados.ClientID%>');

 if ($get('<%= Txt_TipoMovimiento.ClientID %>').value == 'N' ||  $get('<%= Txt_TipoMovimiento.ClientID %>').value == 'M')

 { } else

 { $find('RTxt_int_pkemempresa').set_value(eventArgs.getDataKeyValue("int_pkemempresa"));

 $find('RTxt_Int_PKpbcCveTabla').set_value(eventArgs.getDataKeyValue("Int_PKpbcCveTabla"));

 $find('RCbo_int_pkpaicvepais').set_text(eventArgs.getDataKeyValue("int_pkpaicvepais"));

 $find('RCbMc_int_pkmuncvemunicipio').set_text(eventArgs.getDataKeyValue("int_pkmuncvemunicipio"));

 $find('RCbMc_Int_pbcCvePrecio').set_value(eventArgs.getDataKeyValue("Int_pbcCvePrecio"));

 $find('RCbo_Int_pbcCveTienda').set_value(eventArgs.getDataKeyValue("Int_pbcCveTienda"));

 $find('RTxt_Tyint_pbcEstatus').set_value(eventArgs.getDataKeyValue("Tyint_pbcEstatus"));
//Eject function CkeckItems

 EnableItems($find("<%= RCbMs_Var_pbcCveEstados.ClientID %>"), eventArgs.getDataKeyValue("Var_pbcCveEstados"), false);
EnableItems($find("<%= RCbMs_Var_pbcCvesProductos.ClientID %>"), eventArgs.getDataKeyValue("Var_pbcCvesProductos"), true);

 }

 

 } 

 

function EnableItems(combo, Str_Elementos, Bol_Estatus) {

 var comboItems = combo.get_itemData();

 var comboDatos = combo.get_items();

 if(Str_Elementos.trim() != "")

 {
var Str_ArrElem = Str_Elementos.split(",");
//Clear ItemsChecks

 Fn_MarcaDesmarcaChecks(combo, Bol_Estatus);

 

combo.trackChanges();

 

for (var j = 0; j < Str_ArrElem.length; j++) {

    for (var i = 0; i < combo.get_items().get_count(); i++) {

       if (comboItems[i].value == Str_ArrElem[j].trim()) {

       //alert(comboDatos._array[i]._text + "-" + i + "-" + Str_ArrElem[j].trim() + "-" + comboItems[i].value);

       comboDatos._array[i].set_checked(true);
       break;

     }

   }

}

}

combo.commitChanges();

}

 

 

function Fn_MarcaDesmarcaChecks(combo, Bol_Marca) {
var comboDatos = combo.get_items();

 combo.trackChanges(); 

for (var i = 0; i < combo.get_items().get_count(); i++) {

 comboDatos._array[i].set_checked(Bol_Marca);

 

 } 

combo.commitChanges();

 }

Marin
Telerik team
 answered on 19 Mar 2013
5 answers
116 views
How to implement to delete an appointment when 'del' key is pressed from keyboard. From the radScheduler demo i can delete the appointment by press 'Del' key from keyboard. But I do not know how to easily enable this fuction for radScheduler (asp.net) control? Can you give me a simple example? thanks.
Plamen
Telerik team
 answered on 19 Mar 2013
3 answers
116 views
I have a panel bar that is dynamically populated with items that represent answers to questions in a survey. The problem I am having is that the items (answers) are displayed inside an href tag which is not exactly what I want. How can I prevent the panel bar from adding an href tag to items inside?

Thanks,

Jaime
Boyan Dimitrov
Telerik team
 answered on 19 Mar 2013
1 answer
78 views
Hi,

I'm having a problem loading and rendering the controls on asp.net Ajax 4.5 pages (attached bitmap). I already registered the dll in web.config and as well as on aspx page. I also reference the dll in my project. Are there steps I missed? Thanks.

Default aspx page

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


Web.config

<controls>

 <add assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagPrefix="telerik" />

</controls>



Slav
Telerik team
 answered on 19 Mar 2013
2 answers
234 views
Hi,

I am using radbarcode.I want to print the displayed barcode.

Thnx in advance
Shinu
Top achievements
Rank 2
 answered on 19 Mar 2013
10 answers
438 views
I use ExportToPdf() to do just that.

When the file is opened on the client, buttons for saving, printing etc are shown at the bottom. How do I set the default path and filename for the "Save as" dialog?


Regards, Jill-Connie Lorentsen
Jill-Connie Lorentsen
Top achievements
Rank 1
 answered on 19 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?