Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
38 views
Hi,
I Have a radgrid with master and detail table.
Each table has sqldatasource populating data from stored procedure.
A note with sqlprofiler that when I expand first time 1 row from master table
the stored procedure that populate details grid is called n times that n is number of rows in master table.
After that everything is OK. When I expand one row, stored procedure is called once. The master  and details grid has 1 column with Aggregate="Sum".
My question is how can i prevent this first load time madness? 
Marin
Telerik team
 answered on 28 Jan 2011
3 answers
74 views
I have an AjaManager in a master page and a content web form that has an AjaxManagerProxy,
i set the AjaxManagerProxy to AJAXify the RadGrid, but it still causing postback in every action.

Could something make the AjaxManager not work correctly that i should check?

Thank you.
George
Top achievements
Rank 1
 answered on 28 Jan 2011
9 answers
153 views
How do I define a dropdown column for a RadGrid where I just have a predefined set of values (ideally just in the aspx page).

eg. I have a dataField = "Type" and it only the following possible values
"General" = 0
"Special" = 1
"Other" = 2

So I want a ddl that shows the text of those three options with the value linked to the Type field in my underlying datasource
Veli
Telerik team
 answered on 28 Jan 2011
3 answers
96 views
Hi

I'm working with the scheduler and the advanced insert edit form.

I have the need to customize the Sql DataSource INSERT statement attached to my scheduler named RadScheduler1

First up I located the RadScheduler1_AppointmentInsert event.

In there I am able to set the data source InsertCommand like this.

SqlDataSource1.InsertCommand = @"INSERT INTO [Activity] (

etc..

And then execute

SqlDataSource1.Insert();

So far so good.

However, I found that I now need to manually read all of the Advanced Form input boxes to satisfy the insert statement. That is, they are not longer collected for me. A hassle but not a show stopper.

Problem is how to I read the inputs on the advanced form from the code behind?

For example. Using Firebug, I could see that the Start Date text box is named...

RadScheduler1_Form_StartDate_dateInput_text

This object does not exist in the code behind.  How do I read it?
Peter
Telerik team
 answered on 28 Jan 2011
1 answer
55 views
Hi,

I have a repeater list with two links in each row.

I have a radwindow manager.

If I click on one of the links, the rad window pops up as per normal.
Without closing the current popup, if I then click on another link, the new window opens but the position defaults to top left (0,0) and the window loses it offset element.

Please could you advise - I have included the javascript which gets called below. The a href links which call this code are:
<a href="#" onclick="openRadWindow('11', 'Mr. Benjamin White', '1', ' ', ' ', ' ', ' ', '1/MzOBjfbqkF-6dOtzU4dnlVCR3DkkRp0XvTyoiwwKljQ','9','19/01/2011,21/01/2011,22/01/2011','crewbook@gcdemos3.co.uk','07983633674','2'); return false;">Edit</a>
<a href="#" onclick="openQVWindow('11'); return false;">Mr. Benjamin White</a>

There can be any number of these hrefs, each time one is clicked I wish the contents of the pop up window to be refreshed and the position to stay in the same place.

I have two javascript functions as I need to open the windows in two different sizes.

Thanks.

<script type="text/javascript">
            function openRadWindow(EngID, EngName, EngJobSkillID, ClientInviteSentOn, ClientConfirmationSentOn, EngineerInviteResponseOn, EngineerConfirmationResponseOn, GoogleSessionToken, JobID, BookedDatesString, EngEmailAddress, EngMobile, SubscriptionType) {
                var InternalJobRef = $("[id$='_lblJobTitle_Ref']").html();
                var JobTitle = $("[id$='_lblJobTitle']").html();
                var oWnda = radopen("DialogEditResourceBooking.aspx?engID=" + EngID + "&EngName=" + EngName + "&EngJobSkillID=" + EngJobSkillID + "&ClientInviteSentOn=" + ClientInviteSentOn + "&ClientConfirmationSentOn=" + ClientConfirmationSentOn + "&EngineerInviteResponseOn=" + EngineerInviteResponseOn + "&EngineerConfirmationResponseOn=" + EngineerConfirmationResponseOn + "&GoogleSessionToken=" + GoogleSessionToken + "&JobID=" + JobID + "&BookedDates=" + BookedDatesString + "&JobTitle=" + JobTitle + "&InternalJobRef=" + InternalJobRef + "&EngEmailAddress=" + EngEmailAddress + "&EngMobile=" + EngMobile + "&SubscriptionType=" + SubscriptionType, "RadWindow1");
                oWnda.setSize(430, 400);
                oWnda.set_offsetElementID($("#<%=refreshResultsGrid.ClientID %>").attr('id'));
            }
            function openQVWindow(EngID) {
                var oWndb = radopen("DialogQuickViewEngineer.aspx?engID=" + EngID, "RadWindow1");
                oWndb.setSize(550, 650);
                oWndb.set_offsetElementID($("#<%=refreshResultsGrid.ClientID %>").attr('id'));
            }
        </script>
Georgi Tunev
Telerik team
 answered on 28 Jan 2011
1 answer
126 views
I am having problem in the day view of calendar - the slot width is very minimaland I cannot get them to be expanded (see attachment). I am new to Telerik stuff, have played with a few settings but no luck. Month and week views are fine. The html for the control is:

 <telerik:RadScheduler ID="Scheduler1" runat="server" Culture="en-CA" DataKeyField="Id"
                SelectedView="MonthView" DataEndField="End" DataStartField="Start" DataSubjectField="Subject"
                Width="90%" OnAppointmentDataBound="Scheduler1_AppointmentDataBound"
                OnAppointmentDelete="Scheduler1_AppointmentDelete" BorderStyle="None"
                CssClass="RadCalendar_Windows7" OverflowBehavior="Expand"
                ColumnWidth="200px" AllowEdit="False" OnAppointmentClick="Scheduler1_AppointmentClick"
                OnAppointmentInsert="Scheduler1_AppointmentInsert" AllowInsert="true" AdvancedForm-Enabled="False"
                AdvancedForm-EnableResourceEditing="False" verflowBehavior="Expand" Skin="Windows7"
                ReadOnly="false">
                <AdvancedForm Enabled="False" />
                <DayView EnableExactTimeRendering="True" />
            </telerik:RadScheduler>
Peter
Telerik team
 answered on 28 Jan 2011
1 answer
526 views
Hi,

I've got this page with a couple of RadComboBoxes, an asp TextBox, a RadCalendar, a RadGrid and 2 asp Buttons (Submit and Cancel). The idea is that the user can select categories from the comboboxes, enter a value in the textbox, select a date and press Submit to store the data and it will be shown in the radgrid below (together with older entries, based on the date selected in the calendar).

However, for some reason I can't get the RadGrid to update on the client. The data is stored and everything but it simply won't show. Refreshing the page _does_ update it, but so does pressing a  button again (such as edit, submit, or even changing the date on the calendar). What am I doing wrong?
I have the same problem with the Delete button, although the entry does get deleted, it is not reflected on the client.

My ASCX file:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucTimesheet.ascx.cs" Inherits="PRIS.Timesheet.ucTimesheet" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
...

<
telerik:RadAjaxManagerProxy ID="ramAjaxManager" runat="server">
   <AjaxSettings>
      ...
      <telerik:AjaxSetting AjaxControlID="rdgTimeList">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="rdgTimeList" LoadingPanelID="pnlListLoading" />
         </UpdatedControls>
      </telerik:AjaxSetting>
      ...
      <telerik:AjaxSetting AjaxControlID="btnSubmit">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="pnlTimeSheet" LoadingPanelID="pnlListLoading" />
            <telerik:AjaxUpdatedControl ControlID="pnlForm" />
         </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="btnCancel">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="pnlTimeSheet" LoadingPanelID="pnlListLoading" />
            <telerik:AjaxUpdatedControl ControlID="pnlForm" />
         </UpdatedControls>
      </telerik:AjaxSetting>
   </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:Panel runat="server" ID="pnlForm">
   ...
   <asp:Button ID="btnSubmit" runat="server" Text="Boek" CssClass="Button_Pris" TabIndex="6" OnClick="btnSubmit_Click" />
   ...
   <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="Button_Pris" TabIndex="7" OnClick="btnCancel_Click" />
   ...
</asp:Panel>
<asp:Panel runat="server" ID="pnlTimeSheet">
   <telerik:RadGrid ID="rdgTimeList"
             runat="server"
             AutoGenerateColumns="false"
             OnNeedDataSource="rdgTimeList_NeedDataSource"
             OnItemDataBound="rdgTimeList_ItemDataBound"
             OnItemCreated="rdgTimeList_ItemCreated"
             ShowFooter="true">
   <MasterTableView>
      <Columns>
         <telerik:GridTemplateColumn>
            <HeaderStyle Width="22px" />
            <ItemTemplate>
               <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/DesktopModules/PRIS.Common/Images/icn_pencil.gif" OnCommand="btnEdit_Click" CommandName="id" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "pkid").ToString()%>' />
            </ItemTemplate>
         </telerik:GridTemplateColumn>
         <telerik:GridTemplateColumn>
            <HeaderStyle Width="22px" />
            <ItemTemplate>
               <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/DesktopModules/PRIS.Common/Images/icn_delete.gif" OnCommand="btnDelete_Click" CommandName="id" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "pkid").ToString()%>' OnClientClick="if(!confirm('Weet u het zeker?')){return false;}" />
            </ItemTemplate>
         </telerik:GridTemplateColumn>
         ...
      </Columns>
   </MasterTableView>
</telerik:RadGrid>
...
</asp:Panel>

My CS file:
protected void rdgTimeList_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
   ...
 
   int liEmployeeId = (!String.IsNullOrEmpty(ddlEmployee.SelectedValue)) ? Convert.ToInt32(ddlEmployee.SelectedValue) : -1;
   rdgTimeList.DataSource = PRIS.SP.SpCacheUrenVanMedewerker(liEmployeeId, StartDate, EndDate, MaatschappijId).GetDataSet();
 
   ...
}
 
protected void btnSubmit_Click(object sender, EventArgs e)
{
   SaveForm();
   rdgTimeList.Rebind();
}
 
protected void btnCancel_Click(object sender, EventArgs e)
{
   ClearForm();
}
 
protected void SaveForm()
{
   ...
 
   PAtblUur loUur = null;
   string lsProject = ddlProject.SelectedValue;
   string lsDeliverable = ddlDeliverable.SelectedValue;
   string lsActivity = ddlActivity.SelectedValue;
   bool saved = false;
   if (objCalendar.SelectedDates.Count == 1)
   {
      loUur = TimeObject;
 
      loUur.CBMaatschappijID = MaatschappijId;
      loUur.FKActiviteitID = this.SaveActivity();
      loUur.FKPersoonRelatieID = (!String.IsNullOrEmpty(ddlEmployee.SelectedValue)) ? Convert.ToInt16(ddlEmployee.SelectedValue) : -1;
      loUur.DatumBezetting = objCalendar.SelectedDates[0].Date;
      loUur.UrenBesteed = (!String.IsNullOrEmpty(txtHours.Text)) ? Convert.ToDecimal(txtHours.Text) : 0;
 
      try
      {
         loUur.Save();
         saved = true;
      }
      catch
      {
         ErrorManager.Errors = loUur.Errors;
         ErrorManager.LoadErrors();
      }
   }
   else
   {
      ...
   }
 
   if (saved)
   {
      ClearForm(false);
   }
 
   ...
}
 
private void ClearForm() { ClearForm(true); }
private void ClearForm(bool pbClearDate)
{
   // Clear message label
   lblMessage.Text = "";
 
   // Get the current user's id
   int liEmployeeId = (!String.IsNullOrEmpty(ddlEmployee.SelectedValue)) ? Convert.ToInt32(ddlEmployee.SelectedValue) : -1;
 
   // Reload Employee combobox
   ddlEmployee_UpdateDataBind(liEmployeeId);
 
   // Reload Project combobox
   ddlProject_UpdateDataBind(liEmployeeId);
 
   // Clear Deliverable combobox
   ddlDeliverable.Text = "";
   ddlDeliverable.Items.Clear();
   ddlDeliverable.SelectedValue = "";
   ddlDeliverable.SelectedIndex = 0;
 
   // Clear Activity combobox
   ddlActivity.Text = "";
   ddlActivity.Items.Clear();
   ddlActivity.SelectedValue = "";
   ddlActivity.SelectedIndex = 0;
 
   // Clear Hours textbox
   txtHours.Text = "";
   hfTimeId.Value = "-1";
 
   // Clear the selected dates
   if (pbClearDate)
   {
      objCalendar.SelectedDates.Clear();
      objCalendar.SelectedDate = System.DateTime.Now;
   }
 
   // Rebind RadGrid
   rdgTimeList.Rebind();
 
   if (ErrorManager.Errors.Count == 0)
   {
      ErrorManager.HideErrors();
   }
}

Do note that the triple periods (...) in the code mean I omitted some code there for readability.

Any help would be appreciated,

- Dennis


EDIT: In case you're wondering: the dropdownlist UpdateDataBind functions simply set the DataTextField, DataValueField, assign a new DataSet to DataSource and trigger the DataBind function.
Dennis
Top achievements
Rank 1
 answered on 28 Jan 2011
1 answer
54 views
Hi..

I'm using Q2 2010 of telerik.
I'm trying to create custom Filter.....Using GridFilterMenu we extract all our filter fields.....at the same time we r using custom paging also....
using this extracted filter fields we bound the Radgrid.....in this grid we have a multiple GridBoundColumn.....I want to do filter for all the GridBoundColumn... can u help me.... i need sample coding also......



Iana Tsolova
Telerik team
 answered on 28 Jan 2011
3 answers
58 views
Hi,
My code opens a rad window when a gridbutton, located at a radgrid as a column, is clicked. In the OnClientClose event of the window it deletes the related row in the grid. I put an alert at the end of script which is wiritten to delete  row. I can see that the row is deleted at the grid but when the main window  got focused the row comes back. I think I must delete that row after main window has got focused, but there is no such event. I am sure that there is a simple way to do this. I will be pleasured if you help?
Thanks,

delete function

var table = $find("<%= rGrid.ClientID %>").get_masterTableView().get_element();
       var row = table.rows[rowInd];
       table.deleteRow(rowInd);
        
       var dataItem = $find(row.id);
       if (dataItem)
       {
           dataItem.dispose();
           Array.remove($find("<%= rGrid.ClientID %>").get_masterTableView()._dataItems, dataItem);           
       }
Iana Tsolova
Telerik team
 answered on 28 Jan 2011
1 answer
27 views
Hi,

   I've got a page with a bunch of menu items that when clicked open radwindow's with content.  In each RadWindow is usually a RadGrid and a few other controls.  I would like the pages in the RadWindow to use the opener page's RadAjaxLoadingPanel rather than use a RadAjaxLoadingPanel within the RadWindow.  Is there any way to achieve this?  I'm thinking I could hack something together to do this, but if there is some built in functionality that I am not aware of I'd rather use that.

Thank you.
Georgi Tunev
Telerik team
 answered on 28 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?