Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
145 views

i had problem that the "add new reocrd" button not working (only show loading logo, but cannot display the edit template) if there is no record.

on the other hand, if there is at least one row/record, the "add new record" button can work properly.

<telerik:RadAjaxPanel ID="Panel_License" runat="server" Enabled="false" clientevents-onrequeststart="conditionalPostback">
 
                                                            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                                                            <script type="text/javascript">
                                                                function RowDblClick(sender, eventArgs) {
                                                                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                                                                }
                                                            </script>
                                                        </telerik:RadCodeBlock>
 
                                                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                                            <AjaxSettings>
                                                                <telerik:AjaxSetting AjaxControlID="RadGrid_License">
                                                                    <UpdatedControls>
                                                                        <telerik:AjaxUpdatedControl ControlID="RadGrid_License" LoadingPanelID="RadAjaxLoadingPanel1">
                                                                        </telerik:AjaxUpdatedControl>
                                                                        <telerik:AjaxUpdatedControl ControlID="divMsgs"></telerik:AjaxUpdatedControl>
                                                                    </UpdatedControls>
                                                                </telerik:AjaxSetting>
                                                            </AjaxSettings>
                                                        </telerik:RadAjaxManager>
                                                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                                                        </telerik:RadAjaxLoadingPanel>
                                                            <telerik:RadGrid ID="RadGrid_License" runat="server" CellSpacing="0"
                                                            DataSourceID="ODS_License" GridLines="None" style="margin-top: 0px"
                                                            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
                                                            AutoGenerateColumns="False" ShowStatusBar="True" AllowAutomaticDeletes="True"
                                                            AllowAutomaticInserts="True"
                                                            AllowAutomaticUpdates="True" Width="800">
                                                                <MasterTableView AutoGenerateColumns="False"
                                                                    DataKeyNames="License_To_Operate_ID" DataSourceID="ODS_License"
                                                                    AllowFilteringByColumn="False" AllowPaging="False"
                                                                    CommandItemDisplay="Top" OverrideDataSourceControlSorting="true" >
 
                                                                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                                                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
                                                                        Visible="True">
                                                                    </RowIndicatorColumn>
                                                                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
                                                                        Visible="True">
                                                                    </ExpandCollapseColumn>
 
                                                                    <Columns>
                                                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                                                                        </telerik:GridEditCommandColumn>
                                                                        <telerik:GridBoundColumn DataField="License_To_Operate_ID"
                                                                            FilterControlAltText="Filter License_Number column" HeaderText="License_To_Operate_ID"
                                                                            SortExpression="License_To_Operate_ID" UniqueName="License_To_Operate_ID" Visible="false">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="License_Name"
                                                                            FilterControlAltText="Filter License_Name column" HeaderText="License Name"
                                                                            SortExpression="License_Name" UniqueName="License_Name">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="License_Number"
                                                                            FilterControlAltText="Filter License_Number column" HeaderText="License Number"
                                                                            SortExpression="License_Number" UniqueName="License_Number">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="License_Issuer"
                                                                            FilterControlAltText="Filter License_Issuer column" HeaderText="License Issuer"
                                                                            SortExpression="License_Issuer" UniqueName="License_Issuer">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="Valid_From" DataType="System.DateTime"
                                                                            FilterControlAltText="Filter Valid_From column" HeaderText="Valid From"
                                                                            SortExpression="Valid_From" UniqueName="Valid_From" DataFormatString="{0: dd-MMM-yyyy}">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="Valid_Till" DataType="System.DateTime"
                                                                            FilterControlAltText="Filter Valid_Till column" HeaderText="Valid Till"
                                                                            SortExpression="Valid_Till" UniqueName="Valid_Till" DataFormatString="{0: dd-MMM-yyyy}">
                                                                        </telerik:GridBoundColumn>
                                                                        <telerik:GridBoundColumn DataField="Issue_date" DataType="System.DateTime"
                                                                            FilterControlAltText="Filter Issue_date column" HeaderText="Issue Date"
                                                                            SortExpression="Issue_date" UniqueName="Issue_date" DataFormatString="{0: dd-MMM-yyyy}">
                                                                        </telerik:GridBoundColumn>
                                                                    </Columns>
                                                                    <EditFormSettings EditFormType="Template">
                                                                        <EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
                                                                            UniqueName="EditCommandColumn1">
                                                                        </EditColumn>
 
                                                                    <FormTemplate>
 
                                                        <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
                                                            style="border-collapse: collapse;">
                                                            <tr class="EditFormHeader">
                                                            <td style="width:100px">
                                                            <asp:Label ID="Label5" Text="License Type" runat="server"></asp:Label>                                                           
                                                            </td>
                                                            <td>
                                                                <telerik:RadDropDownList ID="rdl_license_type" runat="server" DataSourceID="LDS_License_type" DefaultMessage="Please select..."
                                                                 DataValueField="License_ID" DataTextField="License_name" >
                                                                </telerik:RadDropDownList>  
                                                                <%--<asp:Label ID="Lb_License_ID" runat="server" text='<%# Bind("License_ID") %>' Visible="false"></asp:Label>--%>
                                                     
                                                            </td>
                                                            </tr>
                                                            <tr >
                                                            <td >
                                                            <asp:Label ID="lb" Text="License Number" runat="server"></asp:Label>                                                           
                                                            </td>
                                                            <td>
                                                            <asp:TextBox ID="tb_License_Number" runat="server" Text='<%# Bind("License_Number") %>' TabIndex="2"></asp:TextBox>                                                           
                                                            </td>
                                                            </tr>
                                                            <tr>
                                                            <td>
                                                            <asp:Label ID="Label1" Text="License Issuer" runat="server"></asp:Label>
                                                            </td>
                                                            <td>
                                                            <asp:TextBox ID="tb_License_Issuer" runat="server" Text='<%# Bind("License_Issuer") %>' TabIndex="3"></asp:TextBox>
                                                            </td>
                                                            </tr>
                                                            <tr>
                                                            <td>
                                                            <asp:Label ID="Label2" Text="Issue Date" runat="server"></asp:Label>
                                                            </td>
                                                            <td>
                                                            <telerik:RadDatePicker ID="IssueDatePicker" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Issue_Date") %>' TabIndex="4"></telerik:RadDatePicker>
                                                            </td>
                                                            </tr>
                                                            <tr>
                                                            <td>
                                                            <asp:Label ID="Label3" Text="Valid From" runat="server"></asp:Label>
                                                            </td>
                                                            <td>
                                                            <telerik:RadDatePicker ID="RadDatePicker_ValidFrom" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Valid_From") %>' TabIndex="5"></telerik:RadDatePicker>
                                                            </td>
                                                            </tr>
                                                                                                                        <tr>
                                                            <td>
                                                            <asp:Label ID="Label4" Text="Valid To" runat="server"></asp:Label>
                                                            </td>
                                                            <td>
                                                            <telerik:RadDatePicker ID="RadDatePicker_ValidTill" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Valid_Till") %>' TabIndex="6"></telerik:RadDatePicker>
                                                            </td>
                                                            </tr>
 
                                                               <tr>
                                                                <td align="right" colspan="2">
                                                                    <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                                                                        runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' >
                                                                    </asp:Button
                                                                    <asp:Button ID="btnDelete" Text="Delete" runat="server" CausesValidation="False"
                                                                        CommandName="Delete"></asp:Button>
                                                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                                        CommandName="Cancel"></asp:Button>
 
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </FormTemplate>
                                                </EditFormSettings>
                                                                    <PagerStyle PageSizeControlType="RadComboBox" />
                                                                </MasterTableView>
                                                                <PagerStyle PageSizeControlType="RadComboBox" />
                                                                <FilterMenu EnableImageSprites="False">
                                                                </FilterMenu>
 
                                                        </telerik:RadGrid>
                                                        <asp:LinqDataSource ID="LDS_License_type" runat="server"
                                                            ContextTypeName="dcLRDBDataContext" EntityTypeName=""
                                                            TableName="db_Dictionary_Licenses">
                                                            </asp:LinqDataSource>
                                                        <asp:ObjectDataSource ID="ODS_License" runat="server"
                                                            SelectMethod="GetLicenseArrayByUserID" TypeName="LRDB">
                                                            <SelectParameters>
                                                                <asp:SessionParameter DefaultValue="0" Name="id" SessionField="SelectedUserID"
                                                                    Type="String" />
                                                            </SelectParameters>
                                                        </asp:ObjectDataSource>
                                                        <asp:LinqDataSource ID="LDS_License" runat="server"
                                                            ContextTypeName="dcLRDBDataContext" EntityTypeName=""
                                                            TableName="db_Employee_Licenses" Where="UserID == @UserID">
                                                            <WhereParameters>
                                                                <asp:SessionParameter Name="UserID" SessionField="SelectedUserID"
                                                                    Type="Int32" DefaultValue="0"/>
                                                            </WhereParameters>
                                                        </asp:LinqDataSource>
                                      <br />
 
        </telerik:RadAjaxPanel>

Public Function GetLicenseArrayByUserID(ByVal id As String) As ArrayList
    Dim arr As New ArrayList
    arr.Clear()
 
    Dim dc As New dcLRDBDataContext
    Dim i As Integer = 0
 
    Dim result = (From cs In dc.db_Dictionary_Licenses _
                  Group Join cs2 In dc.db_Employee_Licenses _
                  On cs.License_ID Equals cs2.License_ID _
                  Into RightTableResults = Group From cs2 In RightTableResults.DefaultIfEmpty _
                                                 Where cs2.UserID = id _
                                                 Select cs2.License_To_Operate_ID, cs2.Issue_date, cs2.License_Issuer, _
                                                 cs2.License_Number, cs2.Valid_From, cs2.Valid_Till, cs.License_Name, _
                                                 cs.License_ID, Have = If(cs2.UserID = id, "YES", "NO") _
                                                 Order By License_Name).Distinct.ToList
    If Not IsNothing(result) Then
        If result.Count > 0 Then
            For i = 0 To result.Count - 1
                arr.Add(result.Item(i))
            Next
        End If
    End If
 
    dc.Dispose()
    Return arr
End Function

Code behind:

Protected Sub RadGrid_License_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid_License.ItemCommand
    RadGrid_License.MasterTableView.ClearEditItems()
    Dim rnd As New Random()
    Dim tmpUserID As Integer 'allow 10 digit only
 
    If Request.QueryString("EmployeeID") = "" Or Request.QueryString("EmployeeID") = 0 Then  'New Employee
        tmpUserID = rnd.Next(100000, 999999) & DateTime.Now.Hour & DateTime.Now.Minute
        HttpContext.Current.Session("tmpUserID") = tmpUserID
    End If
 
    If e.CommandName = RadGrid.InitInsertCommandName Then   'Click Add New Record button           
        Dim editColumn As GridEditCommandColumn = CType(RadGrid_License.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
        editColumn.Visible = False
 
    ElseIf (e.CommandName = RadGrid.RebindGridCommandName AndAlso e.Item.OwnerTableView.IsItemInserted) Then
        e.Canceled = True
    Else
        Dim editColumn As GridEditCommandColumn = CType(RadGrid_License.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
        If Not editColumn.Visible Then  'Click Cancel button (both Insert and Update mode)
            editColumn.Visible = True
        End If
 
        Dim ddlLicense_id As RadDropDownList = DirectCast(e.Item.FindControl("rdl_license_type"), RadDropDownList)
        Dim txtLicense_Number As TextBox = DirectCast(e.Item.FindControl("tb_License_Number"), TextBox)
        Dim txtLicense_Issuer As TextBox = DirectCast(e.Item.FindControl("tb_License_Issuer"), TextBox)
        Dim dateIssue As RadDatePicker = DirectCast(e.Item.FindControl("IssueDatePicker"), RadDatePicker)
        Dim dateValidFrom As RadDatePicker = DirectCast(e.Item.FindControl("RadDatePicker_ValidFrom"), RadDatePicker)
        Dim dateValidTill As RadDatePicker = DirectCast(e.Item.FindControl("RadDatePicker_ValidTill"), RadDatePicker)
        Dim dc As New dcLRDBDataContext
 
        ' If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
 
        If e.CommandName = "PerformInsert" Then
 
            If Request.QueryString("EmployeeID") = "" Or Request.QueryString("EmployeeID") = 0 Then  'New Employee
                'Dim rnd As New Random()
                'Dim tmpUserID As Integer 'allow 10 digit only
                'tmpUserID = rnd.Next(100000, 999999) & DateTime.Now.Hour & DateTime.Now.Minute
                'HttpContext.Current.Session("tmpUserID") = tmpUserID
 
                dc.insertEmployeeLicense(tmpUserID.ToString, ddlLicense_id.SelectedValue, txtLicense_Number.Text.Trim, txtLicense_Issuer.Text.Trim, _
                                           dateIssue.SelectedDate, dateValidFrom.SelectedDate, dateValidTill.SelectedDate, "Y", DateTime.Now, HttpContext.Current.Session("UserID").ToString)
 
            Else
                dc.insertEmployeeLicense(GetUserIDbyEmployeeID(Request.QueryString("EmployeeID")).ToString, ddlLicense_id.SelectedValue, txtLicense_Number.Text.Trim, txtLicense_Issuer.Text.Trim, _
                                           dateIssue.SelectedDate, dateValidFrom.SelectedDate, dateValidTill.SelectedDate, "N", DateTime.Now, HttpContext.Current.Session("UserID").ToString)
            End If
            RadGrid_License.DataBind()
        ElseIf e.CommandName = "Update" Then
            Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("License_To_Operate_ID")
            Dim uid As Integer
            If Request.QueryString("EmployeeID") = "" Or Request.QueryString("EmployeeID") = 0 Then
                uid = HttpContext.Current.Session("tmpUserID").ToString
            Else
                uid = GetUserIDbyEmployeeID(Request.QueryString("EmployeeID")).ToString
            End If
 
            Dim rec = (From p In dc.db_Employee_Licenses Where p.UserID = uid And p.License_To_Operate_ID = lid).FirstOrDefault
            If Not rec Is Nothing Then
                rec.License_ID = ddlLicense_id.SelectedValue
                rec.License_Number = txtLicense_Number.Text.Trim
                rec.License_Issuer = txtLicense_Issuer.Text.Trim
                rec.Issue_date = dateIssue.SelectedDate
                rec.Valid_From = dateValidFrom.SelectedDate
                rec.Valid_Till = dateValidTill.SelectedDate
                rec.LastUpdateBy = HttpContext.Current.Session("UserID")
                rec.LastUpdateDate = DateTime.Now
                dc.SubmitChanges()
            End If
            RadGrid_License.DataBind()
        ElseIf e.CommandName = "Delete" Then
            Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("License_To_Operate_ID")
            Dim uid As Integer
            If Request.QueryString("EmployeeID") = "" Or Request.QueryString("EmployeeID") = 0 Then
                uid = HttpContext.Current.Session("tmpUserID").ToString
            Else
                uid = GetUserIDbyEmployeeID(Request.QueryString("EmployeeID")).ToString
            End If
            Dim rec2 = (From p In dc.db_Employee_Licenses Where p.UserID = uid And p.License_To_Operate_ID = lid).FirstOrDefault
            If Not IsNothing(rec2) Then
                dc.db_Employee_Licenses.DeleteOnSubmit(rec2)
                dc.SubmitChanges()
            End If
            RadGrid_License.DataBind()
        End If
        'End If
 
        dc.Dispose()
    End If
End Sub
Private Sub RadGrid_License_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid_License.ItemDataBound
    'If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
    '    Dim item As GridEditableItem = e.Item
    '    'access/modify the edit item template settings here
    '    Dim list As RadDropDownList = item.FindControl("rdl_license_type")
    '    'list.DataSource = Country_values
    '    'list.DataBind()
    '    If (Not HttpContext.Current.Session("updatedValue") Is Nothing) Then
    '        list.SelectedValue = 2
    '        'HttpContext.Current.Session("updatedValue")
    '    End If
    'ElseIf (TypeOf e.Item Is GridDataItem AndAlso Not e.Item.IsInEditMode AndAlso Page.IsPostBack) Then
    '    Dim item As GridDataItem = e.Item
    '    Dim label As Label = item.FindControl("Lb_License_ID")
 
    '    'update the label value
    '    label.Text = HttpContext.Current.Session("updatedValue")
    'End If
 
    If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
        Dim item As GridEditableItem = e.Item
        Dim ddl As RadDropDownList = item.FindControl("rdl_license_type")
        ddl.SelectedValue = DataBinder.Eval(e.Item.DataItem, "License_ID").ToString
    End If
 
 
End Sub
 
Protected Sub RadGrid_License_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid_License.PreRender
    If (Not Page.IsPostBack) Then
        RadGrid_License.EditIndexes.Add(0)
        RadGrid_License.Rebind()
    End If
End Sub
 
Protected Sub RadGrid_License_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles RadGrid_License.ItemDeleted
    If Not e.Exception Is Nothing Then
        e.ExceptionHandled = True
        'DisplayMessage(True, "Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " cannot be deleted. Reason: " + e.Exception.Message)
    Else
        'DisplayMessage(False, "Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " deleted")
    End If
End Sub
 
Protected Sub RadGrid_License_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid_License.ItemUpdated
    If Not e.Exception Is Nothing Then
        e.KeepInEditMode = True
        e.ExceptionHandled = True
        'DisplayMessage(True, "Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " cannot be updated. Reason: " + e.Exception.Message)
 
    Else
 
        'DisplayMessage(False, "Employee " + e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("EmployeeID").ToString() + " updated")
        'If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
        '    Dim item As GridEditableItem = e.Item
        '    Dim dc As New dcLRDBDataContext
        '    Dim rec = (From p In dc.db_Employee_Licenses Where p.License_To_Operate_ID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("License_To_Operate_ID").ToString()).FirstOrDefault
 
        '    Dim ddl As RadDropDownList = item.FindControl("rdl_license_type")
        '    'ddl.SelectedValue = DataBinder.Eval(e.Item.DataItem, "License_ID").ToString
 
        '    Dim tb_License_Number As TextBox = item.FindControl("tb_License_Number")
        '    Dim tb_License_Issuer As TextBox = item.FindControl("tb_License_Issuer")
        '    Dim IssueDatePicker As RadDatePicker = item.FindControl("IssueDatePicker")
        '    Dim RadDatePicker_ValidFrom As RadDatePicker = item.FindControl("RadDatePicker_ValidFrom")
        '    Dim RadDatePicker_ValidTill As RadDatePicker = item.FindControl("RadDatePicker_ValidTill")
 
        '    If Not rec Is Nothing Then
        '        rec.License_Number = tb_License_Number.Text
        '        rec.License_Issuer = tb_License_Issuer.Text
        '        rec.License_ID = ddl.SelectedValue
        '        rec.Valid_From = RadDatePicker_ValidFrom.SelectedDate
        '        rec.Valid_Till = RadDatePicker_ValidTill.SelectedDate
        '        rec.Issue_date = IssueDatePicker.SelectedDate
        '        dc.SubmitChanges()
        '    End If
        '    dc.Dispose()
        'End If
    End If
End Sub
 
Protected Sub RadGrid_License_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles RadGrid_License.ItemInserted
    If Not e.Exception Is Nothing Then
        e.ExceptionHandled = True
        e.KeepInInsertMode = True
        'DisplayMessage(True, "Employee cannot be inserted. Reason: " + e.Exception.Message)
    Else
        'DisplayMessage(False, "Employee inserted")
    End If
End Sub

Joe
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
321 views
Hello everybody,

I can't figure out how to remove gradient fill from code-behind generated charts. Here is my current code:

//set default properties
RadChart radChart = new RadChart();
radChart.Appearance.TextQuality = Telerik.Charting.Styles.TextQuality.ClearTypeGridFit;
radChart.ChartTitle.TextBlock.Text = "Test Chart";
radChart.ChartTitle.TextBlock.Appearance.TextProperties.Font = new System.Drawing.Font("Tahoma", 13, System.Drawing.FontStyle.Bold);
radChart.ChartTitle.TextBlock.Appearance.TextProperties.Color = System.Drawing.ColorTranslator.FromHtml("#252525");
radChart.Skin = "Office2007";
radChart.Appearance.Border.Color = System.Drawing.ColorTranslator.FromHtml("#7f7f7f");
 
//create chart series
ChartSeries chartSeries = new ChartSeries();
chartSeries.Name = "Sales";
chartSeries.Type = ChartSeriesType.Pie;
chartSeries.Appearance.FillStyle.FillType = FillType.Solid;
 
//add data
chartSeries.AddItem(120, "Internet");
chartSeries.AddItem(140, "Retail");
chartSeries.AddItem(35, "Wholesale");
radChart.AddChartSeries(chartSeries);

The instruction
chartSeries.Appearance.FillStyle.FillType = FillType.Solid;
doesn't seem to produce effect.

Thanks!


A2H
Top achievements
Rank 1
 answered on 23 Jul 2013
1 answer
302 views
This is the complete code that i am testing and as mentioned in the subject line it does not work as expected

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TestPage.aspx.vb" Inherits="TestDotNet45Site.TestPage" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
 
<head runat="server">
    <title>Contact Us</title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <div class="ContactPage">
        <h1>Contact Us (Please Fill Out The Contact Form Below)</h1>
        <h2><b>Important note:</b> Yahoo, Microsoft and other free email providers often class our emails as spam/junk, so please check your spam/junk folder if you do not hear from us in a timely manner.</h2>
        <p>
            <telerik:RadTextBox ID="FullNameText" runat="server" EmptyMessage="Your Name" Resize="None" Width="400px" Skin="MetroTouch" />
        </p>
 
        <p>
            <telerik:RadTextBox ID="EmailText" runat="server" EmptyMessage="Your E-mail" Resize="None" Width="400px" Skin="MetroTouch" />
        </p>
 
        <p>
            <telerik:RadTextBox ID="SubjectText" runat="server" EmptyMessage="Subject" Resize="None" Width="400px" Skin="MetroTouch" />
        </p>
 
        <p>
            <telerik:RadTextBox ID="MessageText" runat="server" EmptyMessage="Your Message" Resize="None" Width="500px" Skin="MetroTouch" TextMode="MultiLine" Height="120px" />
        </p>
 
        <p>
            <telerik:RadButton ID="SendMessageButton" runat="server" Text="Send" Skin="MetroTouch" Width="110px" CausesValidation="true" ValidationGroup="MyInquiryForm"></telerik:RadButton>
        </p>
         
        <p><b>All fields are mandatory!</b> <asp:Label ID="TestLabel" runat="server" /> </p>
         
        <div>
            <asp:RequiredFieldValidator ID="RequiredFullNameText" runat="server" ErrorMessage="Full Name is mandatory!" ControlToValidate="FullNameText" Display="None" ValidationGroup="MyInquiryForm">*</asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RequiredEmailText" runat="server" ErrorMessage="E-Mail is mandatory!" ControlToValidate="EmailText" Display="None" ValidationGroup="MyInquiryForm">*</asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularEmailText" runat="server" ErrorMessage="Please enter a valid e-mail address!" ControlToValidate="EmailText" Display="None" ValidationGroup="MyInquiryForm" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredSubjectText" runat="server" ErrorMessage="Subject is mandatory!" ControlToValidate="SubjectText" Display="None" ValidationGroup="MyInquiryForm">*</asp:RequiredFieldValidator>
            <asp:RequiredFieldValidator ID="RequiredMessageText" runat="server" ErrorMessage="Message is mandatory!" ControlToValidate="MessageText" Display="None" ValidationGroup="MyInquiryForm">*</asp:RequiredFieldValidator>
            <asp:ValidationSummary ID="ContactValidationSummary" runat="server" ShowSummary="false" ShowMessageBox="true" HeaderText="Please notice that:" ValidationGroup="MyInquiryForm" DisplayMode="BulletList" />
        </div>
    </div>
    </form>
</body>
</html>

I just tested the VERY SAME code in an older project which is not a "Web Aplication" like this one.
Rather it's a website project and the code from above worked like a charm showing the messagebox. Not sure if it's your libraries or i miss something on my end?
Thank you

P.S. the problem is that when i click the Send button with all fields empty it cause postback instead to show the msgbox on client-side :(
Jugoslav
Top achievements
Rank 1
 answered on 23 Jul 2013
16 answers
598 views
Hello there,

I am new to RadControls and RadChart - however I have a problem with the RadChart control - whenever I view my page with the chart on it via VWD 2008 web server, it appears fine. However when I then view the web page with an internet browser (outside of VWD, via the PCs IP Address), I get a red 'X' where the graph should be!

If I disable UseSession, the charts are generated and stored in ~/Temp (as configured), however I still get a Red 'X' if I try to view the chart on the webpage?

Can anyone help?
Waseem
Top achievements
Rank 1
 answered on 23 Jul 2013
2 answers
90 views
Hello there,

I am binding the detail table to a dynamic object so I don't have any sense of what columns are going to appear so I have implemented this through dynamic columns on the grid's DetailTableDataBind method before I bind it to the datasource. This worked fine and all the columns are created accordingly but when I select/expand another row, all my dynamic columns (on the previously selected row) disappears. I have tried creating the columns on the ItemDataBound method as well but to no avail. Any thoughts?

Thanks,
DJ 
DJ
Top achievements
Rank 1
 answered on 23 Jul 2013
4 answers
97 views
I know I'm sort of "taking over" the Grid forum :) But first I do every search possible in old forum posts, in the demos, in the code base and in the on-line docs.
I just hope many of those issues when solved will be helpful to other users as well or maybe (who knows) give suggestions for bugfixes or new features.

Anyway... as stated in the topic it seems that when you have a ToolTipManager on the page with AutoTooltipify="true", filter columns textboxes all show empty Tooltips. I don't want to add "meaningful" tooltips such as "Write your filter here" since I think cluttering the page with tooltips is counter-productive.
Setting the tooltip text to ""  in aspx column declaration doesn't solve the problem
Any solution?
Also I inspected the input element and it seems it has no tooltip, no title and no alt attribute so why this empty tooltip shows up?

Also I couldn't seem to find a way to localize the "open calendar popup" picker tooltip (and his little brother time picker) 

Thanks in advance
Massimiliano
Top achievements
Rank 1
 answered on 23 Jul 2013
1 answer
178 views
I've spent half the day searching for a solution to this but I just can't get it.

I have a TabStrip which is loaded on demand (each tab has its own user control).  On this particular one, I am loading a form view.  The Edit and Insert templates on the formview are identical (except for the command buttons).  Here is the EditItemTemplate.

<EditItemTemplate>
    <div class="formLine">
        <div class="formField66">
            Name of Employer:
            <telerik:RadTextBox ID="txtEmployerName" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Name") %>'></telerik:RadTextBox>
        </div>
    </div>
    <div class="formLine">
        <div class="formField66">
            Employment Address:
            <telerik:RadTextBox ID="txtEmployerAddress" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Address") %>'></telerik:RadTextBox>
        </div>
    </div>
    <div class="formLine">
        <div class="formField33">
            City, State:
            <asp:LinkButton ID="lnkAddEmploymentCity" runat="server" OnClick="lnkAddEmploymentCity_Click">ADD CITY</asp:LinkButton>
            <br />
            <telerik:RadComboBox ID="cboEmploymentCity" runat="server" EmptyMessage="Type city ..." DataSourceID="dsCities" DataValueField="IDNumber" DataTextField="CITY"
                MarkFirstMatch="true" DropDownAutoWidth="Enabled">
                <ItemTemplate>
                    <%# Eval("CITY") %>, <%# Eval("State") %>, <%# Eval("ZIPCODE1") %>  <%# Eval("COUNTY") %>
                </ItemTemplate>
            </telerik:RadComboBox>
            ,
            <telerik:RadTextBox ID="txtEmploymentState" runat="server" MaxLength="2" Width="45px" Enabled="false" Text='<%# Bind("State") %>'></telerik:RadTextBox>
        </div>
        <div class="formField33">
            County:<br />
            <telerik:RadTextBox ID="txtEmploymentCounty" runat="server" MaxLength="50" Enabled="false" Text='<%# Bind("County") %>'></telerik:RadTextBox>
        </div>
        <div class="formField33">
            Zip:<br />
            <telerik:RadMaskedTextBox ID="txtEmploymentZip" runat="server" Mask="#####" Enabled="false" Text='<%# Bind("ZipCode") %>'></telerik:RadMaskedTextBox>
        </div>
    </div>
    <div class="formLine">
        <div class="formField33">
            Phone Number:<br />
            <telerik:RadMaskedTextBox ID="txtEmploymentPhoneNumber" runat="server" Mask="(###) ###-####" Columns="15" Text='<%# Bind("Phone") %>'></telerik:RadMaskedTextBox>
        </div>
        <div class="formField66">
            Employment Begin Date:
            <telerik:RadDatePicker ID="txtEmploymentStartDate" runat="server" MinDate="1/1/1900" SelectedDate='<%# Bind("BeginDate") %>'></telerik:RadDatePicker>
        </div>
    </div>
    <div class="formLine">
        <div class="formField66">
            Occupation:
            <telerik:RadTextBox ID="txtEmploymentOccupation" runat="server" MaxLength="255" Width="400" Text='<%# Bind("Occupation") %>'></telerik:RadTextBox>
        </div>
    </div>
    <asp:Button runat="server" Text="Update this Record" CommandName="Update" ID="UpdateButton" CausesValidation="True" />
    <asp:Button runat="server" Text="Cancel Edit" CommandName="Cancel" ID="UpdateCancelButton" CausesValidation="False" />
</EditItemTemplate>

In the FormView's ItemCreated event I set the RadCombo box to AutoPostback and also attach the SelectedIndexChanged event handler:
protected void frmEmployment_ItemCreated(object sender, EventArgs e)
{
    RadComboBox cbo = (RadComboBox)frmEmployment.FindControl("cboEmploymentCity");
    if (cbo != null)
    {
        cbo.AutoPostBack = true;
        cbo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cboEmploymentCity_SelectedIndexChanged);
    }
}
 
protected void cboEmploymentCity_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    RadTextBox txtEmploymentCounty = frmEmployment.FindControl("txtEmploymentCounty") as RadTextBox;
    RadTextBox txtEmploymentState = frmEmployment.FindControl("txtEmploymentState") as RadTextBox;
    RadMaskedTextBox txtEmploymentZip = frmEmployment.FindControl("txtEmploymentZip") as RadMaskedTextBox;
    int addressId = 0;
    if (Int32.TryParse(e.Value, out addressId))
    {
        var addressInfo =
            (from z in db.ZipCodes where z.IDNumber == addressId select z).SingleOrDefault();
        txtEmploymentCounty.Text = addressInfo.COUNTY;
        txtEmploymentState.Text = addressInfo.State;
        txtEmploymentZip.Text = addressInfo.ZIPCODE1;
    }
    else
    {
        txtEmploymentCounty.Text = string.Empty;
        txtEmploymentState.Text = string.Empty;
        txtEmploymentZip.Text = string.Empty;
    }
}

The idea: the user selects a city from the RadComboBox, and in turn the State, Zip, and County RadTextBoxes are updated with data from the database.

The major frustration here is that it works fine when I dealing with a new record.  When I enter Edit mode on the FormView, and change the index of the RadComboBox, the whole FormView disappears from view, but seems to be stuck in Edit mode.

I've pulled the Ajax from the user control.  There is, however, a RadAjaxManager on the parent page which I use to allow the tab strip and the page views to update each other.

Any help is greatly appreciated!

Kevin F
Top achievements
Rank 1
 answered on 23 Jul 2013
2 answers
134 views
I have a hierarchal radgrid control that consists of a master table and 2 detail tables which sit on a web form.  The web form also has a text box on it that's used for querying the info you want shown in the grid.  Initially the radgrid is not visible, so all the user sees is the text box when the app is launched.  Upon data entry (same page is launched again through a response.redirect "Page name" in a button click event), the grid becomes visible and the data is loaded and bound to the grid through the NeedDataSource method. However when the page returns, the master table data is being shown correctly in the grid, but the row expander to get to the detail tables is not enabled which prevents the user from drilling down any further.  I've got events to assign the detail datasource when the row is expanded, so I know it works.  I've done test on the grid where I load the grid on the initial load based on some hard coded criteria and I'm able to drill down without having to set any other properties.  Why is it that I can't do this based on user submitted data in a click event?
Larry
Top achievements
Rank 1
 answered on 23 Jul 2013
7 answers
135 views
This is probably fairly simple, but I have a chart, attached, where the data fed into the chart for the number of feet (along the left) are not what's showing up on the chart itself.  In the case shown, number of feet are actually (4,8,12,16,20,24,28,32,35), but they show up as (4,7,10,13,16,19,22,25,28,31,34) in the bar chart.  Does anyone have any idea what might be happening here?  

Laurie
Top achievements
Rank 2
 answered on 23 Jul 2013
1 answer
61 views
Hi, what is the best scenario for achieving this sample from ext.net  in telerik framework:

For each sample, this package creates a new tab window:

Ext.net Examples tab windowed

This is the closest sample in Telerik:
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/add-remove-tabs/defaultcs.aspx

Does it exist some similar control or a closer aproach to it?


Thanks in advance.
Vessy
Telerik team
 answered on 23 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?