Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
Hello,

i am using RadScheduler and i am trying to completely disable the working hours.I have disable the working hours in the scheduler by setting ShowFooter="False" ShowFullTime="True" but in the advance form i cannot find how to do it.Can someone help me with this?

Thank you.
Peter
Telerik team
 answered on 24 Jan 2011
4 answers
159 views
Hi,
There is some code in my application to set calender min/max range date,  and changes cell style on  day render event.

Now, I want to show a different message in alert of  "Date out of Range.".

<telerik:RadCalendar ID="RadCalendar1"  runat="server" AutoPostBack="true" Skin="Hello"
        EnableEmbeddedSkins="false" EnableMonthYearFastNavigation="false" DayNameFormat="Short"  
        ShowRowHeaders="false" ShowOtherMonthsDays="false" Width="545px"
        ondayrender="RadCalendar1_DayRender" FastNavigationStep="1"
    onselectionchanged="RadCalendar1_SelectionChanged"
    EnableMultiSelect="false" FirstDayOfWeek="Sunday"
        ondefaultviewchanged="RadCalendar1_DefaultViewChanged" >
    <ClientEvents  OnDateClick="dateClick" />
</telerik:RadCalendar>

Thanks...!
UT
Top achievements
Rank 1
 answered on 24 Jan 2011
5 answers
109 views
I have a list of objects that are used as a datasource for the detail table. Not all the fields from the datasource are in the detail grid. I am using the edit form template. Is there any way I can access the detail table datasource fields (not in the detail grid) in the updatecommand event.

Thanks
Marin
Telerik team
 answered on 24 Jan 2011
3 answers
111 views
Hello,

First of all, here is what I am working with:  ASP.NET project using ASP.NET AJAX Q3 2009 SP2 (I know that this is old, but that is what the project is using and I don't have the ability to change this...).

I have a user control (.ascx) which has several fieldsets in it which each contain pieces of data about a job, i.e. job name and description, job variables, job schedule and job notification settings.  In the job notification section, there are two checkboxes which the user can check to specify whether or not they want to be notified about different events.  If at least one checkbox is selected, I want a panel to appear containing a list of email addresses which will be used for the notifications. 

The previous developer wrote a server side OnCheckChanged event that checks to see if either of the checkboxes are selected and, if they are, it makes the panel visible and makes the panel not visible if they aren't.  This works fine without AJAX, except for the fact that the page has to post back.  I thought that it would be a good candidate to ajaxify this process so that only that small section posts back to the server.

Here's where it gets weird.  I put the section of the page in an RadAjaxPanel and everything was working fine for a couple of days.  Then, yesterday, I started getting a weird javascript error.  The only thing that I can think of that changed was that I rebuilt the project prior to building the installer for the project.  Anyway, I can't figure out why this isn't working.  Here is the section of page with the RadAjaxPanel in it.  I'm including some other parts of the page for context, but the RadAjaxPanel in question has the ID of RadAjaxPanelNotification. 

                    <fieldset>
                        <legend>Scheduling</legend>
                        <asp:ObjectDataSource ID="ListenerList" runat="server" SelectMethod="GetListenersList"
                            TypeName="DIS.Business.BLL.Listeners"></asp:ObjectDataSource>
                        Listener<telerik:RadComboBox ID="Listener" runat="server" DataSourceID="ListenerList"
                            DataTextField="ComputerName" DataValueField="ID" Skin="Web20">
                        </telerik:RadComboBox>
                        <br />
                        <asp:ObjectDataSource ID="FrequencyList" runat="server" SelectMethod="GetSchedulePatternList"
                            TypeName="UtilityClass.Utility"></asp:ObjectDataSource>
                        Frequency<asp:RadioButtonList ID="Frequency" runat="server" DataSourceID="FrequencyList"
                            RepeatLayout="Flow" RepeatDirection="Horizontal" OnSelectedIndexChanged="Frequency_SelectedIndexChanged"
                            AutoPostBack="True" OnDataBound="Frequency_DataBound">
                        </asp:RadioButtonList>
                        <br />
                          
                        <asp:CompareValidator ID="FromAndToComparValidator" runat="server" 
                            ErrorMessage="To Date Must be Later than From Date" ControlToValidate="ToTime" 
                            ControlToCompare="FromTime" Operator="GreaterThan"></asp:CompareValidator><br />
                        From<span class="required">*</span> <telerik:RadDateTimePicker ID="FromTime" runat="server" MinDate="2000-01-01"
                            Skin="Web20">
                            <TimePopupButton HoverImageUrl="" ImageUrl="" />
                            <TimeView CellSpacing="-1">
                            </TimeView>
                            <Calendar Skin="Web20" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        </telerik:RadDateTimePicker>
                        <asp:RequiredFieldValidator ID="FromTimeValidator" runat="server" ErrorMessage="Date Required" ControlToValidate="FromTime"></asp:RequiredFieldValidator><br />
                        To<span class="required">*</span>     <telerik:RadDateTimePicker ID="ToTime" runat="server" Skin="Web20">
                            <TimePopupButton HoverImageUrl="" ImageUrl="" />
                            <TimeView CellSpacing="-1">
                            </TimeView>
                            <Calendar Skin="Web20" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                ViewSelectorText="x">
                            </Calendar>
                            <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        </telerik:RadDateTimePicker>
                        <asp:RequiredFieldValidator ID="ToTimeValidator" runat="server" ErrorMessage="Date Required" ControlToValidate="ToTime"></asp:RequiredFieldValidator>
                        <br />
                        <asp:ObjectDataSource ID="WeekdayList" runat="server" SelectMethod="GetWeekDayList"
                            TypeName="DIS.Business.BLL.WeekDays"></asp:ObjectDataSource>
                        <asp:Label ID="lblEvery" runat="server" Text="Every"></asp:Label>
                        <asp:TextBox ID="MinuteInterval" runat="server" MaxLength="5"></asp:TextBox><asp:Label
                            ID="lblMinutes" runat="server" Text="Minutes"></asp:Label>
                        <asp:CheckBoxList ID="Weekday" runat="server" DataSourceID="WeekdayList" RepeatDirection="Horizontal"
                            RepeatLayout="Flow" Visible="False">
                        </asp:CheckBoxList>
                    </fieldset>
                <br />
                <telerik:RadAjaxPanel ID="RadAjaxPanelNotification" runat="server" 
                    LoadingPanelID="RadAjaxLoadingPanel1" HorizontalAlign="NotSet">
                    <fieldset>
                        <legend>Notification</legend>
                        <asp:CheckBox ID="SendSuccessful" runat="server" Text="Send notification if successful."
                            OnCheckedChanged="NotificationChanged" AutoPostBack="True" />
                        <asp:CheckBox ID="SendFailed" runat="server" Text="Send notification if failed."
                            OnCheckedChanged="NotificationChanged" AutoPostBack="True" /><br />
                        <asp:Panel ID="PanelEmailDetail" runat="server" Visible="False">
                            New Email<br />
                            <asp:TextBox ID="NewEmail" runat="server" MaxLength="128"></asp:TextBox><asp:Button
                                ID="AddEmail" runat="server" Text="Add Email" OnClick="AddEmail_Click" /><br />
                            <asp:ListBox ID="EmailList" runat="server" SelectionMode="Multiple" Rows="5"></asp:ListBox>
                            <asp:Button ID="RemoveEmail" runat="server" Text="Remove Email" 
                                OnClick="RemoveEmail_Click" style="width: 125px" /><br />
                        </asp:Panel>
                    </fieldset>
                </telerik:RadAjaxPanel>
                <asp:Button ID="Save" runat="server" Text="Save" OnClick="Save_Click" />
                <asp:Button ID="BtAssignedUsers" runat="server" Font-Bold="True" 
                     Text="Assigned Users" />
                <telerik:RadInputManager ID="RadInputManager1" runat="server" 
                    OnInit="RadInputManager1_Init" Skin="Web20">
                    <telerik:TextBoxSetting BehaviorID="Behavior1">
                        <TargetControls>
                            <telerik:TargetInput ControlID="JobName" />
                            <telerik:TargetInput ControlID="Description" />
                        </TargetControls>
                        <Validation IsRequired="true" ValidationGroup="JobScheduling_1" />
                    </telerik:TextBoxSetting>
                    <telerik:RegExpTextBoxSetting BehaviorID="Behavior2" 
                        ErrorMessage="Invalid Email" 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
                        <TargetControls>
                            <telerik:TargetInput ControlID="NewEmail" />
                        </TargetControls>
                        <Validation IsRequired="true" ValidationGroup="JobScheduling_1_Email" />
                    </telerik:RegExpTextBoxSetting>
                    <telerik:NumericTextBoxSetting BehaviorID="Behavior3" 
                        Culture="English (United States)" DecimalDigits="0" DecimalSeparator="." 
                        GroupSeparator="," GroupSizes="3" MaxValue="10000" MinValue="0" 
                        NegativePattern="-n" PositivePattern="n">
                        <TargetControls>
                            <telerik:TargetInput ControlID="MinuteInterval" />
                        </TargetControls>
                    </telerik:NumericTextBoxSetting>
                </telerik:RadInputManager>
        </td>
    </tr>
</table>

Here is the code behind for the event:

protected void NotificationChanged(object sender, EventArgs e)
{
    ChangeNotificationUI();
}
  
private void ChangeNotificationUI()
{
    bool blnDisplayNotificationList = this.SendSuccessful.Check || this.SendFailed.Checked;
    this.PanelEmailDetail.Visible = blnDisplayNotificationList;
}

Ajax works when the either of the buttons are checked or unchecked and the panel is visible; I see the loading panel appear and then disappear after the server side processing.  It also works when both buttons are unchecked; the loading panel appears and as soon as the server side processing is done, the panel is set to not visible.  The thing that has started happening is when the panel is set to not visible and a check box is checked, instead of the loading panel, I get a webpage error which says "Error: Object required."  If I use the IE script debugger, the line that is failing has "if (typeof(b) =="undefined") {c=a.value;" and the error message says something like:  "Object required: Telerik.Web.UI.WebResource.axd? TSM HiddenField =RadScriptManager1 TSM&compress=1& ..."  I am attaching a screenshot with more information.

We're pretty stumped on this.  First of all, we can't figure out why this was working and now, all of a sudden, we're getting this error.  Something must have changed but we don't know what.  Second, this doesn't look like something which is all that complicated and should be easily handled by a RadAjaxPanel.  When we take the RadAjaxPanel out, this works fine but it just posts back to the server, which is what we'd like to avoid.  Does anybody have any suggestions as to what might be going wrong?

Regards,
John

Marin
Telerik team
 answered on 24 Jan 2011
3 answers
148 views
Hi there,
If you set the style of a page to Black and have a confirmation window implemented it appears that the question mark in the dialog has rough edges. Seems if it has had a white background before and has been fixed with a lasso tool with too low tolerance :)
regards,
Johan
Bozhidar
Telerik team
 answered on 24 Jan 2011
1 answer
302 views
Hi,

I am using RadAjaxPanel and my girdview is under that panel. I have one template and under that template I have one button for report which opening a new report in a new page but the problem is that under ajax panel it doesn't work and if I remove my the ajax panel it works fine and open a new report in a new window. If this problem is with the response.write then how can I disable my ajax request for opening a report in a new window.  Because I don't want to completely remove ajaxpanel or if you can provide some solution without disabling ajax request. 


<telerik:RadAjaxLoadingPanel ID="alpProductionSechduleMain" runat="server" Height="75px"
    MinDisplayTime="5" Width="75px">
    <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Portals/0/Images/LoadingAjax.gif" />
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxPanel ID="rapPSMain" RequestQueueSize="5" runat="server" Width="100%" 
    OnAjaxRequest="rapPSMain_AjaxRequest" EnableOutsideScripts="True" HorizontalAlign="NotSet" 
    ScrollBars="None" LoadingPanelID="alpProductionSechduleMain" ><asp:GridView ID="gvJobs" runat="server" Width="100%" CellPadding="2" AutoGenerateColumns="False"
        CssClass="gridviewSpacing gvJobs" AllowPaging="true">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="lnkbtnEditJob" runat="server" CommandArgument='<%# Eval("JobKey")%>'
                        OnClick="lnkbtnEditJob_Click">edit</asp:LinkButton>
                    <asp:LinkButton ID="lnkbtnPrintJob" runat="server" CommandArgument='<%# Eval("JobKey")%>' OnClientClick="OpenReport(this);" >print</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField></Columns></asp:GridView></telerik:RadAjaxPanel>Protected Sub rapPSMain_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)        Response.Clear()
        Response.AddHeader("Content-Disposition", "attachment;filename=" & sFilename & ".htm")
        Response.ContentType = "text/html"


Protected Sub rapPSMain_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
        Response.Clear()
        Response.AddHeader("Content-Disposition", "attachment;filename=" & sFilename & ".htm")
        Response.ContentType = "text/html"
        Dim eEncoding As Encoding = Encoding.GetEncoding("Windows-1252")
        Dim eUnicode As Encoding = Encoding.Unicode
        Dim byUnicodeBytes As Byte() = eUnicode.GetBytes(sData)
        Dim byEncodedBytes As Byte() = Encoding.Convert(eUnicode, eEncoding, byUnicodeBytes)
        Response.BinaryWrite(byEncodedBytes)
        Response.Flush()
        Response.End()
    End Sub













Pavlina
Telerik team
 answered on 24 Jan 2011
6 answers
96 views
On BtnClick, I am inserting all data from my RADGRID into my SQL database. I am getting an FormatException of Input String was not in correct format.
Error was in line-
Dim str5 As String = Integer.Parse(item.Cells(5).Text.Trim)
If String.IsNullOrEmpty(str5) Then
str5 = "0"
End If
I tried many method to convert string in integer, but nothing worked. 

Please help me what i am missing in the code. My code is below.

VB.NET-
 Public Sub AddGrid()
        For Each item As GridDataItem In GD_Prod.Items


            'getting the bound fields values 


            Dim str0 As String = (item.Cells(0).Text.Trim)
            If String.IsNullOrEmpty(str0) Then
                str0 = "0"
            End If


            Dim str1 As String = (item.Cells(1).Text.Trim)
            If String.IsNullOrEmpty(str1) Then
                str1 = "0"
            End If


            Dim str2 As String = (item.Cells(2).Text.Trim)
            If String.IsNullOrEmpty(str2) Then
                str2 = "0"
            End If


            Dim str5 As String = Integer.Parse(item.Cells(5).Text.Trim)
            If String.IsNullOrEmpty(str5) Then
                str5 = "0"
            End If


            Dim str13 As String = Integer.Parse(item.Cells(13).Text.Trim)
            If String.IsNullOrEmpty(str13) Then
                str13 = "0"
            End If


            Dim str14 As String = Integer.Parse(item.Cells(14).Text.Trim)
            If String.IsNullOrEmpty(str14) Then
                str14 = "0"
            End If


            ''''''getting the template fields value   
            Dim tx3 As TextBox = DirectCast(item.Cells(3).FindControl("TxtSTUPort"), TextBox)
            Dim tx4 As TextBox = DirectCast(item.Cells(4).FindControl("TxtAAPort"), TextBox)
            Dim tx6 As TextBox = DirectCast(item.Cells(6).FindControl("TxtFPort"), TextBox)
            Dim tx7 As TextBox = DirectCast(item.Cells(7).FindControl("TxtQoFUsed"), TextBox)
            Dim tx8 As TextBox = DirectCast(item.Cells(8).FindControl("TxtPPort"), TextBox)
            Dim tx9 As TextBox = DirectCast(item.Cells(9).FindControl("TxtLOPort"), TextBox)
            Dim tx10 As TextBox = DirectCast(item.Cells(10).FindControl("TxtBFPort"), TextBox)
            Dim tx11 As DropDownList = DirectCast(item.Cells(11).FindControl("ddlLOCode"), DropDownList)
            Dim tx12 As TextBox = DirectCast(item.Cells(12).FindControl("TxtTSPort"), TextBox)


           
            ' inserting the template values 
            Dim str3 As String = CType((tx3.Text.Trim), Integer)
            If String.IsNullOrEmpty(str3) Then
                str3 = "0"
            End If


            Dim str4 As String = CType((tx4.Text.Trim), Integer)
            If String.IsNullOrEmpty(str4) Then
                str4 = "0"
            End If


            Dim str6 As String = CType((tx6.Text.Trim), Integer)
            If String.IsNullOrEmpty(str6) Then
                str6 = "0"
            End If


            Dim str7 As String = CType((tx7.Text.Trim), Integer)
            If String.IsNullOrEmpty(str7) Then
                str7 = "0"
            End If


            Dim str8 As String = CType((tx8.Text.Trim), Integer)
            If String.IsNullOrEmpty(str8) Then
                str8 = "0"
            End If


            Dim str9 As String = CType((tx9.Text.Trim), Integer)
            If String.IsNullOrEmpty(str9) Then
                str9 = "0"
            End If


            Dim str10 As String = CType((tx10.Text.Trim), Integer)
            If String.IsNullOrEmpty(str10) Then
                str10 = "0"
            End If


            Dim str11 As String = CType((tx11.SelectedValue), Integer)
            If String.IsNullOrEmpty(str11) Then
                str11 = "0"
            End If


            Dim str12 As String = CType((tx12.Text.Trim), Integer)
            If String.IsNullOrEmpty(str12) Then
                str12 = "0"
            End If




            Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("FOOD_AND_NUTRITIONConnectionString").ConnectionString)
            Dim cmd As New SqlCommand("P_FN_PR_InsertGridData", con)
            cmd.CommandType = CommandType.StoredProcedure
            cmd.Parameters.Add("@Pkey", SqlDbType.Char).Value = (lblPKey.Text).Trim
            cmd.Parameters.Add("@PL_Recipe_Number", SqlDbType.Char).Value = str0
            cmd.Parameters.Add("@PL_Recipe_Name", SqlDbType.Char).Value = str1
            cmd.Parameters.Add("@PL_Portion_Size", SqlDbType.Char).Value = str2
            cmd.Parameters.Add("@PL_Student_Portions_Planned", SqlDbType.Int).Value = CType((str3), Integer)
            cmd.Parameters.Add("@PL_Adults_ALC__Portions_Planned", SqlDbType.Int).Value = CType((str4), Integer)
            cmd.Parameters.Add("@PL_Total__Portions_Planned", SqlDbType.Int).Value = str5
            cmd.Parameters.Add("@PL_Factor_Portions", SqlDbType.Char).Value = CType((str6), Char)
            cmd.Parameters.Add("@DOC_Quantity_Of_Food_Used", SqlDbType.Char).Value = CType((str7), Char)
            cmd.Parameters.Add("@DOC_Portions_Prepared ", SqlDbType.Int).Value = CType((str8), Integer)
            cmd.Parameters.Add("@DOC_Portions_Brought_Forward ", SqlDbType.Int).Value = CType((str9), Integer)
            cmd.Parameters.Add("@DOC_Portions_Leftover", SqlDbType.Int).Value = CType((str10), Integer)
            cmd.Parameters.Add("@DOC_Leftover_Code", SqlDbType.Char).Value = CType((str11), Char)
            cmd.Parameters.Add("@DOC_Total_Portions_Served", SqlDbType.Int).Value = CType((str12), Integer)
            cmd.Parameters.Add("@DOC_Portions_Served_Students", SqlDbType.Int).Value = CType((str13), Integer)
            cmd.Parameters.Add("@DOC_Portions_Served_Adults_ALC", SqlDbType.Int).Value = CType((str1), Integer)
            con.Open()
            'cmd.ExecuteNonQuery()
            Dim rows As Integer = (cmd.ExecuteNonQuery)
            con.Close()
            If rows = 1 Then
                MsgBox("Saved!")
            Else
                MsgBox("Failed to save!")
            End If
        Next


    End Sub
 Public Sub btnsave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsave.Click
        AddGrid()
End Sub

ASPX-
<telerik:RadGrid ID="GD_Prod" runat="server" AllowPaging="True" ShowHeader="False"
                    AutoGenerateColumns="False"  GridLines="None"
                    Height="173px" Skin="Outlook" Width="1107px">
                    <ClientSettings AllowColumnsReorder="True">
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
<Selecting AllowRowSelect="True"></Selecting>
<Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                    </ClientSettings>
                    <MasterTableView >
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
    <Columns>
        <telerik:GridBoundColumn DataField="port_recipe_num" HeaderText="Recipe #" SortExpression="port_recipe_num"
            UniqueName="port_recipe_num" 
            DataType="System.Char" 
            >
            <HeaderStyle Width="17px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DESC_ALT" HeaderText="Description" SortExpression="DESC_ALT"
            UniqueName="DESC_ALT"  
            DataType="System.Char" >
            <HeaderStyle Width="36px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="port_no_servings" HeaderText="Portion Size" SortExpression="port_no_servings"
            UniqueName="port_no_servings" 
            DataType="System.Char" >
            <HeaderStyle Width="16px" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="PL_STUDENT_Portions_Planned" 
             DataType="System.Int32" 
            DataField="PL_STUDENT_Portions_Planned" >
            <ItemTemplate>
                <asp:TextBox ID="TxtSTUPort" DataField="PL_STUDENT_Portions_Planned" runat="server"
                    Height="16px" Width="30px"  
                    ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="19px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="PL_Adults_ALC_Portions_Planned" 
            DataType="System.Int32" 
            DataField="PL_Adults_ALC_Portions_Planned" 
            >
            <ItemTemplate>
                <asp:TextBox ID="TxtAAPort" DataField="PL_Adults_ALC_Portions_Planned" runat="server"
                    Height="16px" Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="19px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="STD_NUM_OF_SERVING" HeaderText="Total Potions Planned"
            SortExpression="STD_NUM_OF_SERVING" UniqueName="STD_NUM_OF_SERVING" 
            DataType="System.Int32" 
            >
            <HeaderStyle Width="14px" />
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn UniqueName="PL_Factor_Portions" DataType="System.Char" 
            DataField="PL_Factor_Portions"
            >
            <ItemTemplate>
                <asp:TextBox ID="TxtFPort" DataField="PL_Factor_Portions" runat="server" Height="16px"
                    Width="30px"></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="18px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Quantity_Of_Food_Used" 
            DataType="System.Char" 
            DataField="DOC_Quantity_Of_Food_Used" >
            <ItemTemplate>
                <asp:TextBox ID="TxtQoFUsed" DataField="DOC_Quantity_Of_Food_Used" runat="server"
                    Height="16px" Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="20px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_Prepared" 
            DataType="System.Int32" 
            DataField="DOC_Portions_Prepared" 
            >
            <ItemTemplate>
                <asp:TextBox ID="TxtPPort" DataField="DOC_Portions_Prepared" runat="server" Height="16px"
                    Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_Brought_Forward" 
            DataType="System.Int32" 
            DataField="DOC_Portions_Brought_Forward" >
            <ItemTemplate>
                <asp:TextBox ID="TxtBFPort" DataField="DOC_Portions_Brought_Forward" runat="server"
                    Height="16px" Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Portions_LeftOver" 
            DataType="System.Int32" 
            DataField="DOC_Portions_LeftOver" >
            <ItemTemplate>
                <asp:TextBox ID="TxtLOPort" DataField="DOC_Portions_LeftOver" runat="server" Height="16px"
                    Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_LeftOver_Code"  DataType="System.Char" 
            DataField="DOC_LeftOver_Code"  
            >
            <ItemTemplate>
                <asp:DropDownList ID="ddlLOCode" DataField="DOC_LeftOver_Code" runat="server" Font-Size="10px"
                    Height="16px" Width="46px" AppendDataBoundItems="True" 
                    >
                    <asp:ListItem>CF</asp:ListItem>
                    <asp:ListItem>DIS</asp:ListItem>
                    <asp:ListItem>ALC</asp:ListItem>
                    <asp:ListItem>RTB</asp:ListItem>
                    <asp:ListItem>RTF</asp:ListItem>
                </asp:DropDownList>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn UniqueName="DOC_Total_Portions_Served" 
            DataType="System.Int32" 
            DataField="DOC_Total_Portions_Served" >
            <ItemTemplate>
                <asp:TextBox ID="TxtTSPort" DataField="DOC_Total_Portions_Served" runat="server"
                    Height="16px" Width="30px" ></asp:TextBox>
            </ItemTemplate>
            <HeaderStyle Width="16px" />
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn UniqueName="POSStudents" DataField="POSStudents" HeaderText="POSStudents" 
            SortExpression="POSStudents" DataType="System.Int32" 
            >
            <HeaderStyle Width="18px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="POSAdultsALC" DataField="POSAdultsALC" HeaderText="POSAdultsALC" 
            SortExpression="POSAdultsALC" DataType="System.Int32" 
           >
            <HeaderStyle Width="16px" />
        </telerik:GridBoundColumn>
    </Columns>
    <PagerStyle AlwaysVisible="True" />
</MasterTableView>
                </telerik:RadGrid>
<asp:Button ID="btnsave" runat="server" Height="20px" Text="SAVE" Width="50px"
                        ToolTip="Click to Save " BackColor="#DFEFFF" ForeColor="#003399" />

Stored_Procedure-
CREATE PROCEDURE [DBO].P_FN_PR_InsertGridData
(
@Pkey char(15),
@PL_Recipe_Number char(4),
@PL_Recipe_Name char(20),
@PL_Portion_Size char(6),
@PL_Student_Portions_Planned int,
@PL_Adults_ALC__Portions_Planned int,
@PL_Total__Portions_Planned int,
@PL_Factor_Portions char(10),
@DOC_Quantity_Of_Food_Used char(10),
@DOC_Portions_Prepared int,
@DOC_Portions_Brought_Forward int,
@DOC_Portions_Leftover int,
@DOC_Leftover_Code char(3),
@DOC_Total_Portions_Served int,
@DOC_Portions_Served_Students int,
@DOC_Portions_Served_Adults_ALC int
)

AS
INSERT INTO FNProdRecDetails (Date_Loc_Type, PL_Recipe_Number, PL_Recipe_Name, PL_Portion_Size, PL_Student_Portions_Planned, PL_Adults_ALC__Portions_Planned, 
PL_Total__Portions_Planned, PL_Factor_Portions, DOC_Quantity_Of_Food_Used, DOC_Portions_Prepared, DOC_Portions_Brought_Forward, DOC_Portions_Leftover,
DOC_Leftover_Code, DOC_Total_Portions_Served, DOC_Portions_Served_Students, DOC_Portions_Served_Adults_ALC)
VALUES (@Pkey , @PL_Recipe_Number, @PL_Recipe_Name, @PL_Portion_Size, @PL_Student_Portions_Planned, @PL_Adults_ALC__Portions_Planned,
@PL_Total__Portions_Planned, @PL_Factor_Portions, @DOC_Quantity_Of_Food_Used, @DOC_Portions_Prepared, @DOC_Portions_Brought_Forward, @DOC_Portions_Leftover,
@DOC_Leftover_Code, @DOC_Total_Portions_Served, @DOC_Portions_Served_Students, @DOC_Portions_Served_Adults_ALC)
Princy
Top achievements
Rank 2
 answered on 24 Jan 2011
1 answer
38 views
Hi,

I have a RadGrid with templated forms within it. I have the functionality to add, edit or delete a record in this grid.
If i select the edit on a record,  i get a form listing under the record which lists the lists the UniqueData Key field in a label so you can identify the record you are editting. If i was to select the "add new record" button then i would get a blank form in the last record where the label would read "New Record". Also, if i had a record open for editting and then clicked on Add record, the editting would stop & only the add record form would be open.
However, if i select "add record" first & then click on "edit for a different record, the edit record's edit form will display but the add record form will still be open. Also, both labels on the 2 open forms reads "new record" and you can't save the Edit record form (no error comes up but nothing happens when you click on save).
Why does the grid allow the user to edit a record without closing the add record form? Why does it confuse the edit form for a new record form? Is this a bug in the RadGrid control & is there a way of stopping this? (i.e. if i click Add New Record then only the add record form should be visible  & if i then click edit a record the add record form should be cancelled and only the edit form should be visible).

Please let me know if you have a solution to this.

Regards,

Shuja
Veli
Telerik team
 answered on 24 Jan 2011
4 answers
224 views
Hello, I have a problem with a usercontrol as editform in a radgrid. In the usercontrol is a checkbox and a combobox. The combobox is made visible as the checkbox gets checked. This works fine without "Ajaxifing" the control (so full pageback is posted).  I'm trying to get the checkbox and the combobox in a updatepanel, but then I get the following error: Jscript runtime error: (...) could not find UpdatePanel with ID 'Radgrid1.(..)..UpdatePanel1. If it is being updated dynamically then it must be inside another UpdatePanel

This is de usercontrol

<%@ Control Language="VB" AutoEventWireup="true" CodeFile="GridEdit4.vb" Inherits="GridEdit4" %> 
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" > 
  <ContentTemplate> 
    <asp:panel runat="server" ID="pUpdate">  
      <asp:CheckBox runat="server" id="chkUpdate" OnCheckedChanged="updateCombobox" AutoPostBack="true" /> 
      <asp:Label runat="server" ID="lbUpdate" Text="Update test" /> 
      <telerik:radcombobox runat="server" ID="cmbUpdate" Visible="false"  ></telerik:radcombobox> 
    </asp:panel> 
  </ContentTemplate> 
</asp:UpdatePanel> 
 
 

 And some snapshots from the aspx file
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true" > 
  <Scripts> 
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
  </Scripts> 
</telerik:RadScriptManager> 
      
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" > 
  <AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="FormatieRadgrid">  
      <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="FormatieRadgrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
        <telerik:AjaxUpdatedControl ControlID="GridEdit4" LoadingPanelID="UpdatePanel1" /> 
      </UpdatedControls> 
    </telerik:AjaxSetting> 
  </AjaxSettings> 
</telerik:RadAjaxManager> 
   
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />     
       
 
 
<!-- This is a snapshot from the Radgrid: --> 
 
    </Columns> 
      <EditFormSettings UserControlName="GridEdit4.ascx" EditFormType="WebUserControl">  
        <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
      </EditFormSettings> 
                                
  </telerik:GridTableView> 
</DetailTables> 
 

What should be done to get to UpdatePanel work in the Usercontrol?

Regards,
-Ruud Feringa

Ruud
Top achievements
Rank 1
 answered on 24 Jan 2011
1 answer
148 views

Is there anyway to disable the Hierarchy grid expansion button based on one of the the master table fields.

Thanks
Shinu
Top achievements
Rank 2
 answered on 24 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?