Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
496 views
Hello,
I have one Page suppose default.aspx Where I have give one link,When I click on this link,One Rad Window
is open,in that Radwindow I have used RadGrid,one of the column of RadGrid is link button,in this Link button click
I am opening one more RadWindow(Which is child Rad Window),What I want to do is in click of one of it's button(Child radwindow's)  suppose Update button, I want to close this Child Radwindow and Refresh Parent Rad Window,But I don't want that Entire Main Page(default.aspx) will also will refresh.I want that Parent window will still be open , only this Parent window will refresh on close of child window.
 Please give me suiatble solutions.I hope I'll get my reply soon.

Thanks
Rahul Khinvasara
Top achievements
Rank 1
 answered on 24 Feb 2009
1 answer
215 views
Hi,

I have a RAD-Grid with approx 900 items. It shows the data with pages of 30 items.
When I press the "select all" checkbox rendered in the header, I wan't it to select all the 900 items.

I am using client-side selection with AllowMultiRowSelection="true" and I have the ClientSettings as follows:
<ClientSettings>
    <Selecting AllowRowSelect="True"  />
</ClientSettings>

Is this possible?

Kind regards,
Morten
Princy
Top achievements
Rank 2
 answered on 24 Feb 2009
4 answers
123 views
Hello

I just want a simple editor like th one I'm using here. However I find the editor control so complex I need to turn lots of things off rather than turn things on, I find the sizing goes all over the shop, especially within a grid.

Any chance of getting the code for using the RadEditor as it has been in the forums
Rumen
Telerik team
 answered on 24 Feb 2009
2 answers
106 views

I would like to enable filtering on the enter key, but i'm having problems with an example i downloaded from telerik and

would like to report a bug.

I downloaded 113486_radgridfiltering example which illustrates filtering on enter key.

The problem is that i use both masterpage and ajaxmanager and of course also an ajaxmanagerproxy.

I get a js error when i try to filter with enter key and for some reason the first item in the radgrid also is put in editmode.

Looks like the js needs a bit of tweaking. :)

I have altered the downloaded example 113486_radgridfiltering to illustrate the problems and packed it in a rar archive.

The example can be downloaded here:  http://80.166.206.186/Screendump/

Hope u have a solution to my problem, filtering without enter key is not an option for my customers. :)

Morten Bomholt
Top achievements
Rank 1
 answered on 24 Feb 2009
3 answers
389 views
I have a radGrid that has inline Edit enabled. When the user clicks the inline Update link the RadGrid_UpdateCommand is triggered. Within that command I make a call to a PageValidate method. If this fails I'm trying to display a message to the screen via a ASP:Label. However the Label is not getting properly refreshed. I have created a button on the page and used the RadAjaxmanager to link the button to the label to test that the label does indeed get the proper value. However I need to ensure that when I click update and the validation fails that the error message is properly displayed (label is refreshed).

ASPX Code:

<rad:RadAjaxPanel ID="errorMessageAjaxPanel" EnableAJAX="true" runat="server"
        <asp:Label ID="errorMessageLabel" runat="server" Font-Bold="true" ForeColor="Red"></asp:Label> 
    </rad:RadAjaxPanel> 
    <asp:Button  ID="button" runat="server" /> 
    <table width="80%" style="margin-left: auto; margin-right: auto;" border="0"
        <tr> 
            <td> 
                <div style="float: left; margin: 5px 5px 10px 5px;"
                    Select Holiday Year: 
                    <asp:DropDownList ID="holidayYear" AutoPostBack="true" runat="server" OnSelectedIndexChanged="holidayYear_SelectedIndexChanged"
                    </asp:DropDownList> 
                    &nbsp 
                </div> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                <rad:RadGrid ID="holidayRadGrid" AllowPaging="True" AllowSorting="True" GridLines="Horizontal" 
                    HorizontalAlign="Center" ShowFooter="true" ShowStatusBar="true" EnableAJAX="true" 
                    EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="25" AutoGenerateColumns="False" 
                    Skin="Grid" SkinsPath="~/App_Themes/VertexDefault" OnNeedDataSource="holidayRadGrid_NeedDataSource" 
                    OnUpdateCommand="holidayRadGrid_UpdateCommand"  
                    PageSize="18" runat="server"
                    <MasterTableView DataKeyNames="HolidayID,HolidayYear,HolidayDate,HolidayName" EditMode="InPlace" 
                        TableLayout="Auto" AllowNaturalSort="false" BorderColor="Black"
                        <Columns> 
                            <rad:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderStyle-Width="10px" /> 
                            <rad:GridBoundColumn HeaderStyle-Width="60px" DataField="HolidayName" HeaderText="Holiday" 
                                SortExpression="HolidayName" UniqueName="HolidayName" ReadOnly="true" /> 
                            <rad:GridTemplateColumn HeaderStyle-Width="100px" DataField="HolidayDate" SortExpression="HolidayDate" 
                                UniqueName="HolidayDate"
                                <ItemTemplate> 
                                    <asp:Label ID="holidayDateLabel" Text='<%# (DateTime) Eval("HolidayDate") == DateTime.MinValue ? String.Empty : String.Format("{0:MM/dd/yyyy}", Eval("HolidayDate")) %>' 
                                        runat="server" /> 
                                </ItemTemplate> 
                                <EditItemTemplate> 
                                    <asp:Calendar ID="holidayDateCalendar" SelectedDate='<%# (DateTime) Eval("HolidayDate") == DateTime.MinValue ? ValidDate : Eval("HolidayDate") %>' 
                                        VisibleDate='<%# (DateTime) Eval("HolidayDate") == DateTime.MinValue ? ValidDate : Eval("HolidayDate") %>' 
                                        runat="server" /> 
                                    <%--<rad:RadCalendar ID="holidayDateCalendar" AutoPostBack="false" EnableMultiSelect="false" SelectedDate='<%# (DateTime) Eval("HolidayDate") == DateTime.MinValue ? ValidDate : Eval("HolidayDate") %>'  VisibleDate='<%# (DateTime) Eval("HolidayDate") == DateTime.MinValue ? ValidDate : Eval("HolidayDate") %>' runat="server" />--%> 
                                </EditItemTemplate> 
                            </rad:GridTemplateColumn> 
                            <rad:GridBoundColumn DataField="HolidayID" UniqueName="HolidayID" ReadOnly="true" 
                                Display="false" /> 
                            <rad:GridBoundColumn DataField="HolidayYear" UniqueName="HolidayYear" ReadOnly="true" 
                                Display="false" /> 
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings EnablePostBackOnRowClick="true"
                        <ClientEvents OnGridCreated="holidayRadGridCreated" OnRowContextMenu="holidayRadGridRowContextMenu" /> 
                    </ClientSettings> 
                </rad:RadGrid> 
                <br /> 
                <div> 
                    <vtx:ImageHoverButton ID="cancelButton" PostBackUrl="~/Home.aspx" ImageUrl="~/App_Themes/VertexDefault/Images/CancelNormal.png" 
                        CssClass="ImageHover" AlternateText="Search" runat="server" /> 
                </div> 
            </td> 
        </tr> 
    </table> 
    <asp:Panel ID="actionPanel" runat="server" Style="display: none" CssClass="modalPopup"
        <asp:Panel ID="titlePanel" CssClass="modalTitle" BackImageUrl="~/App_Themes/VertexDefault/Images/ModalTitleGradient.jpg" 
            runat="server"
            <div> 
                <table width="100%"
                    <tr> 
                        <td style="width: 99%"
                            <asp:Label ID="titleLabel" Text="Change status" runat="server" /> 
                        </td> 
                        <td align="right"
                            <asp:ImageButton ID="closeButton" AlternateText="Close" ImageUrl="~/App_Themes/VertexDefault/Images/Close.png" 
                                runat="server" /> 
                        </td> 
                    </tr> 
                </table> 
            </div> 
        </asp:Panel> 
        <div style="margin-top: 10px"
            Confirm delete of Holiday Date<br /> 
            <b> 
                <asp:Label ID="lblHolidayDate" runat="Server" /></b>&nbsp;for Holiday: <b> 
                    <asp:Label ID="lblHolidayName" runat="server" /></b
            <input type="hidden" id="holidayIDHidden" runat="server" /> 
            <input type="hidden" id="holidayNameHidden" runat="server" /> 
            <input type="hidden" id="holidayYearHidden" runat="server" /> 
            <input type="hidden" id="holidayDateHidden" runat="server" /> 
            <input type="hidden" id="errorMessageHidden" runat="server" /> 
        </div> 
        <br /> 
        <asp:Button ID="applyButton" Text="Apply" OnClick="applyButton_Click" runat="server" /><br /> 
        &nbsp; 
    </asp:Panel> 
    <asp:Button ID="hiddenButton" Style="display: none" runat="server" /> 
    <atk:ModalPopupExtender ID="actionPanelModalPopupExtender" BehaviorID="actionModalBehavior" 
        PopupControlID="actionPanel" TargetControlID="hiddenButton" CancelControlID="closeButton" 
        PopupDragHandleControlID="titlePanel" DropShadow="true" runat="server" /> 
    <rad:RadAjaxManager ID="ajaxManager" ClientEvents-OnResponseReceived="hideModalPopup()" 
        runat="server"
        <AjaxSettings> 
            <rad:AjaxSetting AjaxControlID="applyButton"
                <UpdatedControls> 
                    <rad:AjaxUpdatedControl ControlID="applyButton" /> 
                    <rad:AjaxUpdatedControl ControlID="errorMessageLabel" /> 
                    <rad:AjaxUpdatedControl ControlID="holidayRadGrid" LoadingPanelID="holidayRadGridLoadingPanel" /> 
                </UpdatedControls> 
            </rad:AjaxSetting> 
            <rad:AjaxSetting AjaxControlID="button"
                <UpdatedControls> 
                    <rad:AjaxUpdatedControl ControlID="errorMessageLabel" /> 
                </UpdatedControls> 
            </rad:AjaxSetting> 
        </AjaxSettings> 
    </rad:RadAjaxManager> 
    <rad:AjaxLoadingPanel ID="holidayRadGridLoadingPanel" runat="Server"
        <asp:Image ID="loadingImage" ImageUrl="~/App_Themes/VertexDefault/Grid/Loading.gif" 
            AlternateText="Loading" BorderWidth="0px" runat="server" /> 
    </rad:AjaxLoadingPanel> 
    <rad:RadMenu ID="gridContextRadMenu" IsContext="True" OnClientItemClicked="OnClientItemClickedHandler" 
        ContextMenuElementID="none" Skin="Menu" SkinsPath="~/App_Themes/VertexDefault" 
        runat="server"
        <Items> 
            <rad:RadMenuItem Text="Delete the date for this Holiday?" Value="CS" /> 
        </Items> 
    </rad:RadMenu> 

C# Code:
protected void Page_Load(object sender, EventArgs e) 
        { 
            log.Debug("Page_Load"); 
 
            // Get current user and customer 
            User user = Master.CurrentUser; 
            Customer customer = GetCustomer(user); 
 
            // Set year for page heading 
            int holidayYearPlusOne = System.DateTime.Now.Year + 1; 
            int holidayYearPlusTwo = System.DateTime.Now.Year + 2; 
 
            lblHolidayYear.Text = System.DateTime.Now.Year.ToString(); 
 
            if (!IsPostBack) 
            { 
                int currentHolidayYear = Convert.ToInt32(DateTime.Now.ToString("yyyy")); 
 
                // Populate filing year dropdown  
                holidayYear.Items.Add(new ListItem(System.DateTime.Now.Year.ToString(), System.DateTime.Now.Year.ToString())); 
                holidayYear.Items.Add(new ListItem(holidayYearPlusOne.ToString(), holidayYearPlusOne.ToString())); 
                holidayYear.Items.Add(new ListItem(holidayYearPlusTwo.ToString(), holidayYearPlusTwo.ToString())); 
             
                // Clear old data 
                Session.Remove(Constants.Session.PageData); 
                         
                // Build data 
                BuildTable(currentHolidayYear); 
            } 
            else 
            { 
                // Set year for page heading  
                lblHolidayYear.Text = holidayYear.SelectedValue; 
                 
            } 
            // Checks page security 
            CheckPageSecurity(customer, user); 
        } 
 
        /// <summary> 
        /// Handles the SelectedIndexChanged event of the holidayYear control. 
        /// </summary> 
        /// <param name="sender">The source of the event.</param> 
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
        protected void holidayYear_SelectedIndexChanged(object sender, EventArgs e) 
        { 
            log.Debug("holidayYear_SelectedIndexChanged"); 
 
            if (returns == null) 
            { 
                // Create returns manager 
                returns = ReturnsFactory.CreateReturns(); 
            } 
 
            // Clear old data 
            Session.Remove(Constants.Session.PageData); 
 
            // Build data 
            BuildTable(Convert.ToInt32(holidayYear.SelectedValue.ToString())); 
 
            // Set year for page heading  
            lblHolidayYear.Text = holidayYear.SelectedValue; 
 
            // Clear out edit mode for items in grid 
            holidayRadGrid.MasterTableView.ClearEditItems(); 
            holidayRadGrid.Rebind(); 
        } 
        #endregion 
 
        #region Private Methods 
        /// <summary> 
        /// Builds the table. 
        /// </summary> 
        private void BuildTable(int currentHolidayYear) 
        { 
            log.Debug("BuildTable"); 
 
            try 
            { 
                if (returns == null) 
                { 
                    // Create returns manager 
                    returns = ReturnsFactory.CreateReturns(); 
                } 
 
                // Clear out any errors that may have been displayed to the screen 
                errorMessageLabel.Text = ""
                 
                // Set 'Year' 
                validDate = new DateTime(Convert.ToInt32(holidayYear.SelectedValue), DateTime.Now.Month, DateTime.Now.Day); 
 
                // Fetch Holidays 
                Holidays holidays = (Holidays)Session[Constants.Session.PageData]; 
                 
                // Get Holidays if they are not already in the session 
                if (holidays == null) 
                { 
                    holidays = returns.GetHolidays(currentHolidayYear); 
                    Session[Constants.Session.PageData] = holidays; 
                } 
 
                holidayRadGrid.DataSource = holidays.Values; 
                //holidayRadGrid.DataBind(); 
 
                if (errorMessageHidden.Value.Length > 0) 
                { 
                    errorMessageLabel.Text = errorMessageHidden.Value; 
                } 
 
                // Set correct year to be used for the column HolidayDate's Header Text 
                holidayRadGrid.MasterTableView.GetColumn("HolidayDate").HeaderText = holidayYear.SelectedValue; 
                //holidayRadGrid.Rebind(); 
            } 
            catch (Exception ex) 
            { 
                log.Error("Error occurred in page '{0}'. Message: '{1}'", Request.Url.Segments[Request.Url.Segments.Length - 1], ex.Message); 
                Response.Redirect(Constants.Pages.ErrorPage); 
            } 
        } 
 
        /// <summary> 
        /// Checks the page security. 
        /// </summary> 
        /// <param name="customer">The customer.</param> 
        /// <param name="user">The user.</param> 
        private void CheckPageSecurity(Customer customer, User user) 
        { 
            log.Debug("CheckPageSecurity"); 
 
            // Allow delete/delete? 
            allowDelete = Master.CheckPageSecurity(customer, user, string.Format(@"{0}/Delete", AppRelativeVirtualPath)) == Permission.EditExecute; 
        } 
 
        /// <summary> 
        /// Gets the customer. 
        /// </summary> 
        /// <param name="user">The user.</param> 
        /// <returns></returns
        private Customer GetCustomer(User user) 
        { 
            // Get current customer 
            Customer customer = Master.CurrentCustomer; 
 
            // Customer specified on the querystring? 
            if (Request[Constants.QueryString.Customer] != null) 
            { 
                if (!Request[Constants.QueryString.Customer].Equals(customer.CustomerNumber, StringComparison.OrdinalIgnoreCase)) 
                { 
                    if (returns == null) 
                    { 
                        // Create returns manager 
                        returns = ReturnsFactory.CreateReturns(); 
                    } 
 
                    // Only allowed to specify a different customer if we are a Vertex user 
                    if (!returns.IsVertexUser(user)) 
                    { 
                        // Log security violation 
                        returns.LogSecurityViolation(user, string.Format("Attempt to access UserList.aspx with querystring '{0}'.", Request.QueryString)); 
                        Response.Redirect(Constants.Pages.HomePage); 
                    } 
 
                    // Get customer 
                    customer = returns.GetCustomer(Request[Constants.QueryString.Customer]); 
                } 
            } 
            return customer; 
        } 
 
        /// <summary> 
        /// Handles the UpdateCommand event of the holidayRadGrid control. 
        /// </summary> 
        /// <param name="source">The source of the event.</param> 
        /// <param name="e">The <see cref="Telerik.WebControls.GridCommandEventArgs"/> instance containing the event data.</param> 
        protected void holidayRadGrid_UpdateCommand(object source, GridCommandEventArgs e) 
        { 
            GridEditableItem eeditedItem = e.Item as GridEditableItem; 
             
            // Get current user and customer 
            User user = Master.CurrentUser; 
             
            try 
            { 
                if (returns == null) 
                { 
                    // Create returns manager 
                    returns = ReturnsFactory.CreateReturns(); 
                } 
 
                // Find controls in the edit item template 
                GridEditableItem item = (GridEditableItem)e.Item; 
                Calendar holidayDateCalendar = (Calendar) item.FindControl("holidayDateCalendar"); 
             
                // Validate input fields 
                if (!ValidateInput(holidayDateCalendar.SelectedDate)) 
                { 
                    holidayRadGrid.Rebind(); 
                     
                    return; 
                } 
                 
                // If the old value is equal to "1/1/0001 12:00:00 AM" then the a date for this holiday 
                // has never been set.  
                if ((DateTime)editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["HolidayDate"] == DateTime.MinValue) 
                { 
                    // INSERT 
                    Holiday holiday = new Holiday(); 
                    holiday.HolidayDate = Convert.ToDateTime(holidayDateCalendar.SelectedDate); 
                    holiday.HolidayYear = Convert.ToInt32(holidayYear.SelectedValue.ToString()); 
                    holiday.HolidayID = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["HolidayID"].ToString()); 
                    returns.CreateHolidayDate(holiday, user.UserID); 
                } 
                else 
                { 
                    // UPDATE 
                    Holiday holiday = new Holiday(); 
                    holiday.HolidayDate = Convert.ToDateTime(holidayDateCalendar.SelectedDate); 
                    holiday.HolidayYear = Convert.ToInt32(holidayYear.SelectedValue.ToString()); 
                    holiday.HolidayID = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["HolidayID"].ToString()); 
                    returns.UpdateHolidayDate(holiday, user.UserID); 
                } 
 
                // Refresh grid 
                holidayRadGrid.DataSource = returns.GetHolidays(Convert.ToInt32(holidayYear.SelectedValue.ToString())).Values; 
                holidayRadGrid.Rebind(); 
                Response.Redirect(ReturnsConstants.Pages.HolidayListEdit); 
            } 
             
            catch (Exception ex) 
            { 
                // Log error 
                log.Error("Error occurred in page '{0}'. Message: '{1}'", Request.Url.Segments[Request.Url.Segments.Length - 1], ex.Message); 
 
                e.Canceled = true
            } 
        } 
 
        //protected void holidayRadGrid_ItemDataBound(object sender, GridItemEventArgs e) 
        //{ 
        //    log.Debug("holidayRadGrid_ItemCreated"); 
 
             
        //    if ((e.Item.ItemType == GridItemType.Item) || (e.Item.ItemType == GridItemType.AlternatingItem)) 
        //    { 
        //        if (e.Item is GridEditableItem) 
        //        { 
        //            GridEditableItem item = (GridEditableItem) e.Item; 
        //            Calendar holidayDateCalendar = (Calendar) item.FindControl("holidayDateCalendar"); 
        //            if (holidayDateCalendar != null) 
        //            { 
        //                holidayDateCalendar.SelectedDate = ValidDate
        //                holidayDateCalendar.VisibleDate = ValidDate
        //            } 
        //        } 
        //    } 
 
        //} 
 
        /// <summary> 
        /// Handles the NeedDataSource event of the holidayRadGrid control. 
        /// </summary> 
        /// <param name="source">The source of the event.</param> 
        /// <param name="e">The <see cref="Telerik.WebControls.GridNeedDataSourceEventArgs"/> instance containing the event data.</param> 
        protected void holidayRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            log.Debug("holidayRadGrid"); 
             
            // Fetch holiday Dates 
            //Holidays holidays = (Holidays)Session[Constants.Session.PageData]; 
            //holidayRadGrid.DataSource = holidays.Values; 
             
            BuildTable(Convert.ToInt32(DateTime.Now.ToString("yyyy"))); 
 
            if (errorMessageHidden.Value.Length != 0) 
            { 
                errorMessageLabel.Text = errorMessageHidden.Value; 
            } 
 
        } 
 
        /// <summary> 
        /// Handles the Click event of the applyButton control. 
        /// </summary> 
        /// <param name="sender">The source of the event.</param> 
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 
        protected void applyButton_Click(object sender, EventArgs e) 
        { 
            log.Debug("applyButton_Click"); 
 
            try 
            { 
 
                if (returns == null) 
                { 
                    // Create returns factory 
                    returns = ReturnsFactory.CreateReturns(); 
                } 
 
                // Get update user details 
                User user = Master.CurrentUser; 
                 
                // Delete holiday date for a specific holiday 
                if (holidayDateHidden.Value.Length > 0) 
                { 
                    Holiday holiday = returns.GetHolidayDate(Convert.ToInt32(holidayIDHidden.Value.ToString()), Convert.ToInt32(holidayYearHidden.Value.ToString()), Convert.ToDateTime(holidayDateHidden.Value)); 
                    returns.DeleteHolidayDate(holiday, user.UserID); 
                } 
                else 
                { 
                    errorMessageLabel.Text = "You cannot delete an entry that has no date associated to it."
                    //errorMessagePanel.Visible = true
                }                        
 
                Holidays holidays = new Holidays(); 
                holidays = returns.GetHolidays(Convert.ToInt32(holidayYear.SelectedValue.ToString())); 
 
                holidayRadGrid.DataSource = holidays.Values; 
                holidayRadGrid.Rebind(); 
                 
                // Store data 
                Session[Constants.Session.PageData] = holidays; 
            } 
            catch (Exception ex) 
            { 
                log.Error("Error occurred in page '{0}'. Message: '{1}'", Request.Url.Segments[Request.Url.Segments.Length - 1], ex.Message); 
                Response.Redirect(Constants.Pages.ErrorPage); 
            } 
        } 
 
        private bool ValidateInput(DateTime holidayDate) 
        { 
            log.Debug("ValidateInput"); 
 
            // If page is not valid then let the client side show it's errors 
            if (Page.IsValid) 
            { 
                // Re-validate page (in case client side validation did not work) 
                Page.Validate(); 
            } 
 
            // If page is not valid then let the client side show it's errors 
            if (!Page.IsValid) 
            { 
                return false; 
            } 
 
            try 
            { 
                if (holidayDate.Year.ToString() != holidayYear.SelectedValue) 
                { 
                    errorMessageHidden.Value = string.Format("You must select a date that occurs within the currently selected year '{0}'.", holidayYear.SelectedValue); 
                    Master.MessageBox.Show(string.Format("You must select a date that occurs within the currently selected year '{0}'.", holidayYear.SelectedValue), MessageBoxIcon.Error); 
                    return false; 
                } 
            } 
 
            catch (Exception ex) 
            { 
                log.Error("Error occurred in page '{0}'. Message: '{1}'", Request.Url.Segments[Request.Url.Segments.Length - 1], ex.Message); 
                return false; 
            } 
 
            return true; 
         
        } 
     
        #endregion 
 
        #region Properties 
        /// <summary> 
        /// Gets a value indicating whether [allow delete]. 
        /// </summary> 
        /// <value><c>true</c> if [allow delete]; otherwise, <c>false</c>.</value> 
        protected string AllowDelete 
        { 
            get { return allowDelete.ToString().ToLower(); } 
        } 
 
        /// <summary> 
        /// Gets a value indicating whether [allow disable]. 
        /// </summary> 
        /// <value><c>true</c> if [allow disable]; otherwise, <c>false</c>.</value> 
        protected string AllowDisable 
        { 
            get { return allowDisable.ToString().ToLower(); } 
        } 
 
        /// <summary> 
        /// Gets the valid date. 
        /// </summary> 
        /// <value>The valid date.</value> 
        protected DateTime ValidDate 
        { 
            get { return validDate; } 
        } 
        #endregion 
 
 
        #region Fields 
        private bool allowDelete = true
        private bool allowDisable = true
        private IReturnsManager returns = null
        private DateTime validDate; 
        #endregion 

Any help is greatly appreciated.
Iana Tsolova
Telerik team
 answered on 24 Feb 2009
3 answers
133 views
Hi,

I am attempting to present a RadAlert if certain required fields are not completed in a RadGrid Insert. The alert message comes up fine, but the grid closes and we are no longer in Insert Mode.

I have tried this

   editedItem.Edit = True
            RadGrid1.Rebind()
Exit Sub

without success. Does anyone know how to cancel an insert from within the InsertCommand Event? Thanks.



Yavor
Telerik team
 answered on 24 Feb 2009
2 answers
267 views

Hi All,
I am trying to create a webpart for MOSS using two radgrids and two sqldatasources, where the second shows details of the first.
The control parameter of the second datasource should be the selected value of this first grid.
The problem is when I click on a row in the first grid, nothing happens in the second which has led me to believe it is something to do with the control parameter.
Can someone help me determine the problem?
Thanks.
Aaron

        RadAjaxPanel pnlWorkOrders;  
        RadGrid rgOrders;  
        RadGrid rgDetails;  
        SqlDataSource dsOrders;  
        SqlDataSource dsDetails;  
 
        protected override void CreateChildControls()  
        {  
            pnlWorkOrders = new RadAjaxPanel();  
            rgOrders = new RadGrid();  
            rgDetails = new RadGrid();  
            dsOrders = new SqlDataSource();  
            dsDetails = new SqlDataSource();  
 
            dsOrders.ID = "dsOrders";  
            dsOrders.ProviderName = "System.Data.SqlClient";  
            dsOrders.ConnectionString="Data Source=cdshelp;Initial Catalog=TRACKIT70_DATA2;User ID=web_TrackItReader;Password=TRACK11!";  
            dsOrders.SelectCommand="SELECT [WO_NUM], [TASK], [REQUEST], [REQDATE], [DUEDATE], [RESPONS] FROM [TASKS] WHERE ([STATUS] &lt;&gt; @STATUS) AND (REQDATE &gt; @DateNow)";  
            dsOrders.SelectParameters.Add("STATUS""&quot;Completed&quot;");  
            dsOrders.SelectParameters.Add("DateNow",DbType.DateTime,"01/01/2008");  
 
            dsDetails.ID = "dsDetails";  
            dsDetails.ProviderName = "System.Data.SqlClient";  
            dsDetails.ConnectionString="Data Source=cdshelp;Initial Catalog=TRACKIT70_DATA2;User ID=web_TrackItReader;Password=TRACK11!";  
            dsDetails.SelectCommand="SELECT [WO_NUM], [TASK], [DESCRIPT], [NOTE] FROM [TASKS] WHERE ([WO_NUM] = @WO_NUM)";  
            dsDetails.SelectParameters.Add(new ControlParameter("WO_NUM""rgOrders","SelectedValue"));  
 
            rgOrders.ID = "rgOrders";  
            rgOrders.DataSourceID="dsOrders";  
            rgOrders.MasterTableView.DataKeyNames = new string[] { "WO_NUM" };
          
            
            rgOrders.ClientSettings.EnablePostBackOnRowClick = true;  
            rgOrders.ClientSettings.Selecting.AllowRowSelect = true;  
 
            rgDetails.ID = "rgDetails";  
            rgDetails.DataSourceID="dsDetails";  

            rgOrders.AutoGenerateColumns = false;  
            GridBoundColumn wo = new GridBoundColumn();  
            wo.HeaderText = "Work Order #";  
            wo.UniqueName = "WO_NUM";  
            wo.DataField = "WO_NUM";  
            GridBoundColumn ta = new GridBoundColumn();  
            ta.HeaderText = "Task";  
            ta.UniqueName = "TASK";  
            ta.DataField = "TASK";  
            GridBoundColumn rq = new GridBoundColumn();  
            rq.HeaderText = "Requested By";  
            rq.UniqueName = "REQUEST";  
            rq.DataField = "REQUEST";  
            GridBoundColumn dc = new GridBoundColumn();  
            dc.HeaderText = "Date Requested";  
            dc.UniqueName = "REQDATE";  
            dc.DataField = "REQDATE";  
            GridBoundColumn dd = new GridBoundColumn();  
            dd.HeaderText = "Due Date";  
            dd.UniqueName = "DUEDATE";  
            dd.DataField = "DUEDATE";  
            rgOrders.Columns.Add(wo);  
            rgOrders.Columns.Add(ta);  
            rgOrders.Columns.Add(rq);  
            rgOrders.Columns.Add(dc);  
            rgOrders.Columns.Add(dd);  
 
            rgDetails.AutoGenerateColumns = false;  
            GridBoundColumn ds = new GridBoundColumn();  
            ds.HeaderText = "Description";  
            ds.UniqueName = "DESCRIPT";  
            ds.DataField = "DESCRIPT";  
            ds.HeaderStyle.Width = Unit.Percentage(50);  
            ds.ItemStyle.VerticalAlign = VerticalAlign.Top;  
            ds.ItemStyle.HorizontalAlign = HorizontalAlign.Left;  
            GridBoundColumn nt = new GridBoundColumn();  
            nt.HeaderText = "Notes";  
            nt.UniqueName = "NOTE";  
            nt.DataField = "NOTE";  
            nt.HeaderStyle.Width = Unit.Percentage(50);  
            nt.ItemStyle.VerticalAlign = VerticalAlign.Top;  
            nt.ItemStyle.HorizontalAlign = HorizontalAlign.Left;  
 
            pnlWorkOrders.Width = Unit.Percentage(100);  
            pnlWorkOrders.Height = Unit.Percentage(100);  
            pnlWorkOrders.Controls.Add(dsOrders);  
            pnlWorkOrders.Controls.Add(dsDetails);  
            pnlWorkOrders.Controls.Add(rgOrders);  
            pnlWorkOrders.Controls.Add(rgDetails);  
            this.Controls.Add(pnlWorkOrders);  
        } 

 

Yavor
Telerik team
 answered on 24 Feb 2009
1 answer
170 views
I am having trouble getting radalert to fire the first time when following the example posted here:

http://www.telerik.com/support/kb/aspnet-ajax/window/calling-radalert-from-codebehind-all-versions-of-radwindow.aspx

I am using the last example:
3. Calling radalert on RadAjax callback: You can use the ResponseScripts collection of RadAjaxManager for this purpose:

Here's my button codebehind:

 

protected void uxOkButton_Click(object sender, EventArgs e)

 

{

uxAjaxManager.ResponseScripts.Add(

"(function(){var f = function(){radalert('Please select criteria.',300,100,'Search');Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()");

 

}


The radalert only pops up the second time I click on the OK button...

I know in the KB article the last post suggests using the RegisterStartupScript method of the ScriptManager to resolve the issue of the radalert not firing the first time, but I can not do this as I have a RadScriptManager on my page and you can not have both a RadScriptManager and a ScriptManager on the same page (http://telerikwatch.com/2008/05/optimization-tips-using.html).
Fiko
Telerik team
 answered on 24 Feb 2009
7 answers
246 views
Hi,

(working with 2008 Q2 latest trial).

I have a page with a Toolbar, Tabstrip and Multipage.

The Tabstrip and Mutipage are placed in a panel.

The Toolbar can update the containing panel.
The Tabstrip can update the Multipage.

If add tabstrip/multipage ajaxsettings to the manager it works fine.

When I add the toolbar/panel ajax settings it causes problems by adding duplicate updatepanel id's below the panel containing the tabstrip and multipage.

The same can be seen in the page source code on Teleriks on sample page for Show/Hide Web Controls (http://demos.telerik.com/aspnet/prometheus/Ajax/Examples/Common/ShowingWebControls/DefaultCS.aspx).

Look at th page source and you will see the following:

<div id="Panel1Panel">
    <div id="Panel1" style="height:75px;width:226px;">
        <br />
         <br />
        <div id="Label1Panel">
            <span id="Label1"></span>
        </div>
    </div>
    <div id="Label1Panel"> </div>
</div>

In my own code this is causing issues like ajaxloadingpanel not to show on ajax.

Can you please explain this behaviour?

I also have issues with Sys.Webforms.PageRequestManager errors (http://www.telerik.com/community/forums/thread/b311D-bgdech.aspx)

Thanks,

Colin

Iana Tsolova
Telerik team
 answered on 24 Feb 2009
1 answer
214 views
I have a column called TradeAmount that is defined as nvarchar(30) in the DB since some of the values are 1MM+  etc.
However, the non-string values have 2 decimal places which I want to remove, for ex -> 1400000.00 needs to be 1400000.
Tried out different DataFormatStrings on the corresponding GridBoundColumn, but none seems to work and the value continues to show the 2 decimal places.

Suggestions?

Thanks
- Arun
Daniel
Telerik team
 answered on 24 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?