Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
Hi,

I was wondering if anyone could help with my issue. 

I have a custom control that contains a RadContextMenu. This control is in the itemTemplate of a RadListView. Whenever there is more than one result IE crashes and closes the browser. This happens on IE6, IE7, IE8 and IE9. I have narrowed it down to the ContextMenu (with the menu's visible property set to false everything works).It works perfectly on Chrome, FF, Safari.

I use the same control multiple times on other pages. This is done through a repeater, not the list view.

Any help would be appreciated.

Thanks,

Daniel
Peter
Telerik team
 answered on 07 Mar 2012
3 answers
520 views

I have a hierarchal grid with check boxes against all the records (both parent and child), I also have a select all option which selects all the records in parent as well child. I am unable find the inner grid using FindControl method. Do let me know if you have any suggestion.

 

protected void ToggleSelectedState(object sender, EventArgs e)
        {
             
           if ((sender as CheckBox).Checked)
            {
                foreach (GridDataItem dataItem in radGridProgramList.MasterTableView.Items)
                {                   
                    (dataItem.FindControl("cbSelect") as CheckBox).Checked = true;
                    dataItem.Selected = true;
                    RadGrid radGridPolicyList = (RadGrid)dataItem.FindControl("radGridPolicyList");
                    foreach (GridDataItem InnerdataItem in radGridPolicyList.MasterTableView.Items)
                    {
                        (InnerdataItem.FindControl("cbSelect") as CheckBox).Checked = true;
                        InnerdataItem.Selected = true;
                    }                
                      
                }
                  
            }
            else
            {
                foreach (GridDataItem dataItem in radGridProgramList.MasterTableView.Items)
                {
                    (dataItem.FindControl("cbSelect") as CheckBox).Checked = false;
                    dataItem.Selected = false;
                }
            
        }
<telerik:RadGrid ID="radGridProgramList" AllowMultiRowSelection="true" runat="server" Width="100%" Height="476px" ShowStatusBar="true" AutoGenerateColumns="False" 
      PageSize="15" AllowSorting="True" AllowPaging="True" OnItemCommand="RadGrid_ItemCommand"
      OnNeedDataSource="RadGrid_NeedDataSource" OnPreRender="RadGridClientList_PreRender" GridLines="Vertical">
           <ClientSettings AllowExpandCollapse = "true"  EnableRowHoverStyle="true">
               <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />
               <Selecting AllowRowSelect="false" />                
           </ClientSettings>
           <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView ClientDataKeyNames="ProgramId" Name="Programs" Width="100%" GridLines="Vertical" NoMasterRecordsText="" ShowHeadersWhenNoRecords="false">
               <Columns>
               <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                           <HeaderTemplate>
                            <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                           </HeaderTemplate>
                           <ItemTemplate>
                               <asp:CheckBox id="cbSelect" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>
                  <telerik:GridBoundColumn SortExpression="ProgramId" HeaderText="Program ID" DataField="ProgramId" UniqueName="ProgramId" Visible="false" />
                                   <telerik:GridTemplateColumn UniqueName="ProgramName" HeaderText="Program Name" DataField="ProgramName" HeaderStyle-Width="280px">
                                       <ItemTemplate>
                                           <asp:Label ID="lblProgramName" runat="server" Text='<%#(Eval("ProgramName").ToString().Length >39)?Eval("ProgramName").ToString().Substring(0, 39) + "...":Eval("ProgramName") %>' />
                                           <telerik:RadToolTip ID="ProgramNameToolTip" runat="server" TargetControlID="lblProgramName" Width="150px"
                                           RelativeTo="Element" Position="MiddleRight" EnableShadow="true"><%# Eval("ProgramName") %></telerik:RadToolTip>
                                       </ItemTemplate>
                                   </telerik:GridTemplateColumn>
                                   <telerik:GridBoundColumn SortExpression="ProgramEffectiveDate" AllowSorting = "false" HeaderText="Eff. Date" DataField="ProgramEffDate" DataFormatString="{0:MM/dd/yyyy}" />
                                   <telerik:GridBoundColumn SortExpression="ProgramExpiryDate" AllowSorting = "false" HeaderText="Exp. Date" DataField="ProgramExpDate" DataFormatString="{0:MM/dd/yyyy}" />
                                   <telerik:GridBoundColumn SortExpression="FSGOfficeName" AllowSorting = "false"  HeaderText="FSG Office" DataField="FSGOfficeName" />
                                   <telerik:GridBoundColumn SortExpression="FSGProgramTeamName" AllowSorting = "false" HeaderText="FSG Team" DataField="FSGTeamName" />
                                   <telerik:GridTemplateColumn Reorderable="false" Resizable="false">
                                       <HeaderStyle Width="20px" />
                                       <ItemStyle Width="20px" HorizontalAlign="Center" />                                        
                                   </telerik:GridTemplateColumn>
               </Columns>
               <NestedViewTemplate>
                   <div class="programBackground">
                       <telerik:RadGrid ID="radGridPolicyList" AllowMultiRowSelection="true" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid_NeedDataSource" OnItemCommand="RadGrid_ItemCommand">
                       <ClientSettings AllowExpandCollapse = "true"  EnableRowHoverStyle="true">
                           <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />
                           <Selecting AllowRowSelect="false" />                
                       </ClientSettings>
                           <MasterTableView ClientDataKeyNames="PolicyId" Name="Policies" Width="100%" GridLines="Vertical" NoMasterRecordsText="" ShowHeadersWhenNoRecords="false">                                    
                                               <Columns>
                                               <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">                                                
                                               <ItemTemplate>
                                               <asp:CheckBox id="cbSelect" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox>
                                               </ItemTemplate>
                                                   </telerik:GridTemplateColumn>
                                                   <telerik:GridBoundColumn SortExpression="PolicyId" HeaderText="PolicyId" DataField="PolicyId" UniqueName="PolicyId" Visible="false" />
                                                   <telerik:GridBoundColumn SortExpression="PolicyNumber" HeaderText="Policy Number" DataField="PolicyNumber" />
                                                   <telerik:GridBoundColumn SortExpression="PolicyEffectiveDate" HeaderText="Policy Eff. Date" DataField="PolicyEffectiveDate" />
                                                   <telerik:GridBoundColumn SortExpression="PolicyExpiryDate" HeaderText="Policy Exp. Date" DataField="PolicyExpiryDate" />
                                                   <telerik:GridTemplateColumn Reorderable="false" Resizable="false">
                                                       <HeaderStyle Width="20px" />
                                                       <ItemStyle Width="20px" HorizontalAlign="Center" />                                                        
                                                   </telerik:GridTemplateColumn>
                                               </Columns>                               
                               <NoRecordsTemplate>The Program doesn't have Policies</NoRecordsTemplate>
                           </MasterTableView>
                           <ClientSettings AllowKeyboardNavigation = "true" >
                   <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                   <Selecting AllowRowSelect="True"></Selecting>                
                 </ClientSettings>
                       </telerik:RadGrid>
                   </div>
               </NestedViewTemplate>
               <NoRecordsTemplate>There are no clients</NoRecordsTemplate>
           </MasterTableView>
           <ClientSettings AllowKeyboardNavigation = "true" >
                   <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                   <Selecting AllowRowSelect="True"></Selecting>                
                 </ClientSettings>
       </telerik:RadGrid>

Shinu
Top achievements
Rank 2
 answered on 07 Mar 2012
9 answers
319 views
I'm having problems addressing my fileupload.
My structure looks like this:

<telerik:RadGrid ID="RadGrid1" runat="server">
    <MasterTableView>
        <NestedViewTemplate>
            <asp:Panel ID="Panel1" runat="server">
                <telerik:RadTabStrip ID="RadTabStrip1" runat="server">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="RadTab1" PageViewID="RadPageView1"></telerik:RadTab>
                        <telerik:RadTab runat="server" Text="RadTab2" PageViewID="RadPageView2"></telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                  
                <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
                    <telerik:RadPageView ID="RadPageView1" runat="server">
                    </telerik:RadPageView>
                      
                    <telerik:RadPageView ID="RadPageView2" runat="server">
                        <asp:Label ID="Label13" runat="server" 
                                       Text='<%# Eval("LokationID") %>'
                                       Visible="false"  />
                              
                        <asp:FormView ID="FormView1" runat="server" 
                                      DataSourceID="sdsFile" DataKeyNames="FileID" 
                                      DefaultMode="Insert" 
                                      oniteminserting="FormView1_ItemInserting">
                            <InsertItemTemplate>
                                <table>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server"
                                                File: (max 1,5GB) 
                                            </asp:Label>
                                        </td>
                                        <td>
                                            <asp:FileUpload ID="FileUpload1" runat="server" 
                                                            Enabled='<%# Bind("FileDocument") %>' />
                                        </td>
                                    </tr>
                                      
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label2" runat="server"
                                                Remarks: 
                                            </asp:Label>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="RadTextBox1" runat="server" 
                                                                Text='<%# Bind("FileRemarks") %>' 
                                                                TextMode="MultiLine">
                                            </telerik:RadTextBox>
                                        </td>
                                    </tr>
                                      
                                    <tr>
                                        <td colspan="2">
                                            <asp:ImageButton ID="ibtnInsert" runat="server" CommandName="Insert" />                          
                                            <asp:ImageButton ID="ibtnAbort" runat="server" onclick="ibtnAbort_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </InsertItemTemplate>
                        </asp:FormView>
                          
                        <asp:SqlDataSource ID="sdsFile" runat="server" 
                                               ConnectionString="<%$ ConnectionStrings:AppendoConnStr03 %>" 
                                               SelectCommand="SELECT FileID, LokationID, FileDocument, FileName, FileExtension, FileMIMEType, FileRemarks FROM Files"
                                               InsertCommand="INSERT INTO Files(LokationID, FileDocument, FileName, FileExtension, FileMIMEType, FileRemarks) VALUES (@LokationID, @FileDocument, @FileName, @FileExtension, @FileMIMEType, @FileRemarks)">
                                <InsertParameters>
                                    <asp:ControlParameter ControlID="Label13" PropertyName="Text" Type="Int32" Name="LokationID" />
                                    <asp:Parameter Name="FileDocument" />
                                    <asp:Parameter Name="FileName" />
                                    <asp:Parameter Name="FileExtension" />
                                    <asp:Parameter Name="FileMIMEType" />
                                    <asp:Parameter Name="FileRemarks" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                    </telerik:RadPageView>                       
                </telerik:RadMultiPage>
            </asp:Panel>
        </NestedViewTemplate>
    </MasterTableView>    
</telerik:RadGrid>

When I use FileUploads in Formviews outside grids and nestedviews, I use this code:
(which works fine btw :-)

protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
{
    FileUpload fileUpload = (FileUpload)FormView1.FindControl("FileUpload1");
  
    if (fileUpload.HasFile)
    {
        e.Values["FileName"] = fileUpload.FileName;
        e.Values["FileExtension"] = Path.GetExtension(fileUpload.PostedFile.FileName).ToLower();
        e.Values["FileMIMEType"] = fileUpload.PostedFile.ContentType;
        e.Values["FileDocument"] = fileUpload.FileBytes;
    }
    else
    {
        e.Values["FileName"] = null;
        e.Values["FileExtension"] = null;
        e.Values["FileMIMEType"] = null;
        e.Values["FileDocument"] = System.Data.SqlTypes.SqlBinary.Null;
    }
}

But inside the nestedview, it seems like I'm not able to address the correct formview - no matter what I try, I always ends up with no file found in the fileupload and null-values in the DB.

NB. The values from Label3 and RadTextBox1 are stored just fine in the DB.

Any helps would be appriciated :-)

Regards
/Berit
Casey
Top achievements
Rank 1
 answered on 07 Mar 2012
2 answers
181 views
<link href="../_UpgradeReport_Files/Menu.Default.css" rel="Stylesheet" type="text/css" />
 <link href="../_UpgradeReport_Files/Menustyle.css" rel="Stylesheet"  type="text/css" />
 <style type="text/css">
 .CustomItem
   {
        
     background:#FFA07A;
   
     text-decoration:none;
   }
   .CustomItem:hover
   {
        
      background:#FFA07A;
      text-decoration:none;
      
   }
     .style1
     {
         height: 114px;
     }
 </style>
 <style type="text/css">
    .WrappingItem1
    {
     background-color:#ffffff;
     color:#ffffff  !important;
     width:1px;
     height:1px;
     }
.WrappingItem
        {
            background-color:#4682B4;
            color: #ffffff;
            text-align:left;
            /*margin:0px;*/
            /*padding-right :100px;
            padding-left:150px;
              /* white-space: normal;*/
       }
       
        .WrappingItem:hover
        {
        border:#811D06;
        color:#000000  !important;
        background-color:#EFCDA9 !important;--%>
        }
        .WrappingItem.horizontal .separator
        {
       width:0px;
        height:0px;
        }
       .RedItem
        {
           background-color: #FF9900 !important;
            color: #ffffff;
        }
         .RedItem:hover
        {
            background-color: #FF9900 !important;
            color: #ffffff;
        }
</style>
  
  
  
<telerik:RadMenu ID="radMenuHMO" runat="server" Width="100%" Height="25px" CssClass="RadMenu_Green" Skin="Outlook" Flow="Horizontal">
          <Items>
           
                  <telerik:RadMenuItem  Text="Master" AccessKey="M"  ExpandedCssClass="RadMenu_Green">
                    <Items>
                        <telerik:RadMenuItem Text="Currency Master"  NavigateUrl="~/CMS/CurrencyMaster.aspx"  CssClass="WrappingItem1" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                         <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                       
                  </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 
                <telerik:RadMenuItem  Text="Insurance" AccessKey="I" Width="6%" ExpandedCssClass="RadMenu_Green">
                    <Items>
                        <telerik:RadMenuItem Text="ICD Codes" NavigateUrl="~/CMS/ICDCodesMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                      
                        <telerik:RadMenuItem   Text="Relation" NavigateUrl="~/CMS/RelationMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                        </Items>
                     </telerik:RadMenuItem>
                      <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                  <%-- ************************ Hospital Menu*************************--%>
                      <telerik:RadMenuItem  Text="Benefit Provider" AccessKey="B" Width="9%" style="text-align:center" ExpandedCssClass="RadMenu_Green">
                        <Items>
                            <telerik:RadMenuItem  Text="Hospital Master" NavigateUrl="~/CMS/HospitalMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                                 <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />                  
                            <telerik:RadMenuItem Text="Hospital Contract" NavigateUrl="~/CMS/HospitalContractsMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">  </telerik:RadMenuItem>
                       </Items>
                    </telerik:RadMenuItem>
                     <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                      <%-- ************************ Policy Menu*************************--%>
                <telerik:RadMenuItem  Text="Policy Admin" AccessKey="P" width="8%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items>
                        <telerik:RadMenuItem Text="Group Master" NavigateUrl="~/CMS/GroupDetailsMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        
                       </Items>
                    </telerik:RadMenuItem>
                     <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                     
                    <telerik:RadMenuItem  AccessKey="A" Text="Approval" Width="5.5%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Approval Request" NavigateUrl="~/CMS/ApprovalRequestMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                         <telerik:RadMenuItem  runat="server" Text="Approval Status Report" NavigateUrl="~/Reports/ApprovalRequestStatus.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                   </Items>
                </telerik:RadMenuItem>
                  <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 
                 <telerik:RadMenuItem  AccessKey="U" Text="Customer              Service"  Width="9.5%" style="text-align:center" ExpandedCssClass="RadMenu_Green">
                    <Items>    
                            <telerik:RadMenuItem runat="server" Text="Member System Info" NavigateUrl="~/CMS/MemberSystemInfoApproval.aspx"  CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 
                <telerik:RadMenuItem  AccessKey="C" Text="Claims" Width="5%" style="text-align:left" ExpandedCssClass="RadMenu_Green">
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Claim Batch" NavigateUrl="~/CMS/ClaimsBatch.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"></telerik:RadMenuItem>
                     <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        <telerik:RadMenuItem runat="server" Text="Claims Status Report" NavigateUrl="~/Reports/ClaimsStatusReport.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">  </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>  
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 <%-- ************************ Rate Module *************************--%>
                 <telerik:RadMenuItem  AccessKey="U" Text="Rate Module" Width="6.5%"  style="text-align:center" ExpandedCssClass="RadMenu_Green">
                    <Items>    
                            <telerik:RadMenuItem runat="server" Text="Tarrif Module" NavigateUrl="~/CMS/QuotationsReport.aspx"  CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                             <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                             <telerik:RadMenuItem runat="server" Text="Rating Report" NavigateUrl="~/Reports/Rating.aspx"  CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                  </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 <%-- ************************ Application *************************--%>
                 <telerik:RadMenuItem  AccessKey="U" Text="Application" Width="6%" style="text-align:center" ExpandedCssClass="RadMenu_Green">
                    <Items>    
                            <telerik:RadMenuItem runat="server" Text="Application Form Details" NavigateUrl="~/CMS/ApplicationFormDetails.aspx"  CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                             <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                             <telerik:RadMenuItem runat="server" Text="Application Decision" NavigateUrl="~/CMS/ApplicationStatus.aspx"  CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff"> </telerik:RadMenuItem>
                  </Items>
                </telerik:RadMenuItem
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                  
                       <telerik:RadMenuItem runat="server" AccessKey="R" Text="ReInsurance" Width="6%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="ReInsurance Master" NavigateUrl="~/RCMS/ReInsuranceMaster.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff" >
                        </telerik:RadMenuItem> <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        
                    </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 
                   <telerik:RadMenuItem runat="server" AccessKey="R" Text="Reports" Width="5%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Computation of Premium" NavigateUrl="~/Reports/PremiumComputation.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff" >
                        </telerik:RadMenuItem> <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        
                    </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                 
                  <telerik:RadMenuItem runat="server" AccessKey="T" Text="SAMA Reports" Width="6%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items
                     <telerik:RadMenuItem runat="server" Text="Policy Data Report" NavigateUrl="~/Reports/PolicyData.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">
                        </telerik:RadMenuItem> <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        
                    </Items>
                </telerik:RadMenuItem
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                  <%-- ************************ CCHI Reports Menu*************************--%> 
                <telerik:RadMenuItem runat="server" AccessKey="C" Text="Compliance Reports" Width="7%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                   <Items
                     <telerik:RadMenuItem runat="server" Text="CCHI Members Upload Report" NavigateUrl="~/Reports/CCHIMembersUpload.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">
                        </telerik:RadMenuItem>
                         <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        <telerik:RadMenuItem runat="server" Text="CCHI Policy Report" NavigateUrl="~/Reports/CCHIReport.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">
                        </telerik:RadMenuItem
                        <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        <telerik:RadMenuItem runat="server" Text="CCHI Beneficary Report" NavigateUrl="~/Reports/NewCCHIBeneficaryReport.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">
                        </telerik:RadMenuItem>
                   </Items>
                </telerik:RadMenuItem>
                 <telerik:RadMenuItem runat="server" IsSeparator="True" Text="|" />
                  <%-- ************************ Downloads Menu*************************--%> 
                <telerik:RadMenuItem runat="server" AccessKey="D" Text="Downloads" Width="5%" style="text-align:center" ExpandedCssClass="RadMenu_Green" >
                    <Items
                     <telerik:RadMenuItem runat="server" Text="Import Templates" NavigateUrl="~/CMS/DataImportTemplates.aspx" CssClass="WrappingItem" BackColor="#4682B4"  ForeColor="#ffffff">
                        </telerik:RadMenuItem
                        <telerik:RadMenuItem runat="server" CssClass="WrappingItem1" IsSeparator="True" />
                        
                    </Items>
                  </telerik:RadMenuItem>
                </Items>
             </telerik:RadMenu>

Hello EveryBody,
            
                        in my Project i used Rad menu control. i have so many menus. when I put all menus if the name is Lengthy it is overlapping with the next one . can you Please help me how to solve this problem.


thanks in advance.

Shinu
Top achievements
Rank 2
 answered on 07 Mar 2012
3 answers
840 views
this is my scenario

The user can checkBox or select Row..
This grid allow select mutiple rows.

I need:
When user selected row--> check the checkBox
When user unselected row --> uncheck the checbox.

I try with:
itemCommand --> rowClick, but when I press Shif+click for select multiple rows, does not work.
SelectIndexChange --> idem.
js onRowSelected --> I couldn't find chk for check or not...

this is my code.


ASPX

    <%@ Page Title="" Language="C#" MasterPageFile="~/UI/Doculex.Master" AutoEventWireup="true"
    CodeBehind="DocumentsList.aspx.cs" Inherits="WebSearch.UI.DocumentsList" %>

<%@ MasterType VirtualPath="~/UI/Doculex.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript" language="javascript">

            function OnRowSelected(sender, args) {
               
                var grid = $find("<%=DocumentGrid.ClientID %>");
                var MasterTable = grid.get_masterTableView();
                var selectedRows = MasterTable.get_selectedItems();
                

                for (var i = 0; i < selectedRows.length; i++) {
                    var row = selectedRows[i];
                   
                    
                }
            }


            function onColumnHidden(sender, args) {
                sender.get_masterTableView().get_element().style.tableLayout = "auto";
                sender.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
                window.setTimeout(function () {
                    sender.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
                    sender.get_masterTableView().get_element().style.tableLayout = "fixed";
                }, 1)
            }


            function spellCheck() {
                var radTextBox1 = document.getElementById("<%= txtComents.ClientID %>").value;
                if (radTextBox1 == "" || radTextBox1.split(' ').length < 3) {
                    return;
                } else {
                    var spell = $find('<%= RadSpell1.ClientID %>');
                    spell.startSpellCheck();
                }

            }

            function checkFinished(sender, args) {
                var radTextBox1 = document.getElementById("<%= txtComents.ClientID %>").value;
                if (radTextBox1 == "" || radTextBox1.split(' ').length < 3) {
                    return;
                } else {
                    args.suppressCompleteMessage = true;
                }

            }

            function closeSpell(sender, args) {
                var radTextBox1 = document.getElementById("<%= txtComents.ClientID %>").value;
               

                if (radTextBox1 == "" || radTextBox1.split(' ').length < 3) {
                    return;
                } else {


                    document.getElementById("<%= imgSave.ClientID %>").click();


                   
                }
            }
          
      

        </script>
    </telerik:RadCodeBlock>
     <link href="Style/Master/Document.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="DocumentGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DocumentGrid" />
                    <telerik:AjaxUpdatedControl ControlID="RibbonBarMenu" />
                </UpdatedControls>
            </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="imgSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="NotesRepeater" />
                   
                </UpdatedControls>
            </telerik:AjaxSetting>

            
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <div id="containerSub" runat="server">
     

        <telerik:RadSplitter ID="Splitter" Width="100%" Height="100%" Orientation="Vertical"
            runat="server">
            <telerik:RadPane runat="server" ID="gridPane" Scrolling="None" Height="80%" Width="100%">
                <input type="hidden" id="nodeValueHiddenField" name="nodeValueHiddenField" runat="server" />
                <telerik:RadGrid ID="DocumentGrid" Skin="Vista" AutoGenerateColumns="false" ShowHeader="true"
                    Width="100%" AllowSorting="true" runat="server" AllowMultiRowSelection="true"
                    AllowPaging="true" OnItemCreated="DocumentGrid_ItemCreated" OnNeedDataSource="DocumentGrid_NeedDataSource"
                    OnItemCommand="DocumentGrid_ItemCommand" OnRowDrop="DocumentGrid_RowDrop">
                    <MasterTableView ClientDataKeyNames="Id" TableLayout="Auto" GridLines="None">
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                <HeaderTemplate>
                                    <asp:CheckBox ID="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True"
                                        runat="server"></asp:CheckBox>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkSelectRow" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True"
                                        runat="server"></asp:CheckBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings EnablePostBackOnRowClick="true" AllowRowsDragDrop="true" >
                        <ClientEvents OnColumnHidden="onColumnHidden" OnRowDropping="onRowDropping" OnRowSelected="OnRowSelected"   />  
                        <Selecting AllowRowSelect="true"  EnableDragToSelectRows="false"/>
                    </ClientSettings>
                    <PagerStyle Position="Bottom" Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
                </telerik:RadGrid>
            </telerik:RadPane>
            <telerik:RadPane ID="searchPane" Width="20px"  style="right:0; top:0" runat="server" Scrolling="None" Height="350px">
                <telerik:RadSlidingZone runat="server" ID="PaneZone" SlideDirection="Left">
                    <telerik:RadSlidingPane ID="DocPreview" runat="server" Width="300px" OnClientDocked="PaneDockDocPreview"
                        OnClientUndocked="PaneUnDockDocPreview">
                        <div id="preview" runat="server">
                        </div>
                    </telerik:RadSlidingPane>
                    <telerik:RadSlidingPane ID="Properties" runat="server" Width="300px" OnClientDocked="PaneDockProperties"
                        OnClientUndocked="PaneUnDockProperties" IconUrl="~/UI/Images/properties.png">
                        <div id="PropertyList" style="margin-top: 5%" runat="server" visible="true">
                        </div>
                    </telerik:RadSlidingPane>
                    <telerik:RadSlidingPane Scrolling="Y" ID="FileNotesPane" runat="server" Width="300px"
                        OnClientDocked="PaneDockNotes" OnClientUndocked="PaneUnDockNotes" IconUrl="~/UI/Images/note.png"
                        Visible="false">
                       
                        <div style="margin-top: 5%; width: 100%" runat="server">
                            <asp:LinkButton ID="lnkAddComment" class="AddComment" runat="server" OnClick="lnkAddComment_Click">
                                <asp:ImageButton ID="imgAdd" runat="server" ImageUrl="~/UI/Images/add.png" />
                                <asp:Label ID="lblAddComment" runat="server" /></asp:LinkButton>&nbsp;&nbsp;
                        </div>
                        <div class="clear">
                        </div>
                        <asp:Panel ID="pnlComment"  runat="server">
                            <table style="width: 100%">
                                <tr>
                                    <td>
                                        <asp:Label ID="lblComent" runat="server"></asp:Label>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:TextBox TextMode="MultiLine" CssClass="commentsWithScroll" Wrap="true" ID="txtComents"
                                            runat="server" onblur="javascript: spellCheck();"></asp:TextBox>
                                        <telerik:RadSpell ID="RadSpell1" runat="server" DictionaryPath="~/App_Data/RadSpell"
                                            ControlToCheck="txtComents" ButtonType="None" OnClientCheckFinished="checkFinished"
                                            OnClientDialogClosed="closeSpell" HandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
                                            SpellCheckProvider="PhoneticProvider" />
                                        <asp:RequiredFieldValidator ID="rfvComment" runat="server" ControlToValidate="txtComents"
                                            Display="Dynamic" ErrorMessage="*" CssClass="validator" />
                                        <asp:RegularExpressionValidator ID="rExpComments" runat="server" ControlToValidate="txtComents"
                                            CssClass="validator" Display="Dynamic" ValidationExpression="^([\S\s]{1,280})$"></asp:RegularExpressionValidator>
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="imgSave" runat="server" ImageUrl="~/UI/Images/add.png" OnClick="imgSave_Click" />
                                        <asp:ImageButton ID="imgCancel" runat="server" ImageUrl="~/UI/Images/cancel.png"
                                            OnClick="imgCancel_Click" />
                                    </td>
                                </tr>
                            </table>
                            <div class="clear">
                            </div>
                        </asp:Panel>
                        <asp:Repeater ID="NotesRepeater" runat="server">
                            <ItemTemplate>
                                <div class="note">
                                    <div class="dateNote">
                                        <%# Eval("Date") %>
                                    </div>
                                    <div class="ownerNote">
                                        <%# Eval("OwnerComment")%>
                                        </h3>
                                        <div class="commentNote">
                                            <%# Eval("Comments")%>
                                        </div>
                                    </div>
                                    <div class="clear">
                                    </div>
                            </ItemTemplate>
                        </asp:Repeater>
                       
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    <%-- <div class="headerPage">
        <asp:Label ID="lblTitle" runat="server"></asp:Label>
    </div>--%>
</asp:Content>




My ASPX:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Resources;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using WebSearch.Components;
using WebSearch.SecurityModel;
using WebSearch.UI.Model.Display;
using WebSearch.UI.Model.Items.Grid;

namespace WebSearch.UI
{
    public partial class DocumentsList : Page
    {
        #region Properties

        private readonly List<string> _hideColum = new List<string>();
        private readonly smOrganization _organization = new smOrganization();
        private string _culture;
        private ResourceManager _resources;

        #endregion

        #region Events

        #region Page

        private void HeaderContextMenu_ItemCreated(object sender, RadMenuEventArgs e)
        {
            CommonFunctions.HideColumns(sender, e);
            CommonFunctions.HideSpecialColumns("Select", e.Item);
            CommonFunctions.HideSpecialColumns("Id", e.Item);
            CommonFunctions.HideSpecialColumns("Path", e.Item);
            CommonFunctions.HideSpecialColumns("FileName", e.Item);
        }

        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (Session["A"] != null)
            {
                string[] sessionValue = Session["A"].ToString().Split(',');
                string action = sessionValue[0].ToString();

                switch (action)
                {
                    case "prop":
                        LoadProperties();
                        MenuDisplay.ActiveDocuments((Doculex) Page.Master);
                        break;

                    case "note":
                        LoadNotes();
                        MenuDisplay.ActiveDocuments((Doculex) Page.Master);
                        break;

                    case "noteWS":
                        LoadWSNotes(sessionValue[1].ToString());
                        MenuDisplay.BasicTabs((Doculex)Page.Master);
                        break;

                    default:
                        Session["A"] = null;
                        break;
                }
            }
            else
            {
                LoadMenu();
                Session["A"] = null;
            }
        }

       

        protected void Page_Load(object sender, EventArgs e)
        {
            GetInfo();

            if (!Page.IsPostBack)
            {
                LoadSettings();
                CreateColumns();
            }

            DocumentGrid.HeaderContextMenu.ItemCreated += HeaderContextMenu_ItemCreated;
        }

        protected void Page_Init(object sender, EventArgs e)
        {
            RadSpell1.AllowAddCustom = false;
        }

        protected void imgSave_Click(object sender, ImageClickEventArgs e)
        {
            SaveComment();
            Session["Add"] = null;
        }

        #endregion

        #region Grid

        protected void DocumentGrid_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "RowClick" && e.Item is GridDataItem)
            {
                e.Item.Selected = true;
               
                DocPreview.Visible = true;

                (e.Item.FindControl("chkSelectRow") as CheckBox).Checked = true;

                LoadPreview((GridDataItem) e.Item);
            }
        }

        protected void DocumentGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            DocumentGrid.DataSource = GenericGrid.ListDocuments?? new DataTable();
        }

        protected void DocumentGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                e.Item.PreRender += DocumentGrid_ItemPreRender;
            }
        }

        private void DocumentGrid_ItemPreRender(object sender, EventArgs e)
        {
            ((sender as GridDataItem)["CheckBoxTemplateColumn"].FindControl("chkSelectRow") as CheckBox).Checked =
                (sender as GridDataItem).Selected;

            if (Session["checked"] != null)
            {
                LoadPreview((GridDataItem) Session["checked"]);

                Session["checked"] = null;
            }
        }

        protected void DocumentGrid_RowDrop(object sender, GridDragDropEventArgs e)
        {
            if ((!String.IsNullOrEmpty(e.HtmlElement)) && (e.DraggedItems.Count > 0))
            {
                string nodeValue = nodeValueHiddenField.Value.Trim();

                RadTreeView tv = App.GetTreeViewWS(this.Page);
                RadTreeNode node = tv.FindNodeByValue(nodeValue);

                var nodePasteList = new List<DropNodes>();

                foreach (GridDataItem draggedItem in DocumentGrid.SelectedItems)
                {
                    var nodeDoc = new RadTreeNode
                                      {
                                          Value = draggedItem["Id"].Text,
                                          Text = draggedItem["FileName"].Text,
                                          ContextMenuID = "DocumentContextMenu"
                                      };
                    nodeDoc.Attributes["Type"] = "D";
                    nodeDoc.Attributes["path"] = draggedItem["Path"].Text;
                    //nodeDoc.Attributes["documnetStatus"] = draggedItem["DocumentStatusId"].ToString();
                    //nodeDoc.Attributes["securityLevel"] = draggedItem["SecurityLevelId"].ToString();
                    nodeDoc.Attributes["AllowEdit"] = "false";


                    nodePasteList.Add(new DropNodes
                                          {
                                              FileId = Convert.ToInt32(draggedItem["Id"].Text),
                                              NewNode = Convert.ToInt32(node.Value)
                                          });

                    string extension = CommonFunctions.GetExtensionFile(draggedItem["Path"].Text);
                    nodeDoc.ImageUrl = CommonFunctions.GetDocumentIcon(extension).Replace("~/UI/", "");
                    node.Nodes.Add(nodeDoc);
                }

                node.ExpandParentNodes();
                node.Expanded = true;

                if (nodePasteList.Count > 0)
                {
                    new smOrganization().PasteNode(nodePasteList);
                }
            }
        }


        //protected void DocumentGrid_SelectIndexChanged(object sender, EventArgs e)
        //{
        //    GridItemCollection  dataItem = DocumentGrid.SelectedItems;
            
        //    foreach (GridDataItem item in dataItem)
        //    {
        //        CheckBox chk = item.FindControl("chkSelectRow") as CheckBox;
                
        //        if (item.Selected && !chk.Checked)
        //        {
        //            chk.Checked = true;
        //        }
        //        else
        //        {
        //            chk.Checked = false;
        //        }
        //    }
            


        //}

        #endregion

        #region NotesEvents

        protected void lnkAddComment_Click(object sender, EventArgs e)
        {
            pnlComment.Visible = true;
            txtComents.Text = null;
            lnkAddComment.Visible = false;
            txtComents.Focus();
            Session["Add"] = 1;
        }

        protected void imgCancel_Click(object sender, ImageClickEventArgs e)
        {
            txtComents.Text = null;
            pnlComment.Visible = false;
            lnkAddComment.Visible = true;
            Session["Add"] = null;
        }

        #endregion

        #endregion

        #region CheckSelectedEvents

        protected void ToggleRowSelection(object sender, EventArgs e)
        {
            ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;

            ///  LoadPreview((((sender as CheckBox).NamingContainer) as GridDataItem));

            Session["checked"] = (((sender as CheckBox).NamingContainer) as GridDataItem);
        }

        protected void ToggleSelectedState(object sender, EventArgs e)
        {
            var headerCheckBox = (sender as CheckBox);
            foreach (GridDataItem dataItem in DocumentGrid.MasterTableView.Items)
            {
                (dataItem.FindControl("chkSelectRow") as CheckBox).Checked = headerCheckBox.Checked;
                dataItem.Selected = headerCheckBox.Checked;
            }
        }

        #endregion

        #region methods

        #region dragadndrop

        #endregion

        private void LoadMenu()
        {
            if (DocumentGrid.Items.Count == 0)
            {
                MenuDisplay.BasicTabs((Doculex) Page.Master);
            }
            else
            {
                switch (DocumentGrid.SelectedItems.Count)
                {
                    case 0:
                        MenuDisplay.BasicTabs((Doculex) Page.Master);
                        MenuDisplay.GridTab((Doculex) Page.Master);
                        break;

                    case 1:
                        MenuDisplay.ActiveDocuments((Doculex) Page.Master);
                        break;


                    default:
                        MenuDisplay.MultipleDocuments((Doculex) Page.Master);
                        break;
                }
            }


            this.FileNotesPane.Visible = false;
            this.Properties.Visible = false;

            MenuDisplay.UpdateMenu((Doculex) Page.Master);
        }

        private void CreateColumns()
        {
            List<smDocumentTypeField> documentTypeFieldList = _organization.GetDocumentTypeField(1);


            var boundColumnId = new GridBoundColumn();
            DocumentGrid.MasterTableView.Columns.Add(boundColumnId);

            boundColumnId.DataField = "Id";
            boundColumnId.UniqueName = "Id";
            boundColumnId.Visible = false;
            boundColumnId.HeaderStyle.Width = Unit.Pixel(1);
            boundColumnId.ItemStyle.Width = Unit.Pixel(1);

            boundColumnId = new GridBoundColumn();
            DocumentGrid.MasterTableView.Columns.Add(boundColumnId);

            boundColumnId.DataField = "Path";
            boundColumnId.UniqueName = "Path";
            boundColumnId.Visible = false;


            var imgeColum = new GridImageColumn();
            DocumentGrid.MasterTableView.Columns.Add(imgeColum);

            imgeColum.DataImageUrlFields = new[] {"Image"};
            imgeColum.HeaderText = "File Type";
            imgeColum.DataImageUrlFormatString = "{0}";
            imgeColum.ImageAlign = ImageAlign.Middle;
            imgeColum.AllowFiltering = false;
            imgeColum.UniqueName = "Image";


            foreach (smDocumentTypeField documentTypeField in documentTypeFieldList)
            {
                var boundColumn = new GridBoundColumn();
                DocumentGrid.MasterTableView.Columns.Add(boundColumn);

                boundColumn.DataField = documentTypeField.Name;
                boundColumn.HeaderText = documentTypeField.Header;
                boundColumn.UniqueName = documentTypeField.Name;
                boundColumn.Visible = documentTypeField.IsVisible;

                if (documentTypeField.IsVisible == false)
                {
                    _hideColum.Add(documentTypeField.Name);
                }
            }
        }

        private void LoadSettings()
        {
            //lblTitle.Text = _resources.GetString(lblTitle.ID, new CultureInfo(_culture));

            DocPreview.IconUrl = App.GetImagesFolder() + "/preview.png";
            DocPreview.TabView = SplitterSlidePaneTabView.ImageOnly;
            DocPreview.Title = _resources.GetString("TitleViewPane", new CultureInfo(_culture));
            DocPreview.UndockText =
                _resources.GetString("UndockViewPane", new CultureInfo(_culture));
            DocPreview.DockText =
                _resources.GetString("DockViewPane", new CultureInfo(_culture));
            DocPreview.ToolTip =
                _resources.GetString("ToolTipViewPane", new CultureInfo(_culture));

            PaneZone.Style.Add("position", "static");

            Properties.Visible = false;
            //FileNotesPane.Visible = false;
            ///DocPreview.Visible = false;
        }


        private void GetInfo()
        {
            _culture = App.CurrentCulture();
            _resources = App.GetMasterResources("DocumentsList");
        }


        private void LoadPreview(GridDataItem documentRow)
        {
            var newValues = new Hashtable();

            documentRow.ExtractValues(newValues);


            String fileName = newValues["FileName"].ToString();
            String path = newValues["Path"].ToString();

            string[] extension = fileName.Split('.');

            switch (extension[1].ToLower())
            {
                case "txt":
                    StreamReader oStreamReader = File.OpenText(path);
                    string contents = oStreamReader.ReadToEnd();

                    preview.InnerHtml = contents;

                    oStreamReader.Close();
                    break;

                case "pdf":


                    preview.InnerHtml =
                        "<iframe src=\"../Folder/" + fileName +
                        "\" style=\"width:718px; height:700px;\" frameborder=\"0\"></iframe>";

                    break;

                default:

                    preview.InnerHtml = "<b>Preview not available<b>";
                    break;
            }

            PaneZone.ExpandedPaneId = DocPreview.ID;
            PaneZone.DockedPaneId = DocPreview.ID;

            searchPane.Width = Unit.Empty;
            //  searchPane.Width = Unit.Pixel(20);
        }

        public void FillCheckGrid()
        {
            var selectedItems = (GridItemCollection) Session["SelectedRows"];

            if (selectedItems == null) return;

            if (selectedItems.Count == 0) return;


            foreach (GridDataItem row in DocumentGrid.MasterTableView.Items)
            {
                foreach (GridDataItem item in selectedItems)
                {
                    if (row["Id"].Text == item["Id"].Text)
                    {
                        row.Selected = true;
                        ((CheckBox) row.FindControl("chkSelectRow")).Checked = true;
                    }
                }
            }
        }

        #region Notes

        private void LoadNotes()
        {
          

            LoadSettingsNotes();

            rExpComments.ErrorMessage = _resources.GetString(rExpComments.ID, new CultureInfo(_culture));

            GridItemCollection selectedItems = DocumentGrid.SelectedItems;

            if (selectedItems == null) return;

            if (selectedItems.Count == 0) return;

            var item = (GridDataItem) selectedItems[0];

            var newValues = new Hashtable();

            item.ExtractValues(newValues);

            NotesRepeater.DataSource = _organization.GetNotes(Convert.ToInt16(newValues["Id"].ToString()));
            NotesRepeater.DataBind();

            PaneZone.DockedPaneId = FileNotesPane.ID;
            PaneZone.ExpandedPaneId = FileNotesPane.ID;
        }

        private void LoadSettingsNotes()
        {
            if (Session["Add"] != null) return;

            RadSpell1.Language = _culture;
            RadSpell1.DictionaryLanguage = _culture;

            FileNotesPane.TabView = SplitterSlidePaneTabView.ImageOnly;
            FileNotesPane.Title = _resources.GetString("TitleNotesPane", new CultureInfo(_culture));
            Properties.UndockText =
                _resources.GetString("UndockNotesPane", new CultureInfo(_culture));
            FileNotesPane.DockText =
                _resources.GetString("DockNotesPane", new CultureInfo(_culture));
            FileNotesPane.ToolTip =
                _resources.GetString("ToolTipNotesPane", new CultureInfo(_culture));

            FileNotesPane.Visible = true;
            Properties.Visible = false;
            pnlComment.Visible = false;


            var imgSave = (pnlComment.FindControl("imgSave") as ImageButton);
            var imgCancel = (pnlComment.FindControl("imgCancel") as ImageButton);
            var rExpComments = (pnlComment.FindControl("rExpComments") as RegularExpressionValidator);

            lblAddComment.Text = _resources.GetString(lblAddComment.ID, new CultureInfo(_culture));
            imgSave.ToolTip = _resources.GetString(imgSave.ID, new CultureInfo(_culture));
            imgSave.AlternateText = _resources.GetString(imgSave.ID, new CultureInfo(_culture));
            imgCancel.ToolTip = _resources.GetString(imgCancel.ID, new CultureInfo(_culture));
            imgCancel.AlternateText = _resources.GetString(imgCancel.ID, new CultureInfo(_culture));
            rExpComments.ErrorMessage = _resources.GetString(rExpComments.ID, new CultureInfo(_culture));
        }


        private void SaveComment()
        {
            string documentId = "0";
            string comment = txtComents.Text.Trim();


            if (Session["A"] != null && Session["A"].ToString().Contains("noteWS"))
            {
                string[] sessionValue = Session["A"].ToString().Split(',');
               
                 documentId = sessionValue[1].ToString();
                
            }else
            {
                 var dateKey = (GridDataItem) DocumentGrid.SelectedItems[0];

                var newValues = new Hashtable();
                dateKey.ExtractValues(newValues);

                documentId = newValues["Id"].ToString();
            }

            _organization.FileNotes = new smFileNotes
                                          {
                                              Comments = comment,
                                              UserId = App.CurrentUserId(),
                                              FileId = Convert.ToInt16(documentId),
                                              Date = DateTime.Now,
                                          };
            _organization.CreateNote();

            pnlComment.Visible = false;

            if (Session["A"] != null && Session["A"].ToString().Contains("noteWS")) LoadWSNotes(documentId);
            else  LoadNotes();

          

            lnkAddComment.Visible = true;
        }


        private void LoadWSNotes(string documentId)
        {
            LoadSettingsNotes();
            NotesRepeater.DataSource = _organization.GetNotes(Convert.ToInt16(documentId));
            NotesRepeater.DataBind();

            PaneZone.DockedPaneId = FileNotesPane.ID;
            PaneZone.ExpandedPaneId = FileNotesPane.ID;
        }
        #endregion

        #region Properties

        private void LoadProperties()
        {
            LoadSettingsProperties();

            CreateContentProperties();
            Properties.Visible = true;
            PaneZone.DockedPaneId = Properties.ID;
            PaneZone.ExpandedPaneId = Properties.ID;
        }

        private void CreateContentProperties()
        {
            GridItemCollection selectedItems = DocumentGrid.SelectedItems;

            if (selectedItems == null) return;

            if (selectedItems.Count == 0) return;


            var tbProperty = new Table();

            List<smDocumentTypeField> documentTypeFieldList = _organization.GetDocumentTypeField(1);

            LoadPreview((GridDataItem) selectedItems[0]);

            foreach (smDocumentTypeField smDocumentTypeField in documentTypeFieldList)
            {
                var row = new TableRow();

                var cell = new TableCell();
                var lbl = new Label {Text = smDocumentTypeField.Name + ":"};
                cell.CssClass = "LabelCol";
                cell.Controls.Add(lbl);
                row.Cells.Add(cell);

                foreach (GridDataItem item in selectedItems)
                {
                    var newValues = new Hashtable();
                    item.ExtractValues(newValues);

                    if (newValues[smDocumentTypeField.Name] != null &&
                        newValues[smDocumentTypeField.Name].ToString().Length > 30)
                    {
                        newValues[smDocumentTypeField.Name] = newValues[smDocumentTypeField.Name].ToString().Substring(
                            0, 30) + "...";
                    }

                    cell = new TableCell();
                    lbl = new Label
                              {
                                  Text =
                                      newValues[smDocumentTypeField.Name] == null
                                          ? null
                                          : newValues[smDocumentTypeField.Name].ToString()
                              };
                    cell.CssClass = "TextBoxCol";
                    cell.Controls.Add(lbl);
                    row.Cells.Add(cell);
                }

                tbProperty.Rows.Add(row);
            }


            PropertyList.Controls.Add(tbProperty);
        }

        private void LoadSettingsProperties()
        {
            Properties.TabView = SplitterSlidePaneTabView.ImageOnly;
            Properties.Title = _resources.GetString("TitlePropertiesPane", new CultureInfo(_culture));
            Properties.UndockText =
                _resources.GetString("UndockPropertiesPane", new CultureInfo(_culture));
            Properties.DockText =
                _resources.GetString("DockPropertiesPane", new CultureInfo(_culture));
            Properties.ToolTip =
                _resources.GetString("ToolTipPropertiesPane", new CultureInfo(_culture));

            FileNotesPane.Visible = false;
            Properties.Visible = true;
        }

       

        #endregion

        #endregion

       
    }
}



How I can do this in client side?... When user selected, findcontrol checkbox and checked or not


Regards...
Iana Tsolova
Telerik team
 answered on 07 Mar 2012
1 answer
130 views
Hi,

I'm using then telerik recurrence editor control for create a recurrence for a request of services. When you create a recurrence (weekly) selecting any days, then saturday is ckecked in postback (when the user presses any button).

In then next link you can see a demo.
http://youtu.be/s9wTIBXmv_Q


Can you help me please.

Thanks, cmarquez
Ivana
Telerik team
 answered on 07 Mar 2012
1 answer
104 views
i want to upload 500-700 MB file in Intranet using Rad Upload. i have completed coding it working fine on my local system but while i am testing on server it gives an error.
Bozhidar
Telerik team
 answered on 07 Mar 2012
2 answers
150 views
I'm trying to set up a panel bar that has the size restrictions of FullExpandedItem, but the behavior for child items of SingleExpandedItem (only one item within a group expanded at a time)

I can come really close by using FullExpandedItem, and using OnClientItemClicking where the function collpapses all the peers of of the item being clicked (if level isn't 0) and it works perfectly....unless you click on the expandhandle.

In that case, the OnClientItemClicking function is never called.

How can I either get a chance to handle the click when the expandhandle is called, or implement this whole thing a different way?
Kate
Telerik team
 answered on 07 Mar 2012
1 answer
103 views
I am using 2 RadButtons to search for a (Host or Victim) student then load 2 Radgrids via ajax.
I am pre populating the search criteria txtFirstName with "Cor" and txtLastName with "A".
This returns 5 rows from my DB.
When the Radgrids bind the ajax fires correctly and I can compare the 2 Students below.
In the Other radgrids that hold additional information.
If I change my search criteria to something else that will return more rows to the RadGrid.
The ajax is only firing for the first 5 rows.
If I swap out my 2 search RadButtons with regular ASP:Buttons and fire a post back to bind the 2 SearchRadGrids then all the rows are able to fire the ajax correctly.

any help is appreciated? Thanks


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnHostSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="hostSearchGrid"
                                LoadingPanelID="hostSearchLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="btnVictimSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="victimSearchGrid"
                                LoadingPanelID="victimSearchLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="hostSearchGrid">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="hostStudentInfoGrid"
                                LoadingPanelID="hostStudentInfoLoadingPanel" />
                            <telerik:AjaxUpdatedControl ControlID="hostSchoolInfoGrid"
                                LoadingPanelID="hostSchoolInfoLoadingPanel" />
                            <telerik:AjaxUpdatedControl ControlID="hostAdmissionInfoGrid"
                                LoadingPanelID="hostAdmissionInfoLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="victimSearchGrid">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="victimStudentInfoGrid"
                                LoadingPanelID="victimStudentInfoLoadingPanel" />
                            <telerik:AjaxUpdatedControl ControlID="victimSchoolInfoGrid"
                                LoadingPanelID="victimSchoolInfoLoadingPanel" />
                            <telerik:AjaxUpdatedControl ControlID="victimAdmissionInfoGrid"
                                LoadingPanelID="victimAdmissionInfoLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <%--Loading Panels--%>
            <telerik:RadAjaxLoadingPanel ID="hostSearchLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="victimSearchLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="hostStudentInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="hostSchoolInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="hostAdmissionInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="victimStudentInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="victimSchoolInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxLoadingPanel ID="victimAdmissionInfoLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>
 
            <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="Buttons">
            </telerik:RadFormDecorator>
            <br />
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                <asp:Label Text="First Name:" runat="server"></asp:Label>
                <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
                <asp:Label ID="Label1" Text="Last Name:" runat="server"></asp:Label>
                <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox>
                <telerik:RadButton ID="btnHostSearch" runat="server" OnClick="btnHostSearch_Click" Font-Underline="false" Text="Search for Host">
                    <Icon PrimaryIconCssClass="rbSearch" PrimaryIconLeft="4" PrimaryIconTop="4" />
                </telerik:RadButton>
                <telerik:RadButton ID="btnVictimSearch" runat="server" OnClick="btnVictimSearch_Click"  Font-Underline="false" Text="Search for Victim">
                    <Icon PrimaryIconCssClass="rbSearch" PrimaryIconLeft="4" PrimaryIconTop="4" />
                </telerik:RadButton>
            </telerik:RadAjaxPanel>
 
            <br />
            <h5><%--Host Students--%></h5>
            <hr />
            <telerik:RadGrid ID="hostSearchGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                AllowSorting="false" GridLines="None" OnItemCommand="hostSearchGrid_Click_ItemCommand"  OnNeedDataSource="hostSearchGrid_NeedDataSource">
                <MasterTableView AutoGenerateColumns="true" DataKeyNames="StudentID">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn1" HeaderText="Select">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:ImageButton ID="ibtnAddToCart" CommandName="Compare" runat="server" Height=25px Width=25px ImageUrl="~/_Images/circle-up.png" AlternateText="Select" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <telerik:RadGrid ID="victimSearchGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                AllowSorting="false" GridLines="None" OnItemCommand="victimSearchGrid_Click_ItemCommand" OnNeedDataSource="victimSearchGrid_NeedDataSource">
                <MasterTableView AutoGenerateColumns="true" DataKeyNames="StudentID">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn1" HeaderText="Select"
                            AllowFiltering="false">
                            <ItemStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:ImageButton ID="ibtnAddToCart" runat="server" Height=25px Width=25px ImageUrl="~/_Images/circle-up.png"
                                AlternateText="Select" CommandName="Compare"/>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <br />
            <br />
            <h5><%--Host Students--%></h5>
            <hr />
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Outlook" MultiPageID="RadMultiPage1"
                SelectedIndex="0" CssClass="tabStrip">
                <Tabs>
                    <telerik:RadTab Text="Student Information">
                    </telerik:RadTab>
                    <telerik:RadTab Text="School Information">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Admission Information">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
                <telerik:RadPageView ID="RadPageView1" runat="server">
                    <telerik:RadGrid ID="hostStudentInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <telerik:RadGrid ID="victimStudentInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" CssClass="pageViewEducation">
                    <telerik:RadGrid ID="hostSchoolInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <telerik:RadGrid ID="victimSchoolInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView3" runat="server">
                    <telerik:RadGrid ID="hostAdmissionInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <telerik:RadGrid ID="victimAdmissionInfoGrid" runat="server" AllowFilteringByColumn="false" AllowPaging="false"
                        ShowFooter="true" AllowSorting="false" GridLines="None"
                        PageSize="5">
                        <MasterTableView AutoGenerateColumns="True" DataKeyNames="StudentName">
                            <NoRecordsTemplate>
                                No Records Found.
                            </NoRecordsTemplate>
                            <Columns>
 
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </telerik:RadPageView>
            </telerik:RadMultiPage>

           'General Controls
        Protected txtFirstName, txtLastName As TextBox
        Protected RadAjaxManager1 As RadAjaxManager
        Protected WithEvents btnHostSearch, btnVictimSearch As RadButton
        Protected WithEvents Button1 As Button
        Protected WithEvents hostStudentInfoLoadingPanel, hostSchoolInfoLoadingPanel, hostAdmissionInfoLoadingPanel As RadAjaxLoadingPanel
        ' Host Grids
        Protected WithEvents hostSearchGrid, hostStudentInfoGrid, hostSchoolInfoGrid, hostAdmissionInfoGrid As RadGrid
 
        'Victim Grids
        Protected WithEvents victimSearchGrid, victimStudentInfoGrid, victimSchoolInfoGrid, victimAdmissionInfoGrid As RadGrid
 
        Public Property HostStudentsData() As DataTable
            Get
                Dim obj As Object = Me.Session("HostStudentsData")
                If obj IsNot Nothing Then
                    Return DirectCast(obj, DataTable)
                End If
 
                Dim _hostStudentData As New DataTable()
                Dim studentMerge As New MCOECN.DASL.BusinessLogic.SIS.StudentMerge.Merge()
                _hostStudentData = studentMerge.GetStudentInfo(txtLastName.Text + "%", txtFirstName.Text + "%", CurrentContext.WorkingSchool.DistrictId)
 
                Me.Session("HostStudentsData") = _hostStudentData
 
                Return _hostStudentData
            End Get
            Set(value As DataTable)
                Me.Session("HostStudentsData") = value
            End Set
        End Property
 
        Public Property VictimStudentsData() As DataTable
            Get
                Dim obj As Object = Me.Session("VictimStudentsData")
                If obj IsNot Nothing Then
                    Return DirectCast(obj, DataTable)
                End If
 
                Dim _victimStudentData As New DataTable()
                Dim studentMerge As New MCOECN.DASL.BusinessLogic.SIS.StudentMerge.Merge()
                _victimStudentData = studentMerge.GetStudentInfo(txtLastName.Text + "%", txtFirstName.Text + "%", CurrentContext.WorkingSchool.DistrictId)
 
                Me.Session("VictimStudentsData") = _victimStudentData
 
                Return _victimStudentData
            End Get
            Set(value As DataTable)
                Me.Session("VictimStudentsData") = value
            End Set
        End Property
 
        Protected Sub btnHostSearch_Click(sender As Object, e As EventArgs) Handles Button1.Click
 
            HostStudentsData = Nothing
            hostSearchGrid.Visible = True
            Dim dt As DataTable = HostStudentsData
            dt.AcceptChanges()
            hostSearchGrid.DataSource = dt
 
            hostSearchGrid.DataBind()
 
        End Sub
 
        Protected Sub btnVictimSearch_Click(sender As Object, e As EventArgs)
            VictimStudentsData = Nothing
            victimSearchGrid.Visible = True
            victimSearchGrid.DataSource = VictimStudentsData
            victimSearchGrid.DataBind()
 
        End Sub
 
        Protected Sub hostSearchGrid_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
            Dim HostSearchStudents As DataTable = HostStudentsData
            hostSearchGrid.DataSource = HostSearchStudents
 
        End Sub
 
        Protected Sub victimSearchGrid_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
            Dim VictimSearchStudents As DataTable = VictimStudentsData
            victimSearchGrid.DataSource = VictimSearchStudents
 
        End Sub
 
        Protected Sub hostSearchGrid_Click_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
            If e.CommandName = "Compare" Then
                Dim itemValues As IDictionary = New Dictionary(Of Object, Object)()
                hostSearchGrid.Rebind()
 
                Dim item As GridDataItem = DirectCast(e.Item, Global.Telerik.Web.UI.GridDataItem)
                itemValues("StudentID") = item.OwnerTableView.DataKeyValues(item.ItemIndex)("StudentID").ToString()
 
                Dim studentMerge As New MCOECN.DASL.BusinessLogic.SIS.StudentMerge.Merge()
                Dim studentId As Guid = New Guid(itemValues("StudentID").ToString)
                Dim studentDS As DataSet = studentMerge.GetStudentInfoById(studentId, CurrentContext.WorkingSchool.DistrictId)
 
                BindHostInformation(studentDS)
 
            End If
        End Sub
 
        Protected Sub victimSearchGrid_Click_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
            If e.CommandName = "Compare" Then
                Dim itemValues As IDictionary = New Dictionary(Of Object, Object)()
                victimSearchGrid.Rebind()
 
                Dim item As GridDataItem = DirectCast(e.Item, Global.Telerik.Web.UI.GridDataItem)
                itemValues("StudentID") = item.OwnerTableView.DataKeyValues(item.ItemIndex)("StudentID").ToString()
 
                Dim studentMerge As New MCOECN.DASL.BusinessLogic.SIS.StudentMerge.Merge()
                Dim studentId As Guid = New Guid(itemValues("StudentID").ToString)
                Dim studentDS As DataSet = studentMerge.GetStudentInfoById(studentId, CurrentContext.WorkingSchool.DistrictId)
 
                BindVictimInformation(studentDS)
 
            End If
        End Sub
 
        Private Sub BindHostInformation(ByVal hostStudentDS As DataSet)
 
            hostStudentInfoGrid.DataSource = hostStudentDS.Tables(0)
            hostSchoolInfoGrid.DataSource = hostStudentDS.Tables(1)
            hostAdmissionInfoGrid.DataSource = hostStudentDS.Tables(2)
 
            hostStudentInfoGrid.DataBind()
            hostSchoolInfoGrid.DataBind()
            hostAdmissionInfoGrid.DataBind()
        End Sub
 
        Private Sub BindVictimInformation(ByVal victimStudentDS As DataSet)
 
            victimStudentInfoGrid.DataSource = victimStudentDS.Tables(0)
            victimSchoolInfoGrid.DataSource = victimStudentDS.Tables(1)
            victimAdmissionInfoGrid.DataSource = victimStudentDS.Tables(2)
 
            victimStudentInfoGrid.DataBind()
            victimSchoolInfoGrid.DataBind()
            victimAdmissionInfoGrid.DataBind()
        End Sub
 
        Private Sub Page_Load1(sender As Object, e As System.EventArgs) Handles Me.Load
            If Not IsPostBack Then
                txtFirstName.Text = "Cor"
                txtLastName.Text = "A"
            End If
        End Sub
Maria Ilieva
Telerik team
 answered on 07 Mar 2012
2 answers
130 views
I'm working a project where there is a ListView embedded within another ListView. 
I'm having difficulty performing a databind on the embedded ListView when the user deletes an entry from it.  I receive "Object reference not set to an instance of an object" as an error.  The entry does get deleted but I'm unable to refresh the ListView to reflect the deleted entry.  Thanks very much for any assistance!

Code:

 

 

Protected Sub lvMissionSubTasks_ItemDeleting(sender As Object, e As Telerik.Web.UI.RadListViewCommandEventArgs) Handles lvMissionSubTasks.ItemDeleting

 

 

 

If TypeOf e.ListViewItem Is RadListViewItem Then

 

 

 

Dim lbl As Label = TryCast(e.ListViewItem.FindControl("lblItemID"), Label)

 

 

 

Dim de As New LaunchChecklist.BUS.Items

 

de.Delete(

 

CInt(lbl.Text))

 

 

 

'lvMissionSubTasks.DataBind()

 

 

 

Dim lv As RadListView = DirectCast(e.ListViewItem.FindControl("lvMissionLevel3SubTasks"), RadListView)

 

lv.DataBind()

 

 

End If

 

 

 

End Sub

 

Antonio Stoilkov
Telerik team
 answered on 07 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?