Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
79 views
I have a problem with Popup EditMode.
In Ie doesnt work. The popup appear under gray..
How I can fix this?
July
Top achievements
Rank 2
 answered on 04 Oct 2011
3 answers
150 views
Hello,

I have a page in which I have placed couple of ASP.NET standard validators which work on text boxes and ask user to enter a value if its empty such as "enter name", there is also a custom validator which checks the RadUpload control for valid extentions, I have used this JavaScript function to cause extention validation.

 

function ValidateUpDetails(source, arguments) {

 

arguments.IsValid = getRadUpload(

'<%# upDetails.ClientID %>').validateExtensions();

 

}

and called this on ClientValidationFunction of custom validator. Now I have a requirement in which I would like to click on a button and that button takes text from email text box and checks the database for records containing that email address, Even if user does not fill other textboxes and only fill email textbox and click on check button it should bring the results via Ajax call and populate the Grid. I have designed all the functionality and it also works but the problem is on Ajax call the validators also work which I don't want and a javascript error also pop up saying 'null' is null or not an object and this error is because of the custom validation function shown above.

I am using AjaxManager and configured it to work on button click and selected the grid and sqldatasource as items for updating, in sqldatasource I decalared a variable @email for which I defined my email textbox as source control.

Is there anyway to make an ajax call without activating validators ? I hope I explained it properly, I am fairly new with ASP.NET and RadControls, I am/was a PHP programmer so all this stuff is new for me.

Thanks.

Kevin
Top achievements
Rank 2
 answered on 04 Oct 2011
2 answers
164 views
Hi,

I have Raddock with my custom logic as appointment form over Scheduler. It works well except for one little issue.

I have checkbox on the Raddock that fires full postback (I use event CheckedChanged event for hiding/showing more controls). For some reason upon that full postback my Raddock form shifts from the center to the upper left corner. I would appreciate if you could advise how to keep Raddock position intact upon full postbacks. Thanks! See below my design view of aspx page:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">


<script type="text/javascript">
function openForm() {
var dock = $find("<%= RadDock1.ClientID %>");
// Center the RadDock on the screen
var viewPort = $telerik.getViewPortSize();
var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);
var yPos = Math.round((viewPort.height - parseInt(dock.get_height())) / 2);
$telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });


dock.set_closed(false);


Sys.Application.remove_load(openForm);
}


function hideForm() {
var dock = $find("<%= RadDock1.ClientID %>");
dock.set_closed(true);


return true;
}


function dockMoved(sender, args) {
//Return RadDock to his original HTML parent so it gets updated via ajax
$get("<%= DockPanel.ClientID %>").appendChild(sender.get_element());
}

</script>


</telerik:RadScriptBlock>
<asp:UpdatePanel runat="server" ID="UpdatePanel1" ChildrenAsTriggers="true" >
<ContentTemplate>
<asp:Panel runat="server" ID="DockPanel">
<telerik:RadDock runat="server" ID="RadDock1"  Skin="Windows7" Width="800px" Height="600px" Closed="true"
Style="z-index: 2000;" Title="Appointment" OnClientDockPositionChanged="dockMoved" >
  
<ContentTemplate>


<asp:CheckBox ID="chkAllDay" runat="server" Checked = "true" AutoPostBack="true" Text="All Day" />

</ContentTemplate>


</telerik:RadDock>
</asp:Panel>




<telerik:RadScheduler ID="RadScheduler1" runat="server"  Skin="Windows7" DataEndField="End" DataKeyField="ID"
DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
DataDescriptionField="Description"
DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject"
HoursPanelTimeFormat="htt" OverflowBehavior="Expand" ValidationGroup="RadScheduler1" 
OnFormCreating="RadScheduler1_FormCreating"
StartEditingInAdvancedForm="false"
StartInsertingInAdvancedForm="false"                 
AppointmentContextMenuSettings-EnableDefault="true" 
TimeSlotContextMenuSettings-EnableDefault="true"  SelectedView="MonthView">

</telerik:RadScheduler>
</ContentTemplate>
</asp:UpdatePanel>
Slav
Telerik team
 answered on 04 Oct 2011
4 answers
122 views
Hi,
I create a server control that inherits the grid, I create the templatecolumn dinamically with ItemTemplate and EditItemTemplate
AutoPostBackOnFilter = true;
                      CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
                      ShowFilterIcon = false;
                        
                      HeaderStyle.Width = _width;
                      ItemStyle.Width = _width;
                      ItemStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Right;
                      HeaderTemplate = new MyHeaderTemplate(_type, DataField, _width.Value - CommonParameters.GridFilterWidthDistances, LabelText);                        
                      ItemTemplate = new MyTemplateText(new GridTemplateColumnParameter()
                          .SetColumnType(CommonParameters.RadGridTemplateColumnType.ItemTemplate)
                          .SetDataField(DataField)
                          .SetDataFieldItem(DataFieldItem)
                          .SetWidth(_width.Value - CommonParameters.GridFilterWidthDistances)
                          .SetReadOnlyOn(_readOnlyOn)
                          );
                      EditItemTemplate = new MyTemplateText(new GridTemplateColumnParameter()
                          .SetColumnType(CommonParameters.RadGridTemplateColumnType.EditItemTemplate)
                          .SetDataField(DataField)
                          .SetDataFieldItem(DataFieldItem)
                          .SetWidth(_width.Value - CommonParameters.GridFilterWidthDistances)
                          .SetReadOnlyOn(_readOnlyOn)
                          .SetRequired(_required)
                          .SetCodice(_codice)
                          .SetMaxLength(_maxLength)
                          .SetLabelText(LabelText)
                          );

The code that create the MyTemplateText is:
private class MyTemplateText : IBindableTemplate
       {
           private TextBox _txb;
           private Label _lbl;
           private GridTemplateColumnParameter _gtcp;
           public MyTemplateText(GridTemplateColumnParameter pGtcp)
           { // Parametert to create label ant text box of the template column
               _gtcp = pGtcp;
           }
           #region IBindableTemplate Members
           public System.Collections.Specialized.IOrderedDictionary ExtractValues(System.Web.UI.Control pContainer)
           {
               OrderedDictionary data = new OrderedDictionary();
               switch (_gtcp.ColumnType)
               {
                     
                   case CommonParameters.RadGridTemplateColumnType.ItemTemplate:
                                           data.Add(_gtcp.DataField, _lbl.Text);
                        break;
                   case CommonParameters.RadGridTemplateColumnType.EditItemTemplate: data.Add(_gtcp.DataField, _txb.Text); break;
               }
               return data;
           }
           #endregion
           #region ITemplate Members
           public void InstantiateIn(System.Web.UI.Control pContainer)
           {
               switch (_gtcp.ColumnType)
               {
                   case CommonParameters.RadGridTemplateColumnType.ItemTemplate:
                       {
                           _lbl = new Label();
                                                     _lbl.CssClass = "ColumnText";
                           _lbl.Width = new System.Web.UI.WebControls.Unit(_gtcp.Width);
                           _lbl.ParentType = CommonParameters.BloccoParentType.RadGrid;
                           _lbl.DataBinding += new EventHandler(Lbl_DataBinding);
                           pContainer.Controls.Add(_lbl);
                       }
                       break;
                   case CommonParameters.RadGridTemplateColumnType.EditItemTemplate:
                       {
                           _txb = new TextBox();
                           _txb.ID = "txb" + _gtcp.DataField;
                           _txb.Width = new System.Web.UI.WebControls.Unit(_gtcp.Width);
                           _txb.DataBinding += new EventHandler(Txb_DataBinding);
                           _txb.MaxLength = _gtcp.MaxLength;
                           switch (_gtcp.ReadOnlyOn)
                           {
                               case CommonParameters.ReadOnlyTemplateMode.All:
                                   {
                                       _txb.ReadOnly = true;
                                   } break;
                               case CommonParameters.ReadOnlyTemplateMode.Item:
                                   {
                                   } break;
                               default: throw new NotImplementedException("ReadOnlyOn non ancora gestita in tutte le tipologie");
                           }
                           pContainer.Controls.Add(_txb);
                           if (_gtcp.Required)
                           {
                               RequiredFieldValidator rfv = new RequiredFieldValidator();
                               rfv.ID = "rfv" + _gtcp.DataField;
                               rfv.CssClass = "ValidatorStyle";
                               rfv.ControlToValidate = "txb" + _gtcp.DataField;
                               rfv.Text = "!";
                               rfv.ErrorMessage = _gtcp.LabelText + " è obbligatorio!";
                               rfv.Display = ValidatorDisplay.Static;
                               pContainer.Controls.Add(rfv);
                                                                                                                     }
                           if (_gtcp.Codice)
                           {
                               RegularExpressionValidator rev = new RegularExpressionValidator();
                               rev.ID = "rev" + _gtcp.DataField;
                               rev.ControlToValidate = "txb" + _gtcp.DataField;
                               rev.Text = "!";
                               rev.CssClass = "ValidatorStyle";
                               rev.ErrorMessage = _gtcp.LabelText + " contiene caratteri non validi!";
                               rev.Display = ValidatorDisplay.Static;
                               rev.ValidationExpression = "^[^\\/*?\"<>|]*$";
                               pContainer.Controls.Add(rev);
                           }
                       } break;
               }
           }
           void Lbl_DataBinding(object sender, EventArgs e)
           {
               Telerik.Web.UI.GridDataItem item = _lbl.NamingContainer as Telerik.Web.UI.GridDataItem;
               if (DataBinder.Eval(item.DataItem, _gtcp.DataField) != null)
               {
                   _lbl.Text = DataBinder.Eval(item.DataItem, _gtcp.DataField).ToString();
                     
                    
               }
           }
           void Txb_DataBinding(object sender, EventArgs e)
           {
               Telerik.Web.UI.GridItem item = _txb.NamingContainer as Telerik.Web.UI.GridItem;
               if (item is Telerik.Web.UI.GridDataItem)
               {
                   object value = DataBinder.Eval(item.DataItem, _gtcp.DataField);
                   if ((value != DBNull.Value) && (value != null))
                   {
                       _txb.Text = value.ToString();
                   }
                   else
                   {
                       _txb.Text = "";
                   }
               }
           }
           #endregion
       }

I use entity framework with automatic insert/update/delete. 
Insert and  Update operations works fine, but Delete NOT ! , the entity tells me a concurrency message ... but it's a false messagge.
Because doing a debug after the "DeleteComand"  the grid "executes"  public System.Collections.Specialized.IOrderedDictionary ExtractValues(System.Web.UI.Control pContainer) "  the grid know the DAtaKeyName and it's the one i choose to delete, but on this function i see the return the LAST ITEM of the page i'm watching on the grid.
Then The entity Class receive a bad information...
So, the question is where is the mistake, ??? I try a telerik standar grid with automatic CRUD operations with entity datasource and everything works as expected, the entity class received information ok.
I hope someone undertand my problem.
Thanks !!!!
archimede
Top achievements
Rank 1
 answered on 04 Oct 2011
1 answer
117 views
Hi,

I realize there is this weird bug happening whenever i use radajaxmanager together with radwindow.

Here is the problem.

whenever i click on the radgrid row, the following function fires :
function show(sender, args){
    winIBRouteRF = $find("<%=winIBRouteRF.ClientID%>");        

    winIBRouteRF.show();

 

}

This works fine until i introduced RadAjaxManager. I couldn't find the reference to the window anymore.
It keeps returning null. The solution to this is if i place the above function outisde of the form tag,
just below </form>. I cannot place this function on the bottom page due to my project requirement.

Actually, not only radwindow, but sometimes, other objects just cannot be found using $find. I have to use
onclientload event in order to get the reference. But unfortunately for radwindow, this event doesn't exist.

I've tried to place the function in Sys.Application.add_load but it doesn't help.

Any suggestions?

Thanks.

PS: I'm not using RadWindowManager, just RadWindow.

Regards,
Dexter

 

 

 

Marin Bratanov
Telerik team
 answered on 04 Oct 2011
1 answer
204 views
Hi

I need to build a custom Appointment Form in a Web-Service based application.
Any Advanced Form sample I found, creating or canceling the edit form produces a postback events (flickering).

Is there any sample how I can create and edit appointments on the client-side using a custom advanced form, without any postback?

Cheers,
Jani
Ivana
Telerik team
 answered on 04 Oct 2011
1 answer
94 views
Hi,

I need to move the appointment from one timeslot  to another using jquery, is it possible to temporarily reposition a selected appointment?

Thanks,
Prava
Ivana
Telerik team
 answered on 04 Oct 2011
2 answers
1.1K+ views
Hi,
i  am using Telerik version released in July 2010. I want to bind a dropdown list on page from selected item empName in grid where empId is bound in griddatakey.
I am not able to use property "RadGrid.ClientSettings.EnableClientKeyValues" which is mentioned in post http://www.telerik.com/community/forums/aspnet/grid/how-to-get-datakeynames-amp-datakeyvalues-on-client-side.aspx to read empId bound in griddatakey.

Please give resolution?
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 Oct 2011
1 answer
111 views
Hello,

I have two pages with RadTabStrip/RadMultiPage controls. Both the multi pages having theRenderSelectedPageOnly="true" setting. Both pages share the same user control, which has the same data. The interesting issue I'm having is that the first page is around 300K, whereas the second page is around 80K. I'm not sure how to figure this out because the control present has the same data, the same controls present, and the pages are identical. I verified both pages hasRenderSelectedPageOnly on.

Any ideas where to look first?

Thanks.

Dimitar Terziev
Telerik team
 answered on 04 Oct 2011
4 answers
179 views
Hi,

When editing something that a user has previously scheduled.   I need to be able to show the date they had previously selected, even though it may be before the current minimum date.  I want to be able to show the selected date, but not allow them to select it if it is before the minimum date.

If you try to set the SelectedDate property before the minimum date, an error is thrown.

Anyone know of a good way to do this?

Thanks!
Vasssek
Top achievements
Rank 1
 answered on 04 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?