Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
238 views
I have the following code that has two checkboxes. Each displays a panel when it is clicked. The first checkbox is attached to a validator.
if the text is left empty and both checkboxes are clicked, and the submit button is clicked, the validation summary dispalys the error message twice. Why does it do that??
here is my markup. I have simplified it to the very bare minimum: 

<form id="Form1" method="post" runat="server" style="margin-left: 0px; margin-top: 0px">  

<asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager>  

<telerik:RadAjaxManager ID="ajaxManager1" runat="server"> 

<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="chkMain">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panelMain" />

</UpdatedControls>

 </telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="chkSub">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panelSub" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
<asp:CheckBox ID="chkMain" runat="server" Checked="false" Text="main" AutoPostBack="true" OnCheckedChanged="chkMain_CheckedChanged" />
<asp:Panel ID="panelMain" runat="server" Visible="false">
<asp:TextBox ID="MainText" runat="server" />
<asp:RequiredFieldValidator ID="rv1" runat="server" ControlToValidate="MainText" ErrorMessage="required" />
</asp:Panel>
<asp:CheckBox ID="chkSub" runat="server" AutoPostBack="true" Checked="false" Text="sub" />
<asp:Panel ID="panelSub" runat="server" Visible="false">
Description
</asp:Panel>
<asp:Button ID="btnSubmit" CausesValidation="true" runat="server" Text="Submit"></asp:Button>
</form>

and my codebehind is very simple too:
 

protected void Page_Load(object sender, EventArgs e)  

{

}

protected void chkMain_CheckedChanged(object sender, EventArgs e)

{

panelMain.Visible = chkMain.Checked;

 }

Tim
Top achievements
Rank 1
 answered on 29 May 2013
3 answers
260 views
I know how to render a scheduler on a page and use GetAppointmentsInRange to get/count appointments, but how can I get that information programmatically without having to put a scheduler on a page? Based on the default schema. 

I have an application used for scheduling staff. Staff use appointments to mark when they are unavailable. I need to get a list of all staff that are unavailable during a certain time frame, but rendering a scheduler control with 2000 staff then calling GetAppointmentsInRange is too slow. Based on the schema and the way the scheduler control saves recurrence, is it possible to get a list of all appointments in a range without rendering the control? 

Here are my database columns, I only added one, "employeeID"

ID
Subject
Description
Start
End
RecurrenceRule
RecurrenceParentID
Reminder
Annotations
EmployeeID

So I need a command that will return all employeeID numbers that have appointments between 2 dates (a timeframe). Considering how recurrence is done by the radScheduler, what can I do to get this result? 

Thank you very much!
Genady Sergeev
Telerik team
 answered on 29 May 2013
1 answer
310 views
Instead of using the inherent AjaxUpdatedControl to do the server/client update, can I use jQuery to selectively update only the telerik grid and not carry a whole lot of viewstate etc.,
Viktor Tachev
Telerik team
 answered on 29 May 2013
2 answers
112 views
Hi I am using radasync upload to load files using this  Control  is there a way to remove the text box before the select button and i want to know why there is a text box because i want to save my page space and it is unnecessary on the page if we are not using and we cannot put any url in the text box to browse to some folder.
SKande
Top achievements
Rank 2
 answered on 29 May 2013
1 answer
78 views
Dear Telerik Team,

I need to enable user to click on Page Number when the RAD Telerik Grid is disabled. Kindly guide me.

With Regards
L.Palanivelrajan

Eyup
Telerik team
 answered on 29 May 2013
1 answer
124 views
Dear Telerik Team,

I have a RAD Grid that has image on one column and on click it opens a Edit Popup. When the RAD Grid is disabled, How to enable user to click on image. Grid should look like disabled mode but image column alone should be clickable.

With Regards
L.Palanivelrajan.
Eyup
Telerik team
 answered on 29 May 2013
5 answers
395 views
Hi guys,

Having an issue databinding with an Edit in Place grid, when one dropdown's values need to update on postback from the SelectedIndexChanged of another.

I'll put in some of the code at the bottom, I can post more if need be.  (This is a client's code base I'm working with, so I've scrubbed contextual info.  Please forgive typos or generic-ness in the code!)

Here's the summary:

I'm using LinqDataSources to populate dropdown1 & dropdown2. Originally they were each GridDropDownColumns, all was great.  Then, I found out a requirement that the second dropdown needs to be filtered by a foreign key in the db based on on the selection of dropdown1.

So, I changed both columns to a GridTemplateColumn, no prob.  I found references to http://www.telerik.com/help/aspnet-ajax/grid-with-combobox.html which discusses the first part.  The binding works fine without any autopostbacks on the dropdown1.

Then I added a SelectedIndexChanged as pasted below - works great, the selected value of dropdown1 is maintained in my private int, and the LinqDataSources gets the correct enumeration back.

However, with the (SelectedValue='<%#Bind("Value2") %>') on dropdown2, when the post back occurs, I get an error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

I found this (http://www.telerik.com/community/forums/aspnet-ajax/grid/databinding-methods-such-as-eval-xpath-and-bind-can-only-be-used-in-the-context-of-a-databound-control.aspx) and a few others saying the same, but that solution doesn't bind on save.

I've seen a post (I think reference on this forum) to a nested set of dropdowns, but that example was where only the second of the two dropdown values needed to be stored.  Both values here are needed, so I don't believe I can place both dropdowns in the same column & manipulate.

I also tried decoupling the binding. I was able to populate the dropdown2 on the RadGrid1_ItemDataBound, and I could even get the update save bound by using the LinqDataSource's Updating event and hitting the dropdown2 using the RadGrid's EditItems. However, I'm unable to get the dropdown2's value on the LDS's Insert to modify the saved object.  Doesn't feel like the right solution, but it almost worked.  I couldn't figure out how to save/modify my data object on insert & update using the ItemInserted/ItemUpdated events.

Any help would be appreciated!

<telerik:GridTemplateColumn UniqueName="Column1" HeaderText="Insurance">
    <ItemTemplate>
        <asp:Label ID="lblColumn1" runat="server" Text= '<%# ((MyObject)Container.DataItem).Value1 %> '></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox runat="server" ID="RcbDropdown1" DataTextField="Table1Name" DataValueField="Table1ID" DataSourceID="ldsTable1" NoWrap="True" SelectedValue='<%#Bind("Value1") %>' OnSelectedIndexChanged="RcbDropdown1_SelectedIndexChanged" AutoPostBack="True" OnDataBound="RcbDropdown1_DataBound" >
        </telerik:RadComboBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Column2" HeaderText="Insurance Payer">
    <ItemTemplate>
        <asp:Label ID="lblColumn2" runat="server" Text= '<%# ((MyObject)Container.DataItem).Value2 %> '></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox runat="server" ID="RcbDropdown2" DataTextField="Table2Name" DataValueField="Table2ID" DataSourceID="ldsTable2" SelectedValue='<%#Bind("Value2") %>' OnDataBound="RcbDropdown1_DataBound" OnDataBinding="RcbDropdown1_DataBinding">
        </telerik:RadComboBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

private int myvalue1 { get; set; }
 
protected void RcbDropdown1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
 
    myvalue1 = Maybe.ToInt32(e.Value);
    var dropdown1 = (RadComboBox)sender;
    var item = (GridEditableItem)rcb.NamingContainer;
    var dropdown2 = (RadComboBox)item.FindControl("RcbDropdown2");
    if (dropdown2 != null)
    {
        dropdown2.DataSourceID = "ldsTable2";
        dropdown2.DataTextField = "Table2Name";
        dropdown2.DataValueField = "Table2ID";
        dropdown2.DataBind();
    }
}
 
protected void ldsTable2_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    var results = new List<MySecondObject>();
 
    if (myvalue1.HasValue)
    {
        results = {Repo Call with Enumeration Results filtering by myvalue1}
    }
    e.Result = results;
}
Jon
Top achievements
Rank 1
 answered on 29 May 2013
2 answers
214 views

I upgraded a project to use the 2013 Q1 Telerik dlls and now am receiving the 'unable to find embedded skin 'Vista'.  The project works fine on my machine, but errors out when I move it to the test environment.  The project was upgraded to use the 4.5 framework, but had to be reverted to 4.0, not sure if this could be causing the issue.  Steps I have taken to troubleshoot:

  1. Made sure I had the same versions of telerik.web.ui.dll and telerik.web.ui.skins.dll
  2. Verified they both were present in the bin folder on the test site
  3. Deleted the site and recreated it
  4. Deleted my bin folder and re-added my references
  5. Used different skins such as Vista, Office2010Blue, and Web20

Any ideas what I am missing here or what else I could try?

 

Ryan
Top achievements
Rank 1
 answered on 29 May 2013
2 answers
266 views

I have a RadListBox that allows reordering and requires alternate row coloring.

OnClientLoad and OnClientReordered events call a function in javascript that applies alternate row coloring.

var x = document.getElementsByTagName("li");
for (i = 0; i < x.length; i++) {
    if (i % 2 == 0) {
        x[i].style.backgroundColor = "#EFF3FB";
    }
    else {
        x[i].style.backgroundColor = "white";
    }
}

This had to be done on client side since we can't enable autopostback for performance reasons.

This works, however it disables the hover and selected background color default behavior.

Also, is there a way I can change the CssClass of each item of the RadListBox through the sender object of the OnClientLoad and OnClientReordered events?

Thank you for your assistance.

Nencho
Telerik team
 answered on 29 May 2013
1 answer
79 views
I have a upload button on the custom webpart designed and used in SharePoint 2010. On the Click event of the upload button the content in the SpRadeditor reloads, which hangs the pages for a while and then reloads the content leading to slowness of the process.

This works fine, if the content of the SPRadEditor is small.

How can i stop the rad editor from reacting to the Click event of the particular button?

I referred the below specified forum and tried to apply the javascript as specified in the forum but it didn't help. Could you please help on the same?

http://www.telerik.com/community/forums/aspnet-ajax/editor/stop-rad-editor-refreshing-on-timer-tick-event.aspx

<script type="text/javascript">

function AvoidTelerikRefresh() {

 

var originalSaveContent = Telerik.Web.UI.RadEditor.prototype.saveContent;

 

Telerik.Web.UI.RadEditor.prototype.saveContent = function () {  };

 

}

</script>

<asp:Button runat="server" ID="btnUpload" Text="Upload" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"

OnClick="btnUpload_Click" OnClientClick="AvoidTelerikRefresh();" />


Stanimir
Telerik team
 answered on 29 May 2013
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?