This is a migrated thread and some comments may be shown as answers.

Error when detail table expanded in master table in edit mode

2 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 25 Nov 2008, 04:42 PM

i wanted when the master record in edit mode and the detail table will auto expanded
i followed the example to check in prerender's grid item in edit and set to item.expanded = true 

 For Each item As GridDataItem In grdClaims.MasterTableView.Items
            If item.Edit Then
                        item.Expanded = True    <--- error "There was a problem extracting DataKeyValues from the DataSource. please ensure that DataKeyNames are specified correctly and all the fields specified exist in the datasource"

            End If
        Next

is there any problem to my code?

best regards

From LUI

Imports System.Data  
Imports System.Data.SqlClient  
Imports Telerik.WebControls  
Imports localhost  
 
 
Partial Class Pages_ClaimMain  
    Inherits System.Web.UI.Page  
 
    Private userID As String 
    Private isAdmin As Boolean 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Not Session("UserID"Is Nothing Then 
            userID = Session("UserID")  
            isAdmin = Session("IsAdmin")  
        Else 
            Response.Redirect("./default.aspx")  
        End If 
 
          
 
        If Not Page.IsPostBack Then 
            With MnuMain  
                If isAdmin Then 
 
                    .Items.FindItemByValue("Administration").Items.FindItemByValue("UserAdmin").Visible = True 
                    .Items.FindItemByValue("Administration").Visible = True 
                Else 
                    .Items.FindItemByValue("Administration").Items.FindItemByValue("UserAdmin").Visible = False 
                    .Items.FindItemByValue("Administration").Visible = False 
                End If 
 
                Dim panelItem As RadMenuItem = .Items.FindItemByValue("Reporting")  
                With panelItem.Items.FindItemByValue("AllClaims")  
                    .NavigateUrl = "./ClaimReport.aspx?ReportType=AllClaims&UserID=" & userID  
                    .Target = "_blank" 
                End With 
                With panelItem.Items.FindItemByValue("OpenClaims")  
                    .NavigateUrl = "./ClaimReport.aspx?ReportType=OpenClaims&UserID=" & userID  
                    .Target = "_blank" 
                End With 
                With panelItem.Items.FindItemByValue("ClaimantName")  
                    '.NavigateUrl = "./ClaimReport.aspx?ReportType=ClaimantName&UserID=" & userID  
                    .NavigateUrl = "javascript:showDialog('ClaimReport.aspx?ReportType=ClaimantName&UserID=" & userID & "', 'RadWin');" 
                    '.Target = "_blank"  
                End With 
                With panelItem.Items.FindItemByValue("ClaimProperty")  
                    '.NavigateUrl = "./ClaimReport.aspx?ReportType=ClaimProperty&UserID=" & userID  
                    .NavigateUrl = "javascript:showDialog('ClaimReport.aspx?ReportType=ClaimProperty&UserID=" & userID & "', 'RadWin');" 
                    '.Target = "_blank"  
                End With 
                With panelItem.Items.FindItemByValue("Insurer")  
                    '.NavigateUrl = "./ClaimReport.aspx?ReportType=Insurer&UserID=" & userID  
                    .NavigateUrl = "javascript:showDialog('ClaimReport.aspx?ReportType=Insurer&UserID=" & userID & "', 'RadWin');" 
                    '.Target = "_blank"  
                End With 
                With panelItem.Items.FindItemByValue("HighRisk")  
                    .NavigateUrl = "./ClaimReport.aspx?ReportType=HighRisk&UserID=" & userID  
                    .Target = "_blank" 
                End With 
                panelItem = .Items.FindItemByValue("Administration")  
                With panelItem.Items.FindItemByValue("UserAdmin")  
                    .NavigateUrl = "javascript:showDialog('ClaimUserAdmin.aspx?UserID=" & userID & "', 'RadWin');" 
                End With 
                With panelItem.Items.FindItemByValue("CompanyAdmin")  
                    .NavigateUrl = "javascript:showDialog('ClaimCompanyAdmin.aspx?UserID=" & userID & "', 'RadWin');" 
                End With 
            End With 
        End If 
    End Sub 
 
 
 
    Protected Sub grdClaims_ItemCommand(ByVal source As ObjectByVal e As Telerik.WebControls.GridCommandEventArgs) Handles grdClaims.ItemCommand  
        Dim claimWSObj As New ClaimWS  
 
        Dim claimID As String = "" 
        Dim commentID As String = "" 
        Dim msg As String = "" 
        Select Case e.CommandName  
            Case RadGrid.ExpandCollapseCommandName  
                For Each item As GridItem In e.Item.OwnerTableView.Items  
                    If item.Expanded And Not item Is e.Item Then 
                        item.Expanded = False 
                    End If 
                Next 
            Case RadGrid.DeleteCommandName  
                If e.Item.OwnerTableView.Name = "Claims" Then 
                    claimID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Claim_ID")  
                    If Not DeleteRecord(claimID) Then 
                        e.Canceled = True 
                    End If 
                ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
                    claimID = CType(e.Item, GridDataItem).GetDataKeyValue("Claim_ID")  
                    commentID = CType(e.Item, GridDataItem).GetDataKeyValue("Comment_ID")  
                    If Not claimWSObj.DeleteComment(userID, claimID, commentID, msg) Then 
                        e.Canceled = True 
                    End If 
                End If 
            Case RadGrid.PerformInsertCommandName  
            Case RadGrid.EditCommandName  
                If e.Item.OwnerTableView.Name = "Claims" Then 
                    claimWSObj.CreateLog(userID, "ACTION_RECORD", e.Item.OwnerTableView.Items(e.Item.ItemIndex).Item("Claim_ID").Text, "READ""")  
                    claimID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Claim_ID")  
                    ViewState("ClaimID") = claimID  
                    grdClaims.MasterTableView.IsItemInserted = False 
                    grdClaims.Rebind()  
 
                ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
                    grdClaims.MasterTableView.DetailTables(0).IsItemInserted = False 
                    grdClaims.MasterTableView.DetailTables(0).Rebind()  
                End If 
            Case RadGrid.InitInsertCommandName  
                If e.Item.OwnerTableView.Name = "Claims" Then 
                    grdClaims.MasterTableView.ClearEditItems()  
                    grdClaims.Rebind()  
                ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
                    grdClaims.MasterTableView.ClearChildEditItems()  
                    grdClaims.MasterTableView.DetailTables(0).Rebind()  
                End If 
            Case RadGrid.FilterCommandName  
                If e.Item.OwnerTableView.Name = "Claims" Then 
                      
                ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
 
                End If 
 
        End Select 
 
    End Sub 
 
 
      
 
    Protected Sub grdClaims_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.WebControls.GridItemEventArgs) Handles grdClaims.ItemDataBound  
 
    End Sub 
 
    Protected Sub grdClaims_ItemCreated(ByVal sender As ObjectByVal e As Telerik.WebControls.GridItemEventArgs) Handles grdClaims.ItemCreated  
        Dim claimWSObj As New ClaimWS  
        Dim cbo As RadComboBox  
        Dim grd As RadGrid  
        Dim btn As Button  
        Dim compareValid As CompareValidator  
        Dim txt As TextBox  
        Dim claimID As String 
 
        If e.Item.OwnerTableView.Name = "Claims" Then 
            If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then 
 
                If TypeOf e.Item Is GridEditFormInsertItem Then 
 
 
                    Dim insertedItem As GridEditableItem = e.Item.OwnerTableView.GetInsertItem  
                    If Not insertedItem Is Nothing Then 
 
 
                        compareValid = insertedItem.FindControl("cmpDateNotified")  
                        compareValid.ValueToCompare = DateTime.Now.ToString("yy-MM-dd")  
 
 
                        cbo = insertedItem.FindControl("cboCompanies")  
 
                          
                        cbo.DataSource = claimWSObj.GetCompanies(userID)  
                        cbo.DataTextField = "Company_Name" 
                        cbo.DataValueField = "Company_ID" 
 
 
                        cbo = insertedItem.FindControl("cboClaimTypes")  
 
                         
                        cbo.DataSource = claimWSObj.GetClaimTypes  
                        cbo.DataTextField = "Claim_Type" 
                        cbo.DataValueField = "Type_ID" 
 
                        cbo = insertedItem.FindControl("cboClaimStatus")  
 
                        cbo.DataSource = claimWSObj.GetClaimStatus  
                        cbo.DataTextField = "Claim_Status" 
                        cbo.DataValueField = "Status_ID" 
 
                        cbo = insertedItem.FindControl("cboInsurers")  
                          
                        cbo.DataSource = claimWSObj.GetInsurers  
                        cbo.DataTextField = "Insurer_Name" 
                        cbo.DataValueField = "Insurer_ID" 
 
                        btn = insertedItem.FindControl("cmdInsert")  
                        btn.Visible = True 
 
                        btn = insertedItem.FindControl("cmdUpdate")  
                        btn.Visible = False 
 
                         
                        grd = e.Item.FindControl("grdComments")  
                        grd.Visible = False 
                    End If 
                Else 
                    claimID = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Claim_ID")  
                    cbo = e.Item.FindControl("cboCompanies")  
                    cbo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Company_ID")  
                    cbo.DataSource = claimWSObj.GetCompanies(userID)  
                    cbo.DataTextField = "Company_Name" 
                    cbo.DataValueField = "Company_ID" 
 
                    cbo = e.Item.FindControl("cboClaimTypes")  
                    cbo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Type_ID")  
                    cbo.DataSource = claimWSObj.GetClaimTypes  
                    cbo.DataTextField = "Claim_Type" 
                    cbo.DataValueField = "Type_ID" 
                    cbo = e.Item.FindControl("cboClaimStatus")  
                    cbo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Status_ID")  
                    cbo.DataSource = claimWSObj.GetClaimStatus  
                    cbo.DataTextField = "Claim_Status" 
                    cbo.DataValueField = "Status_ID" 
                    cbo = e.Item.FindControl("cboInsurers")  
                    cbo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Insurer_ID")  
                    cbo.DataSource = claimWSObj.GetInsurers  
                    cbo.DataTextField = "Insurer_Name" 
                    cbo.DataValueField = "Insurer_ID" 
 
                    btn = e.Item.FindControl("cmdUpdate")  
                    btn.Visible = True 
                    btn = e.Item.FindControl("cmdInsert")  
                    btn.Visible = False 
                    compareValid = e.Item.FindControl("cmpDateNotified")  
                    compareValid.ValueToCompare = DateTime.Now.ToString("yy-MM-dd")  
                     
                End If 
            Else 
 
            End If 
        ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
            If TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode Then 
                If TypeOf e.Item Is GridEditFormInsertItem Then 
                    Dim insertedItem As GridEditableItem = e.Item.OwnerTableView.GetInsertItem  
                    If Not insertedItem Is Nothing Then 
                        btn = e.Item.FindControl("cmdUpdate")  
                        btn.Visible = False 
                        btn = e.Item.FindControl("cmdInsert")  
                        btn.Visible = True 
                    End If 
                Else 
                    btn = e.Item.FindControl("cmdUpdate")  
                    btn.Visible = True 
                    btn = e.Item.FindControl("cmdInsert")  
                    btn.Visible = False 
                End If 
            End If 
 
        End If 
 
    End Sub 
 
    Protected Sub grdClaims_UpdateCommand(ByVal source As ObjectByVal e As Telerik.WebControls.GridCommandEventArgs) Handles grdClaims.UpdateCommand  
        If e.Item.OwnerTableView.Name = "Claims" Then 
            Dim claimWSObj As New ClaimWS  
            Dim claimID As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("Claim_ID")  
            Dim msg As String 
            Dim editItem As GridEditableItem = e.Item  
            Dim companyID As String = CType(editItem.FindControl("cboCompanies"), RadComboBox).SelectedValue  
            Dim claimYear As Integer = CType(editItem.FindControl("txtYear"), RadMaskedTextBox).Text  
            Dim insurerRef As String = CType(editItem.FindControl("txtInsureRef"), TextBox).Text.Trim  
            Dim dateNotified As Date = CType(editItem.FindControl("dtpDateNotified"), RadDatePicker).SelectedDate  
            Dim claimantName As String = CType(editItem.FindControl("txtClaimantName"), TextBox).Text.Trim  
            Dim propertyName As String = CType(editItem.FindControl("txtProperty"), TextBox).Text.Trim  
            Dim claimType As String = CType(editItem.FindControl("cboClaimTypes"), RadComboBox).SelectedValue  
            Dim incidentDate As Date = CType(editItem.FindControl("dtpIncidentDate"), RadDatePicker).SelectedDate  
            Dim claimStatus As String = CType(editItem.FindControl("cboClaimStatus"), RadComboBox).SelectedValue  
            Dim value As Nullable(Of Double)  
            If CType(editItem.FindControl("nbrValue"), RadNumericTextBox).Text = "" Then 
                value = vbNull  
            Else 
                value = CType(editItem.FindControl("nbrValue"), RadNumericTextBox).Text  
            End If 
            Dim descOfclaim As String = CType(editItem.FindControl("txtDescOfClaim"), TextBox).Text  
            Dim comments As String = "" 'CType(editItem.FindControl("txtComments"), TextBox).Text  
            Dim insurerID As String = CType(editItem.FindControl("cboInsurers"), RadComboBox).SelectedValue  
            Dim savillsRef As String = CType(editItem.FindControl("txtSavillsRef"), TextBox).Text  
            If isValidInput(dateNotified, descOfclaim, comments, editItem, msg) Then 
                If Not claimWSObj.UpdateClaims(claimID, companyID, savillsRef, claimYear, insurerRef, dateNotified, claimantName, propertyName, claimType, incidentDate, claimStatus, value, descOfclaim, comments, insurerID, userID) Then 
                    lblMsg.Visible = True 
                    lblMsg.Text = "* Fail to insert claim" 
                    e.Canceled = True 
                Else 
                    lblMsg.Visible = False 
                End If 
            Else 
                lblMsg.Visible = True 
                lblMsg.Text = msg  
                e.Canceled = True 
            End If 
        ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
        End If 
    End Sub 
 
    Protected Sub grdClaims_InsertCommand(ByVal source As ObjectByVal e As Telerik.WebControls.GridCommandEventArgs) Handles grdClaims.InsertCommand  
 
        Dim claimWSObj As New ClaimWS  
        Dim claimID As String 
        Dim msg As String 
 
        Dim editItem As GridEditableItem = e.Item  
        If e.Item.OwnerTableView.Name = "Claims" Then 
            Dim companyID As String = CType(editItem.FindControl("cboCompanies"), RadComboBox).SelectedValue  
            Dim claimYear As Integer = CType(editItem.FindControl("txtYear"), RadMaskedTextBox).Text  
            Dim insurerRef As String = CType(editItem.FindControl("txtInsureRef"), TextBox).Text.Trim  
            Dim dateNotified As Date = CType(editItem.FindControl("dtpDateNotified"), RadDatePicker).SelectedDate  
            Dim claimantName As String = CType(editItem.FindControl("txtClaimantName"), TextBox).Text.Trim  
            Dim propertyName As String = CType(editItem.FindControl("txtProperty"), TextBox).Text.Trim  
            Dim claimType As String = CType(editItem.FindControl("cboClaimTypes"), RadComboBox).SelectedValue  
            Dim incidentDate As Date = CType(editItem.FindControl("dtpIncidentDate"), RadDatePicker).SelectedDate  
            Dim claimStatus As String = CType(editItem.FindControl("cboClaimStatus"), RadComboBox).SelectedValue  
            Dim value As Nullable(Of Double)  
            If CType(editItem.FindControl("nbrValue"), RadNumericTextBox).Text = "" Then 
                value = vbNull  
            Else 
                value = CType(editItem.FindControl("nbrValue"), RadNumericTextBox).Text  
            End If 
            Dim descOfClaim As String = CType(editItem.FindControl("txtDescOfClaim"), TextBox).Text  
            Dim comments As String = "" 'CType(editItem.FindControl("txtComments"), TextBox).Text  
            Dim insurerID As String = CType(editItem.FindControl("cboInsurers"), RadComboBox).SelectedValue  
            Dim savillsRef As String = CType(editItem.FindControl("txtSavillsRef"), TextBox).Text  
            If isValidInput(dateNotified, descOfClaim, comments, editItem, msg) Then 
                If Not claimWSObj.InsertClaims(companyID, savillsRef, claimYear, insurerRef, dateNotified, claimantName, propertyName, claimType, incidentDate, claimStatus, value, descOfClaim, comments, insurerID, userID) Then 
                    lblMsg.Visible = True 
                    lblMsg.Text = "* Fail to insert claim" 
                    e.Canceled = True 
                Else 
                    lblMsg.Visible = False 
                End If 
            Else 
                lblMsg.Visible = True 
                lblMsg.Text = msg  
                e.Canceled = True 
            End If 
            grdClaims.CurrentPageIndex = 0  
        ElseIf e.Item.OwnerTableView.Name = "Comments" Then 
            Dim txt As TextBox = editItem.FindControl("txtComment")  
            claimID = e.Item.OwnerTableView.ParentItem.GetDataKeyValue("Claim_ID")  
            If Not claimWSObj.InsertComment(userID, claimID, txt.Text, msg) Then 
                lblMsg.Visible = True 
                lblMsg.Text = "msg" 
                e.Canceled = True 
            Else 
                lblMsg.Visible = False 
            End If 
 
        End If 
    End Sub 
 
    Private Function isValidInput(ByVal dateNotified As DateByVal descOfClaim As StringByVal comments As StringByRef editItem As GridEditableItem, ByRef msg As StringAs Boolean 
        Dim cmpValid As CompareValidator  
        If dateNotified > Now Then 
            cmpValid = CType(editItem.FindControl("cmpDateNotified"), CompareValidator)  
            cmpValid.IsValid = False 
            Return False 
 
        ElseIf descOfClaim.Length > 255 Then 
            msg = "* The description of claim cannot excess 255 characters" 
            Return False 
        ElseIf comments.Length > 255 Then 
            msg = "* The comments cannot excess 255 characters" 
            Return False 
        End If 
 
        Return True 
    End Function 
 
      
    Private Function DeleteRecord(ByVal claimID As StringAs Boolean 
        Dim claimWSObj As New ClaimWS  
        If Not claimWSObj.DeleteClaims(claimID, userID) Then 
            Return False 
        Else 
            Return True 
        End If 
    End Function 
 
 
    Protected Sub grdClaims_NeedDataSource(ByVal source As ObjectByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles grdClaims.NeedDataSource  
        Dim claimWSObj As New ClaimWS  
        If Not Session("UserID"Is Nothing Then 
            userID = Session("UserID")  
            isAdmin = Session("IsAdmin")  
        Else 
            Response.Redirect("./default.aspx")  
        End If 
        grdClaims.DataSource = claimWSObj.GetClaims(userID).Tables(0)  
         
    End Sub 
      
     
    Protected Sub grdClaims_DetailTableDataBind(ByVal source As ObjectByVal e As Telerik.WebControls.GridDetailTableDataBindEventArgs) Handles grdClaims.DetailTableDataBind  
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)  
        Dim claimWSObj As New ClaimWS  
        grdClaims.DataSource = claimWSObj.GetComments(dataItem.GetDataKeyValue("Claim_ID"))  
 
    End Sub 
 
      
 
 
      
    Protected Sub grdClaims_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles grdClaims.PreRender  
 
        For Each item As GridDataItem In grdClaims.MasterTableView.Items  
            If item.Edit Then 
                '        item.Expanded = True  
 
            End If 
        Next 
        If Not isAdmin Then 
            For Each grdTableView As GridTableView In grdClaims.MasterTableView.DetailTables  
                grdTableView.GetColumn("DeleteCol").Display = False 
            Next 
            grdClaims.MasterTableView.GetColumn("DeleteCol").Display = False 
        End If 
          
    End Sub 
End Class 
 


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ClaimMain.aspx.vb" Inherits="Pages_ClaimMain" %> 
 
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
 
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
<%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
 
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
 
<%@ Register Assembly="RadMenu.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
<%@ Register Assembly="RadPanelbar.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title>PI Notification</title> 
      
    <link href="./../css/customize.css" type="text/css" rel="stylesheet"/>       
      
</head> 
<body> 
          
  <script type="text/javascript">     
    function OnClientClose(sender,args)     
    {     
        //alert('test');  
        window.location.reload();//- will reload the page (equal to pressing F5)     
        //windowwindow.location.href = window.location.href;// - will refresh the page by reloading the URL      
           
 
 
    }     
      
</script>    
<script language="javascript" type="text/javascript">  
    function showDialog(url, win){  
        //oWnd.setUrl(url);  
        var oWnd = window.radopen(url, win);  
          
          
    }  
</script> 
    <form id="form1" runat="server">  
    <div> 
        <table border="0" cellpadding="0" cellspacing="0" width="100%">  
            <tr> 
                <td style="vertical-align: top; width: 100%;">  
                    <table border="0" cellpadding="1" cellspacing="1">  
                        <tr> 
                            <td style="height: 65px"><img src="../Images/Common/Savill_Logo_Default.JPG" /></td>  
                            <td style="height: 65px;  width=100%; width: 72%;" >   
                                <span style="font-size: 14pt; vertical-align: top; text-align: left;">Professional   
                                Indemnity/Public Liability   
                                <br /> 
                                Notifications   
                                Register</span></td>  
                            <td style="width: 300px; height: 65px; text-align: right; vertical-align: bottom;">  
                                <rad:RadMenu ID="MnuMain" runat="server" style="top: 0px; left: 0px;" Skin="Default">  
                                    <Items> 
                                        <rad:RadMenuItem runat="server" Text="Reporting" Value="Reporting">  
                                            <Items> 
                                                <rad:RadMenuItem runat="server" Text="All Claims" Value="AllClaims">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Open Claims" Value="OpenClaims">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Search For Claimant" Value="ClaimantName">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Serach Claim Property" Value="ClaimProperty">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Print By Insurer" Value="Insurer">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Print Legal And High Risk" Value="HighRisk">  
                                                </rad:RadMenuItem> 
                                            </Items> 
                                        </rad:RadMenuItem> 
                                        <rad:RadMenuItem runat="server" Text="Administration" Value="Administration">  
                                            <Items> 
                                                <rad:RadMenuItem runat="server" Text="User Admin" Value="UserAdmin">  
                                                </rad:RadMenuItem> 
                                                <rad:RadMenuItem runat="server" Text="Company Admin" Value="CompanyAdmin">  
                                                </rad:RadMenuItem> 
                                            </Items> 
                                        </rad:RadMenuItem> 
                                    </Items> 
                                </rad:RadMenu> 
                                </td>      
                        </tr> 
                    </table> 
                    <hr /> 
                 </td> 
            </tr> 
            <tr> 
                <td style="vertical-align: top; text-align: left; height=100%; width: 100%; height: 546px;">  
                    <table border="0" cellpadding="0" cellspacing="0" height="100%">  
                        <tr> 
                              
                            <td style="width: 100%; vertical-align: top; height: 530px;">  
                                <asp:Label ID="lblMsg" runat="server" Font-Bold="True" ForeColor="Red" Text="lblMsg" 
                                    Visible="False" Width="536px"></asp:Label><rad:RadGrid ID="grdClaims" runat="server" AllowPaging="True" AllowSorting="True" 
                                    AutoGenerateColumns="False" GridLines="None" PageSize="20" 
                                    ShowFooter="True" Skin="WebBlue" AllowFilteringByColumn="True" ShowGroupPanel="True">  
                                                                          
                                      
                                    <MasterTableView AllowMultiColumnSorting="True" BorderColor="Silver"    
                                        BorderWidth="2px" CellPadding="0" CommandItemDisplay="Top" DataKeyNames="Claim_ID" GridLines="Both" ShowFooter="False" Name="Claims">  
                                        <EditFormSettings EditFormType="Template" > 
                                            <FormTemplate> 
                                                <table style="width:1000px; " border="0" cellpadding="1" cellspacing="1">  
                                                    <tr> 
                                                        <td style="width:400px">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Company</strong></td>  
                                                                    <td style="width:300px">  
                                                                        <rad:RadComboBox ID="cboCompanies" runat="server" 
                                                                            Skin="Vista" SkinsPath="~/RadControls/ComboBox/Skins" Width="300px" DataTextField="Company_Name" DataValueField="Company_ID"  AppendDataBoundItems="True">  
                                                                        </rad:RadComboBox> 
                                                                    </td> 
                                                                    <td></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        <td style="width:500px">  
                                                            <table> 
                                                                <tr> 
                                                                    <td colspan ="3">  
                                                                        <table> 
                                                                            <tr> 
                                                                                <td style="width: 80px">  
                                                                                    <strong>Year</strong></td>  
                                                                                <td style="text-align: left" > 
                                                                        <rad:RadMaskedTextBox ID="txtYear" runat="server" Width="40px" LabelCssClass="radLabelCss_Default" Mask="####" MaxLength="4" Skin="" Text='<%# DataBinder.Eval(Container, "DataItem.Year") %>' Font-Names="Arial">  
                                                                        </rad:RadMaskedTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtYear" 
                                                                            ErrorMessage="Year of notification is required" Display="Dynamic" Width="176px"></asp:RequiredFieldValidator></td>  
                                                                                <td style="width:80px;  text-align:right">Savills Ref</td> 
                                                                                <td style="width:auto">  
                                                                        <asp:TextBox ID="txtSavillsRef" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.FPDSavills_Ref") %>' Width="115px" MaxLength="20"></asp:TextBox></td>  
                                                                            </tr> 
                                                                        </table> 
                                                                    </td> 
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Insurer</strong></td>  
                                                                    <td style="width:300px">  
                                                                        <rad:RadComboBox ID="cboInsurers" runat="server" Skin="Vista" SkinsPath="~/RadControls/ComboBox/Skins" Width="300px" DataTextField="Insurer_Name" DataValueField="Insurer_ID">  
                                                                        </rad:RadComboBox> 
                                                                    </td> 
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        <td style="width:500px">  
                                                            <table> 
                                                                <tr> 
                                                                    <td style="width: 80px" > 
                                                                        Insurer Ref</td> 
                                                                    <td> 
                                                                        <asp:TextBox ID="txtInsureRef" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Insurer_Ref_No") %>' Width="250px" MaxLength="50"></asp:TextBox></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Claimant Name</strong></td>  
                                                                    <td style="width:300px">  
                                                                        <asp:TextBox ID="txtClaimantName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Claimant_Name") %>' Width="300px" MaxLength="50"></asp:TextBox> 
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtClaimantName" 
                                                                            ErrorMessage="* Required Claimant Name" Display="Dynamic" Width="300px"></asp:RequiredFieldValidator></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        <td style="width:500px">  
                                                            <table> 
                                                                <tr> 
                                                                    <td style="width:80px">  
                                                                        Claim Status</td> 
                                                                    <td style="width:auto">  
                                                                        <rad:RadComboBox ID="cboClaimStatus" runat="server" Skin="Vista" SkinsPath="~/RadControls/ComboBox/Skins" Width="250px" DataTextField="Claim_Status" DataValueField="Status_ID">  
                                                                        </rad:RadComboBox> 
                                                                    </td> 
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Claim Type</strong></td>  
                                                                    <td  style="width:300px">  
                                                                        <rad:RadComboBox ID="cboClaimTypes" runat="server" Skin="Vista" SkinsPath="~/RadControls/ComboBox/Skins" Width="300px" DataTextField="Claim_Type" DataValueField="Type_ID" > 
                                                                        </rad:RadComboBox> 
                                                                    </td> 
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        <td style="width:500px">  
                                                            <table> 
                                                                <tr> 
                                                                    <td style="width:80px">  
                                                                        Value</td> 
                                                                    <td style="width:auto">  
                                                                        <rad:RadNumericTextBox ID="nbrValue" runat="server" Width="100px" Culture="English (United States)" DbValue='<%# DataBinder.Eval(Container, "DataItem.Value") %>' LabelCssClass="radLabelCss_Default" Skin="" MinValue="0" MaxLength="12" style="text-align: right" Font-Names="Arial">  
                                                                            <NumberFormat AllowRounding="True" /> 
                                                                        </rad:RadNumericTextBox></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px" > 
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width:100px">  
                                                                        <strong>Property</strong></td>  
                                                                    <td  style="width:300px">  
                                                                        <asp:TextBox ID="txtProperty" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Property") %>' width="300px"  MaxLength="200"></asp:TextBox> 
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtProperty" 
                                                                            ErrorMessage="* Property Name is Required "  Display="Dynamic"></asp:RequiredFieldValidator></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        <td style="width:500px; vertical-align: text-top; text-align: left;" rowspan="3">  
                                                            Desc of claim<br /> 
                                                            <asp:TextBox ID="txtDescOfClaim" runat="server" Height="70px" MaxLength="220" Text='<%# DataBinder.Eval(Container, "DataItem.Description_of_Claim") %>' 
                                                                TextMode="MultiLine" Width="335px" Font-Names="Arial"></asp:TextBox> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Incident date</strong></td>  
                                                                    <td style="width:300px">  
                                                                        <rad:RadDatePicker ID="dtpIncidentDate" runat="server" Skin="Office2007" Width="300px" dbselecteddate='<%#DataBinder.Eval(Container, "DataItem.incident_Date") %>' Culture="English (United Kingdom)" EnableTyping="False">  
                                                                            <Calendar Skin="Office2007">  
                                                                            </Calendar> 
                                                                            <DateInput Skin="Office2007" ReadOnly="True">  
                                                                            </DateInput> 
                                                                        </rad:RadDatePicker> 
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="dtpIncidentDate" 
                                                                            ErrorMessage="* Incident date is required" Width="256px" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="dtpDateNotified" 
                                                                            ControlToValidate="dtpIncidentDate" ErrorMessage="Incident date must be before or equal to date notified" 
                                                                            Operator="LessThanEqual" Width="256px" Display="Dynamic"></asp:CompareValidator></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                          
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width:400px; height: 81px;">  
                                                            <table> 
                                                                <tr > 
                                                                    <td style="width: 100px">  
                                                                        <strong>Date notified</strong></td>  
                                                                    <td  style="width:300px; vertical-align=top">  
                                                                        <rad:RadDatePicker ID="dtpDateNotified" runat="server" Skin="Office2007" Width="300px" dbselecteddate='<%#DataBinder.Eval(Container, "DataItem.Date_Notified") %>' Culture="English (United Kingdom)" EnableTyping="False">  
                                                                            <Calendar Skin="Office2007">  
                                                                            </Calendar> 
                                                                            <DateInput Skin="Office2007" ReadOnly="True">  
                                                                            </DateInput> 
                                                                        </rad:RadDatePicker> 
                                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="dtpDateNotified" 
                                                                            ErrorMessage="* Date notified is required" Width="248px" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator ID="cmpDateNotified" runat="server" ControlToValidate="dtpDateNotified" 
                                                                            ErrorMessage="Date Notified must today or before" Operator="LessThanEqual" Width="248px"  Type="Date" Display="Dynamic"></asp:CompareValidator></td>  
                                                                </tr> 
                                                            </table> 
                                                        </td> 
                                                        
                                                    </tr> 
                                                    <tr> 
                                                        <td style="height: 18px" colspan="2">  
                                                            &nbsp;</td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td  colspan="2" style="vertical-align: top; text-align: left">  
                                                            </td>     
                                                    </tr> 
                                                </table> 
                                                    <asp:Button ID="cmdUpdate" runat="server" CommandName="Update" text"Update" Visible="False" OnClientClick="return confirm('Confirm update claim record?');"/>  
                                                    <asp:Button ID="cmdInsert" runat="server" CommandName="PerformInsert" Text="Insert" Visible="False" OnClientClick="return confirm('Confirm insert claim record?');" /> 
                                                    <asp:Button ID="cmdCancel" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="False" /> 
                                            </FormTemplate> 
                                            <EditColumn UniqueName="EditCommandColumn1">  
                                            </EditColumn> 
                                        </EditFormSettings> 
                                        <Columns> 
                                            <rad:GridEditCommandColumn> 
                                                <HeaderStyle Width="50px" /> 
                                                <ItemStyle HorizontalAlign="Center" /> 
                                            </rad:GridEditCommandColumn> 
                                            <rad:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteCol" ConfirmText="Are you sure you want to delete record?">  
                                                <HeaderStyle Width="50px" /> 
                                                <ItemStyle HorizontalAlign="Center" /> 
                                            </rad:GridButtonColumn> 
                                            <rad:GridBoundColumn AllowFiltering="False" DataField="Claim_ID" HeaderText="ID" 
                                                UniqueName="Claim_ID" AutoPostBackOnFilter="True">  
                                                <ItemStyle HorizontalAlign="Center" /> 
                                                <HeaderStyle Width="50px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Date_Notified" DataFormatString="{0:dd-MM-yy}"   
                                                DataType="System.DateTime" HeaderText="Notified" UniqueName="Date_Notified" AllowFiltering="False" > 
                                                <ItemStyle HorizontalAlign="Right" /> 
                                                <HeaderStyle Width="100px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Company_Name" HeaderText="Company" 
                                                UniqueName="Company_Name" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">  
                                                <HeaderStyle Width="180px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn AllowFiltering="False" DataField="Insurer_Ref" HeaderText="Insurer Ref" 
                                                UniqueName="Insurer_Ref">  
                                                <HeaderStyle Width="80px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Year" DataType="System.Int16"   
                                                HeaderText="Year" UniqueName="Year" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">  
                                                <ItemStyle HorizontalAlign="Center" /> 
                                                <HeaderStyle Width="120px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Property" HeaderText="Property" 
                                                UniqueName="Property" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">  
                                                <HeaderStyle Width="180px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn AllowFiltering="False" DataField="Incident_Date" DataFormatString="{0:dd-MM-yy}" 
                                                DataType="System.DateTime" HeaderText="Incident" UniqueName="Incident_Date">  
                                                <ItemStyle HorizontalAlign="Right" /> 
                                                <HeaderStyle Width="90px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn AllowFiltering="False" DataField="Claimant_Name" HeaderText="Claimant" 
                                                UniqueName="Claimant_Name">  
                                                <HeaderStyle Width="180px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Claim_Type" HeaderText="Claim Type" 
                                                UniqueName="Claim_Type" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">  
                                                <HeaderStyle Width="120px" /> 
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Claim_Status" HeaderText="Status" UniqueName="Claim_Status" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Company_ID" HeaderText="Company_ID" UniqueName="Company_ID" 
                                                Visible="False">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="FPDSavills_Ref" HeaderText="Savills_Ref" UniqueName="FPDSavills_Ref" 
                                                Visible="False">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status" Visible="False" AllowFiltering="False">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Value" HeaderText="Value" UniqueName="Value" Visible="False">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Description_of_claim" HeaderText="Desc of claim" 
                                                UniqueName="Description_of_claim" Visible="False">  
                                            </rad:GridBoundColumn> 
                                            <rad:GridBoundColumn DataField="Comments" HeaderText="Comments" UniqueName="Comments" 
                                                Visible="False">  
                                            </rad:GridBoundColumn> 
                                        </Columns> 
                                        <ExpandCollapseColumn Resizable="False">  
                                            <HeaderStyle Width="20px" /> 
                                        </ExpandCollapseColumn> 
                                        <RowIndicatorColumn Visible="False">  
                                            <HeaderStyle Width="20px" /> 
                                        </RowIndicatorColumn> 
                                        <DetailTables> 
                                            <rad:GridTableView runat="server" AllowFilteringByColumn="False" DataKeyNames="Claim_ID,Comment_ID" CommandItemDisplay="Top" GridLines="Both" Name="Comments">  
                                                <EditFormSettings EditFormType="Template">  
                                                    <EditColumn UniqueName="EditCommandColumn1">  
                                                    </EditColumn> 
                                                    <FormTemplate> 
                                                        Comment<br /> 
                                                        <asp:TextBox ID="txtComment" runat="server" Height="136px" TextMode="MultiLine" Width="464px" Text='<%# DataBinder.Eval(Container, "DataItem.CommentText") %>'></asp:TextBox> 
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtComment" 
                                                            ErrorMessage="RequiredFieldValidator" Width="448px">* Comment is required</asp:RequiredFieldValidator><br /> 
                                                        <asp:Button ID="cmdInsert" runat="server" CommandName="PerformInsert" Text="Insert" OnClientClick="return confirm('Confirm insert comment?');" /> 
                                                        <asp:Button ID="cmdUpdate" runat="server" CommandName="Update" Text="Update" OnClientClick="return confirm('Confirm update comment?');" /> 
                                                        <asp:Button ID="cmdCancel" runat="server" CommandName="Cancel" Text="Cancel" /> 
                                                    </FormTemplate> 
                                                </EditFormSettings> 
                                                <Columns> 
                                                    <rad:GridEditCommandColumn> 
                                                    </rad:GridEditCommandColumn> 
                                                    <rad:GridButtonColumn CommandName="Delete"  Text="Delete" 
                                                        UniqueName="DeleteCol">  
                                                    </rad:GridButtonColumn> 
                                                    <rad:GridBoundColumn DataField="Comment_ID" HeaderText="Comment ID" UniqueName="Comment_ID" Visible="False">  
                                                    </rad:GridBoundColumn> 
                                                    <rad:GridBoundColumn HeaderText="Comment" UniqueName="CommentText" DataField="CommentText"  > 
                                                        <HeaderStyle Width="250px" /> 
                                                    </rad:GridBoundColumn> 
                                                    <rad:GridBoundColumn DataField="Update_Date" DataType="System.DateTime" HeaderText="Last Update" 
                                                        UniqueName="Update_Date" DataFormatString="{0:dd-MM-yy}">  
                                                        <HeaderStyle Width="120px" /> 
                                                    </rad:GridBoundColumn> 
                                                    <rad:GridBoundColumn DataField="Update_User" HeaderText="Update By" UniqueName="Update_User">  
                                                        <HeaderStyle Width="120px" /> 
                                                    </rad:GridBoundColumn> 
                                                </Columns> 
                                                <ExpandCollapseColumn Resizable="False" Visible="False">  
                                                    <HeaderStyle Width="20px" /> 
                                                </ExpandCollapseColumn> 
                                                <RowIndicatorColumn Visible="False">  
                                                    <HeaderStyle Width="20px" /> 
                                                </RowIndicatorColumn> 
                                            </rad:GridTableView> 
                                        </DetailTables> 
                                    </MasterTableView> 
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <PagerStyle Mode="NextPrevAndNumeric" /> 
                                    <ClientSettings AllowDragToGroup="True">  
                                        <Resizing AllowColumnResize="True" /> 
                                    </ClientSettings> 
                                </rad:RadGrid> 
                            </td> 
                        </tr> 
                    </table> 
                      
                </td> 
            </tr> 
        </table> 
          
        <rad:RadWindowManager ID="winMain" runat="server" Skin="Vista"  > 
            <Windows> 
                <rad:RadWindow ID="RadWin" runat="server" Left="" NavigateUrl="" SkinsPath="~/RadControls/Window/Skins"   OnClientClose="OnClientClose" 
                    Title="" Top="" Height="600px" Modal="True" Width="800px" /> 
                  
            </Windows> 
        </rad:RadWindowManager> 
        &nbsp;  
      
    </div> 
    </form> 
</body> 
</html> 
 

2 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 27 Nov 2008, 01:53 PM
Hello CH,

Attached to this message, is a small project sample, which handles a similar task.
I hope this helps.

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ian
Top achievements
Rank 1
answered on 28 Jun 2012, 05:51 PM
Disregard
Tags
Grid
Asked by
CH
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Ian
Top achievements
Rank 1
Share this question
or