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

I am developing a stacked bar chart.  My datasource structure is

Month    value    GroupColumn
March    3            A            
March    1            B
March    2            C
April       4            A            
April       5            B
April       7            C

In my stacked bar chart, by default  A is displaying in the bottom of the chart and then B and C. I want to re-order the position, it should appear order C, then B and A.

Regards
Arima
Evgenia
Telerik team
 answered on 04 May 2011
2 answers
50 views
Hello,

I have a grid control with 4 groupheaders. The order is ascending or descending for them. Pl see attached image. I want present then in very specific order other than ascending and descending.

How to set order for the group headers ?
Maria Ilieva
Telerik team
 answered on 04 May 2011
1 answer
49 views
Hello,

I want to change the icon of raddock command. I am using skin sitefinity. To maintain cosistancy i wish to change it and pass it throgh CSS.

I am creating raddocks dynamically.
dock.Commands.Add(New DockCloseCommand())
dock.CommandsAutoPostBack = True

Here how to set css for the newly added close command ?
Pero
Telerik team
 answered on 04 May 2011
1 answer
65 views
Hello,

I have raddock with user controls embeded in them. If user refreshes the web browser or postback event then itemcontent image should have animation indicating page load is in progress.

Plz see attached image.
Pero
Telerik team
 answered on 04 May 2011
1 answer
62 views
Hi

I have a requirement which i have to show the xaxis horizontal line should appear in the middle of the chart. Y axis values starts from 0 to 200. But i have to display xaixs line in 100 th.  Please see the attached image. I have marked on it.  Is there any property to set? or do we need to do programatically(hiding the gridlines in the chart and then apply marked zones in the yaxis position 100)

Regards
Arima
Evgenia
Telerik team
 answered on 04 May 2011
3 answers
208 views

Hi,

 

I was developing application using Telerik ASP.Net controls (Version: 2011.1.315.40). My Page have hierarchical grid with export functionality. Export functionality was working properly before. As we added more features it stop working.
Even After going through forums and knowledge base article I am not able to resolve this error. Here I am sending you few pages of application. Please help me to figure out problem why export is not working.

 

 

Details of Application:

 

Application contains master page with RadAjaxManager & ScriptManager. Each control contains RadAjaxManagerProxy to overcome limitation of multiple RadAjaxManager not allowed on same page.

-          -MyDashboard Page is container page with various control hosted within page.

-          - MyIssueControl hosted within MyDashboard Page. This control contains hierarchical grid. I am just exporting Top Grid (IssueGrid) with default export functionality.

-         - MyIssueControl hosts other controls as well.

-          -After clicking on default export functionality it doesn’t do anything. It throws scripting error(ScriptError.jpg).

-          -After going through forums which advise to register RadAjaxManager events in Control to execute client side code which is not possible using RadAjaxManagerProxy.

-          After registering RadAjaxManager event in MyIssueControl to execute function OnRequestStart which will disable Ajax for exporting functionality (as it required for export explain in help documents) its now throwing new error (Error.jpg)

 

Note:  Application will not work as it requires data from db. This application pages are just for reference to figure out issue.  Please check attach zip file for error screen shot as well as application pages.

 

 

This is very critical project issue. Please help me to resolve ASAP. Thanks for your help.

Thanks,
Atman


MyIssuecontrol.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyIssuesControl.ascx.cs" Inherits="Controls_MyIssuesControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register src="IssueDefinationControl.ascx" TagName="IssueDefination" TagPrefix="UC"  %>
<%@ Register src="MyActionsControl.ascx" TagName="Action" TagPrefix="UC"  %>
 
<style type="text/css">
    .viewWrap
    {
        padding: 15px;
        background: #2291b5 0 0 url(Img/bluegradient.gif) repeat-x;
    }
    .contactWrap
    {
        padding: 10px 15px 15px 15px;
        background: #fff;
        color: #333;
    }
     
    .contactWrap td
    {
        padding: 0 20px 0 0;
    }
     
    .contactWrap td td
    {
        padding: 3px 20px 3px 0;
    }
     
    .contactWrap img
    {
        border: 1px solid #05679d;
    }
     
    .InnerHeaderStyle
    {
        background: navy !important;
        font-size: 13px !important;
        color: white !important; /*add more style definitions here*/
    }
    .InnerItemStyle
    {
        background: orange !important;
        color: brown !important; /*add more style definitions here*/
    }
    .InnerAlernatingItemStyle
    {
        background: white !important;
        color: brown !important; /*add more style definitions here*/
    }
    .MostInnerHeaderStyle
    {
        background: brown !important;
        font-size: 15px !important;
        color: white !important; /*add more style definitions here*/
    }
    .MostInnerItemStyle
    {
        background: white !important;
        color: olive !important; /*add more style definitions here*/
    }
    .MostInnerAlernatingItemStyle
    {
        background: olive !important;
        color: white !important; /*add more style definitions here*/
    }
</style>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
        var popUp;
        function PopUpShowing(sender, eventArgs) {
            popUp = eventArgs.get_popUp();
            var gridWidth = sender.get_element().offsetWidth;
            var gridHeight = sender.get_element().offsetHeight;
            var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
            var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
            popUp.style.left = ((gridWidth - popUpWidth) / 2 + sender.get_element().offsetLeft).toString() + "px";
            popUp.style.top = ((gridHeight - popUpHeight) / 2 + sender.get_element().offsetTop).toString() + "px";
        }
 
        function OpenPositionedWindow(oButton, url, windowName) {
            var oWnd = window.radopen(url, windowName);
        }
 
        function openRadWindow(Type, ID) {
            var oWnd = radopen("AttachFile.aspx?Type=" + Type + "&TypeID=" + ID, "File Attachment");
             
            oWnd.center();
        }
 
        function ValidateTextBox(oSrc, args) {
           // alert("here");
           // alert(args.Value);
            args.IsValid = (args.Value != '');
            if (!args.IsValid) {
                alert(args.toString());
            }
        }
    </script>
</telerik:RadCodeBlock>
<table width="98%" style="vertical-align: top">
    <tr>
        <td valign="top">
            <!-- content start -->
             <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy" runat="server">
               <AjaxSettings>
                   <telerik:AjaxSetting AjaxControlID="IssueGrid">
                       <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="IssueGrid" LoadingPanelID="IssueGridLoadingPanel" />
                       </UpdatedControls>
                   </telerik:AjaxSetting>
               </AjaxSettings>
            </telerik:RadAjaxManagerProxy>
            <telerik:RadAjaxLoadingPanel ID="IssueGridLoadingPanel" runat="server"  />
            <telerik:RadWindowManager ID="RadWindowManager1" Width="850px" Height="600px" runat="server" VisibleStatusbar="false" Modal="true" Behaviors="Close,Move">
            </telerik:RadWindowManager>
 
            <telerik:RadGrid ID="IssueGrid" OnPreRender="IssueGrid_PreRender" OnNeedDataSource="IssueGrid_NeedDataSource"
                runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" 
                PageSize="15" GridLines="none" ShowGroupPanel="false" OnItemCreated="IssueGrid_ItemCreated"
                OnItemDataBound="IssueGrid_ItemDataBound" OnItemCommand="IssueGrid_ItemCommand"
                ShowStatusBar="true" AllowMultiRowEdit="true" OnInsertCommand="IssueGrid_InsertCommand" OnUpdateCommand="IssueGrid_UpdateCommand"
                AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                AllowMultiRowSelection="True" AllowFilteringByColumn="false" CssClass="RadGrid">
                <PagerStyle Mode="NumericPages"></PagerStyle>
                <ClientSettings AllowDragToGroup="false">
                    <ClientEvents OnPopUpShowing="PopUpShowing"  />
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"
                    Excel-FileExtension="xlsx" Csv-FileExtension=".csv" OpenInNewWindow="true" />
                <MasterTableView Name="IssueList" DataKeyNames="IssueNo" AllowMultiColumnSorting="True"
                    GroupLoadMode="Server" AllowFilteringByColumn="true" EditMode="PopUp"
                    CommandItemDisplay="TopAndBottom">
                    <EditFormSettings InsertCaption="Add New Issue" CaptionFormatString="Edit Issue No: {0}"
                        CaptionDataField="IssueNo" PopUpSettings-Modal="false" PopUpSettings-ScrollBars="Auto"
                        PopUpSettings-Height="400px" PopUpSettings-Width="750px" />
                    <CommandItemSettings AddNewRecordText="Add New Issue" ShowExportToWordButton="false"
                        ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowExportToPdfButton="false" />
                    <NoRecordsTemplate>
                        <div>
                            There are no Issue records to display.
                        </div>
                    </NoRecordsTemplate>
                    <NestedViewTemplate>
                        <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false"
                            BackColor="AliceBlue">
                            <telerik:RadTabStrip runat="server" ID="CLCATab" MultiPageID="CLCAMultiPage" SelectedIndex="0"
                                Skin="Outlook">
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="<u>D</u>efination" AccessKey="D" PageViewID="IssueDefinationView">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="<u>I</u>solation" AccessKey="I" PageViewID="IsolationView">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="<u>R</u>oot Cause" AccessKey="R" PageViewID="RootCauseView">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="<u>C</u>orrective Action" AccessKey="C" PageViewID="CAPAView">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="C<u>l</u>osure" AccessKey="L" PageViewID="ClosureView">
                                    </telerik:RadTab>
                                    <telerik:RadTab runat="server" Text="Con<u>t</u>ainment" AccessKey="T" PageViewID="ContaintmentView">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                            <telerik:RadMultiPage runat="server" ID="CLCAMultiPage" SelectedIndex="0" RenderSelectedPageOnly="false">
                                <asp:Label ID="lblIssueNo" Font-Bold="true" Font-Italic="true" Text='<%# Eval("IssueNo") %>' Visible="false" runat="server" />
                                <telerik:RadPageView runat="server" ID="IssueDefinationView">
                                    <UC:IssueDefination runat="server" ID="ctrlIssueDefination" ActionType="Defination" />
                                </telerik:RadPageView>
                                <telerik:RadPageView runat="server" ID="IsolationView">
                                    <UC:Action runat="server" ID="ctrlIsolationAction" ActionType="Isolation"  />
                                </telerik:RadPageView>
                                <telerik:RadPageView runat="server" ID="RootCauseView">
                                    <UC:Action runat="server" ID="ctrlRootCauseAction" ActionType="RootCause"  />
                                </telerik:RadPageView>
                                <telerik:RadPageView runat="server" ID="CAPAView">
                                    <UC:Action runat="server" ID="ctrlCAPAAction" ActionType="CorrectiveAction"  />
                                </telerik:RadPageView>
                                <telerik:RadPageView runat="server" ID="ClosureView">
                                    <UC:Action runat="server" ID="ctrlClosureAction" ActionType="ClosureAction" />
                                </telerik:RadPageView>
                                <telerik:RadPageView runat="server" ID="ContaintmentView">
                                    <UC:Action runat="server" ID="ctrlContaintmentAction" ActionType="ContaintmentAction"  />
                                </telerik:RadPageView>
                            </telerik:RadMultiPage>
                        </asp:Panel>
                    </NestedViewTemplate>
                    <Columns>
                        <telerik:GridEditCommandColumn ItemStyle-Width="5%" UniqueName="EditCommandColumn"
                         ItemStyle-VerticalAlign="Top" ButtonType="LinkButton">
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="IssueNo"  HeaderText="Issue No"  SortExpression="IssueNo"  HeaderButtonType="TextButton"
                            ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top"
                            CurrentFilterFunction="EqualTo" FilterControlWidth="70px" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Issue"  HeaderText="Issue" SortExpression="Issue" HeaderButtonType="TextButton"
                             ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top"
                             CurrentFilterFunction="EqualTo" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="IssueSummary" HeaderText="Summary"  SortExpression="IssueSummary" HeaderButtonType="TextButton"
                          ItemStyle-Width="15%"  ItemStyle-VerticalAlign="Top"
                          CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn  DataField="IssueDescription"  SortExpression="IssueDescription" HeaderText="Description" HeaderButtonType="TextButton"
                            ItemStyle-Width="23%"  ItemStyle-VerticalAlign="Top"
                            FilterControlWidth="150px" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="IssueStatus" HeaderText="Status" SortExpression="IssueStatus"  HeaderButtonType="TextButton"
                            ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top"
                            CurrentFilterFunction="EqualTo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="IssueOwner" HeaderText="Owner"  SortExpression="IssueOwner"  HeaderButtonType="TextButton"
                            ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top"
                            CurrentFilterFunction="EqualTo">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn DataField="IssueCreateDate"  HeaderText="Issue Create Date"  PickerType="DatePicker" SortExpression="IssueCreateDate"  DataFormatString="{0:MM/dd/yyyy}" HeaderButtonType="TextButton"
                            ItemStyle-Width="12%" ItemStyle-VerticalAlign="Top">
                        </telerik:GridDateTimeColumn>
                        <telerik:GridDateTimeColumn DataField="UpdateDate" HeaderText="Last Updated On"  PickerType="DatePicker"   SortExpression="UpdateDate" DataFormatString="{0:MM/dd/yyyy}" HeaderButtonType="TextButton" 
                             ItemStyle-Width="18%" ItemStyle-VerticalAlign="Top">
                        </telerik:GridDateTimeColumn>
                        <telerik:GridBoundColumn  DataField="IssueReference" UniqueName="IssueReference" SortExpression="IssueReference" HeaderText="Reference No#" HeaderButtonType="TextButton"
                            ItemStyle-Width="13%" ItemStyle-VerticalAlign="Top"
                            CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <a href="#" onclick="openRadWindow('Issue','<%# DataBinder.Eval(Container.DataItem, "IssueNo") %>');return false;">
                                     <img src="~/Images/app/attachment_icon.png" runat="server" enableviewstate="false" alt="Attachments" border="0" />
                                </a>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <EditFormSettings EditFormType="Template" >
                        <FormTemplate>
                            <table cellspacing="0" cellpadding="4" width="100%" border="0" style="background: white;">
                                <tr valign="top">
                                    <td align="center" valign="top" style="width: 95%;">
                                        <table id="TableIssue" cellspacing="1" cellpadding="1" width="100%" border="0"
                                            style="height: 320px;  background: white;">
                                            <tr class="EditFormHeader" valign="top">
                                                <td colspan="4">
                                                     
                                                </td>
                                            </tr>
                                            <tr class="EditFormHeader" valign="top">
                                                <td align="right" class="editFormRow" style="width: 18%">
                                                    Issue :
                                                </td>
                                                <td class="editFormRow" style="width: 20%" align="left" >
                                                    <asp:Label ID="lblIssueType" runat="server" Visible="false"  Text='<%# Bind("Issue") %>'></asp:Label>
                                                    <asp:DropDownList ID="ddIssueType" runat="server" DataValueField="IssueType" DataTextField="IssueType"
                                                        Width="180px" AppendDataBoundItems="True" Style="z-index: 1;">
                                                        <asp:ListItem Selected="True" Text="--Select Process Triggering Issue--" Value=""></asp:ListItem>
                                                    </asp:DropDownList>
                                                    <asp:RequiredFieldValidator  ID="IssueTypeRequired" runat="server" ControlToValidate="ddIssueType"
                                                    CssClass="failureNotification"  ErrorMessage="*" ToolTip="Triggering Issue is required."  ValidationGroup="IssueValidationGroup"
                                                     ></asp:RequiredFieldValidator >
                                                </td>
                                                <td align="right" class="editFormRow" style="width: 18%">
                                                    Issue Owner :
                                                </td>
                                                <td class="editFormRow" style="width: 44%">
                                                    <asp:DropDownList ID="ddIssueOwner" runat="server" DataValueField="UserName" DataTextField="Name"
                                                        Width="200PX" AppendDataBoundItems="True" Style="z-index: 1;">
                                                        <asp:ListItem Selected="True" Text="--Select Issue Owner--" Value=""></asp:ListItem>
                                                    </asp:DropDownList>
                                                    <span style="color: Red">*</span>
                                                    
                                                    <asp:RequiredFieldValidator ID="IssueOwnerRequired" runat="server" ControlToValidate="ddIssueOwner"
                                                    CssClass="failureNotification" ErrorMessage="Issue Owner is required."  ToolTip="Issue Owner is required."
                                                    ValidationGroup="IssueValidationGroup"  ></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <td class="editFormRow" align="right" style="width: 18%">
                                                    Issue Summary :
                                                </td>
                                                <td colspan="3" class="editFormRow" align="left" style="width: 82%">
                                                    <asp:TextBox ID="txtIssueSummary" runat="server" Width="450px" Text='<%# Bind("IssueSummary") %>'></asp:TextBox>
                                                    <span style="color: Red">*</span>
                                                    <asp:RequiredFieldValidator  ID="txtIssueSummaryRequired" runat="server" ControlToValidate="txtIssueSummary"
                                                    CssClass="failureNotification"  ErrorMessage="*" ToolTip="Issue Summary is required."   ValidationGroup="IssueValidationGroup"
                                                     ></asp:RequiredFieldValidator >
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <td class="editFormRow" align="right" style="width: 18%">
                                                    Issue Descriptioin :
                                                </td>
                                                <td colspan="3" class="editFormRow" align="left" style="width: 82%;">
                                                    <asp:TextBox ID="txtIssueDescription" runat="server" TextMode="MultiLine" Width="450px"
                                                        Height="150px" Text='<%# Bind("IssueDescription") %>'></asp:TextBox>
                                                    <span style="color: Red">*</span><asp:RequiredFieldValidator ID="txtIssueDescriptionRequired" runat="server" ControlToValidate="txtIssueDescription"
                                                    CssClass="failureNotification" ErrorMessage="Issue Description is required." ToolTip="Issue Description is required."
                                                    ValidationGroup="IssueValidationGroup" ></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <td class="editFormRow" align="right" style="width: 18%">
                                                    Reference No # :
                                                </td>
                                                <td colspan="3" class="editFormRow" align="left" style="width: 82%">
                                                    <asp:TextBox ID="txtIssueReference" runat="server" Width="450px" Text='<%# Bind("IssueReference") %>'></asp:TextBox>
                                                </td>
                                            </tr>
                                           
                                            <tr valign="top">
                                                <td colspan="1">
                                                      
                                                </td>
                                                <td colspan="3" align="left">
                                                    <asp:Button ID="btnSave" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                                                        CssClass="actionButton" ValidationGroup="IssueValidationGroup"></asp:Button>  
                                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                        CommandName="Cancel" CssClass="actionButton"></asp:Button>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>
        </td>
     </tr>
</table>


MyIssuecontrol.ascx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Diagnostics;
using Telerik.Web.UI;
using CLCA.BusinessLogic;
using System.Collections;
 
 
public partial class Controls_MyIssuesControl : System.Web.UI.UserControl
{
    #region Property & Variables
    IssueManager objIssueManager;
    LookupManager objLookupManager;
 
    public IssueManager ObjIssueManager
    {
        get
        {
            // Init the objIssueManager
            if (this.objIssueManager == null)
                this.objIssueManager = new IssueManager();
            return this.objIssueManager;
        }
    }
    public LookupManager ObjLookupManager
    {
        get
        {
            // Init the objLookupManager
            if (this.objLookupManager == null)
                this.objLookupManager = new LookupManager();
            return this.objLookupManager;
        }
    }
    #endregion
 
    #region User Control Events
    protected void Page_Init(object sender, EventArgs e)
    {
        this.objIssueManager = new IssueManager();
        this.objLookupManager = new LookupManager();
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.ClientEvents.OnRequestStart = "onRequestStart";
    }
 
    #endregion
 
    #region Issue Grid Events
    protected void IssueGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataTable issueData = new DataTable();
        try
        {
            issueData = GetIssueData(string.Empty);
        }
        catch (Exception ex)
        {
            ObjIssueManager.LogMessage(ex.Message + Environment.NewLine + ex.InnerException, Severity.FatalError.ToString(), ex.Source, Layer.UserInterface.ToString());
        }
        
        IssueGrid.DataSource = issueData;
         
    }
 
    protected void IssueGrid_PreRender(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            IssueGrid.Rebind();
            //IssueGrid.MasterTableView.Items[0].Expanded = false;
            //IssueGrid.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = false;
        }
    }
 
    protected void IssueGrid_ItemCommand(object source, GridCommandEventArgs e)
    {
        int issueNo = 0;
        string issueOwner = string.Empty;
 
        if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
        {
            foreach (GridItem item in e.Item.OwnerTableView.Items)
            {
                if (item.Expanded && item != e.Item)
                {
                    item.Expanded = false;
                }
            }
 
            ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible =
                !e.Item.Expanded;
 
            if (!e.Item.Expanded)
            {
                try
                {
                    GridDataItem gridItem = e.Item as GridDataItem;
                    issueOwner = gridItem["IssueOwner"].Text;
                    issueNo = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IssueNo"].ToString());// gridItem["IssueNo"].Text;
 
                    Control ctrlIssueDefination = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlIssueDefination");
                    Control ctrlIsolationAction = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlIsolationAction");
                    Control ctrlRootCauseAction = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlRootCauseAction");
                    Control ctrlCAPAAction = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlCAPAAction");
                    Control ctrlClosureAction = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlClosureAction");
                    Control ctrlContaintmentAction = ((GridDataItem)e.Item).ChildItem.FindControl("ctrlContaintmentAction");
 
                    ((Controls_IssueDefinationControl)ctrlIssueDefination).IssueNo = issueNo;
                    ((Controls_IssueDefinationControl)ctrlIssueDefination).RefreshDataViaParentContainer();
                    ((Controls_MyActionsControl)ctrlIsolationAction).IssueNo = issueNo;
                    ((Controls_MyActionsControl)ctrlRootCauseAction).IssueNo = issueNo;
                    ((Controls_MyActionsControl)ctrlCAPAAction).IssueNo = issueNo;
                    ((Controls_MyActionsControl)ctrlClosureAction).IssueNo = issueNo;
                    ((Controls_MyActionsControl)ctrlContaintmentAction).IssueNo = issueNo;
                }
                catch (Exception ex)
                {
                }
            }
        }
         
    }
 
    protected void IssueGrid_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridNestedViewItem)
        {
            e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
        }
    }
 
    protected void IssueGrid_ItemDataBound(object sender,GridItemEventArgs e)
    {
        bool isTrimmed = false;
        string issueOwner = string.Empty;
        if (e.Item is GridDataItem && e.Item.IsDataBound)
        {
            GridDataItem gridItem = e.Item as GridDataItem;
            
            foreach (GridColumn column in IssueGrid.MasterTableView.RenderColumns)
            {
                isTrimmed = false;
                if (column is GridBoundColumn && (column.UniqueName == "IssueSummary" || column.UniqueName == "IssueDescription"))
                {
                    gridItem[column.UniqueName].ToolTip = gridItem[column.UniqueName].Text;
                    gridItem[column.UniqueName].Text = GridHelper.TrimLongText(gridItem[column.UniqueName].Text, false, out isTrimmed);
                }
                
            }
            issueOwner = gridItem["IssueOwner"].Text;
 
            if (issueOwner != Convert.ToString(Session["CLCAUserName"]))
            {
                LinkButton btnEdit = (LinkButton)gridItem["EditCommandColumn"].Controls[0];
                btnEdit.Visible = false;
            }
 
        }
        
        if (e.Item.OwnerTableView.Name.Equals("IssueList") && e.Item is GridEditFormItem && e.Item.IsInEditMode  )
        {
            if (e.Item.OwnerTableView.IsItemInserted)
            {
                if (e.Item.FindControl("ddIssueType") != null)
                {
                    ((DropDownList)e.Item.FindControl("ddIssueType")).Visible = true;
                }
                if (e.Item.FindControl("lblIssueType") != null)
                {
                    ((Label)e.Item.FindControl("lblIssueType")).Visible = false;
                }
            }
            else
            {
                if (e.Item.FindControl("ddIssueType") != null)
                {
                    ((DropDownList)e.Item.FindControl("ddIssueType")).Visible = false;
                }
                if (e.Item.FindControl("lblIssueType") != null)
                {
                    ((Label)e.Item.FindControl("lblIssueType")).Visible = true;
                }
            }
 
             
            if (e.Item.FindControl("ddIssueType") != null)
            {
                ((DropDownList)e.Item.FindControl("ddIssueType")).DataSource = GetCLCAIssueTypeLookup();
                ((DropDownList)e.Item.FindControl("ddIssueType")).DataBind();
                ((DropDownList)e.Item.FindControl("ddIssueType")).SelectedValue = DataBinder.Eval(e.Item.DataItem, "Issue").ToString();
 
            }
            if (e.Item.FindControl("ddIssueOwner") != null)
            {
                ((DropDownList)e.Item.FindControl("ddIssueOwner")).DataSource = GetCLCAUsersLookup();
                ((DropDownList)e.Item.FindControl("ddIssueOwner")).DataBind();
 
 
                ((DropDownList)e.Item.FindControl("ddIssueOwner")).SelectedValue = string.IsNullOrEmpty(DataBinder.Eval(e.Item.DataItem, "IssueOwner").ToString()) ? Session["CLCAUserName"].ToString() : DataBinder.Eval(e.Item.DataItem, "IssueOwner").ToString();
                 
            }
        }
         
    }
 
    protected void IssueGrid_InsertCommand(object source, GridCommandEventArgs e)
    {
        
        GridEditableItem editedItem = e.Item as GridEditableItem;
        objIssueManager = new IssueManager();
 
        try
        {
            objIssueManager.Issue = (editedItem.FindControl("ddIssueType") as DropDownList).SelectedItem.Value;
            objIssueManager.IssueOwner = (editedItem.FindControl("ddIssueOwner") as DropDownList).SelectedItem.Value;
            objIssueManager.IssueSummary = (editedItem.FindControl("txtIssueSummary") as TextBox).Text.Trim();
            objIssueManager.IssueDescription = (editedItem.FindControl("txtIssueDescription") as TextBox).Text.Trim();
            objIssueManager.IssueReference = (editedItem.FindControl("txtIssueReference") as TextBox).Text.Trim();
            objIssueManager.IssueStatus = IssueStatusEnum.Defination.ToString();
 
            objIssueManager.AddCLCAIssues();
 
        }
        catch (Exception ex)
        {
            ObjIssueManager.LogMessage(ex.Message + Environment.NewLine + ex.InnerException, Severity.FatalError.ToString(), ex.Source, Layer.UserInterface.ToString());
        }
 
         
       IssueGrid.MasterTableView.IsItemInserted = false;
       IssueGrid.Rebind();
    }
 
    protected void IssueGrid_UpdateCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        objIssueManager = new IssueManager();
 
        try
        {
            objIssueManager.IssueNo = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IssueNo"].ToString());
            objIssueManager.Issue = (editedItem.FindControl("lblIssueType") as Label).Text.Trim();
            objIssueManager.IssueOwner = (editedItem.FindControl("ddIssueOwner") as DropDownList).SelectedItem.Value;
            objIssueManager.IssueSummary = (editedItem.FindControl("txtIssueSummary") as TextBox).Text.Trim();
            objIssueManager.IssueDescription = (editedItem.FindControl("txtIssueDescription") as TextBox).Text.Trim();
            objIssueManager.IssueReference = (editedItem.FindControl("txtIssueReference") as TextBox).Text.Trim();
             
 
            objIssueManager.UpdateCLCAIssues();
 
        }
        catch (Exception ex)
        {
            ObjIssueManager.LogMessage(ex.Message + Environment.NewLine + ex.InnerException, Severity.FatalError.ToString(), ex.Source, Layer.UserInterface.ToString());
        }
 
 
        IssueGrid.MasterTableView.IsItemInserted = false;
        IssueGrid.Rebind();
    }
 
     #endregion
 
    #region Action Grid Events
    #endregion
 
    #region Private Funcations
    private void SetProtectionLevel()
    {
    }
 
    #endregion
 
    #region Public Functions
 
    /// <summary>
    ///
    /// </summary>
    /// <param name="searchCriteria"></param>
    /// <returns></returns>
    public DataTable GetIssueData(string searchCriteria)
    {
        return ObjIssueManager.GetCLCAIssues(searchCriteria);
    }
    public DataTable GetCLCAIssueTypeLookup()
    {
        return objLookupManager.CLCAIssueTypeLookup();
    }
    public DataTable GetCLCAUsersLookup()
    {
        return objLookupManager.CLCAUsersLookup();
    }
 
     
    #endregion
 
}

Master Page

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="CLCALayout.master.cs" Inherits="CLCALayout" %>
<%@ Register src="Controls/BannerControl.ascx" TagName="Banner" TagPrefix="UC"  %>
<%@ Register src="Controls/TopNavControl.ascx" TagName="TopNav" TagPrefix="UC"  %>
 
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head" runat="server">
    <title>CLCA</title>       
    <link href="../CSS/Site.css" rel="stylesheet" type="text/css"  />
    <script type="text/javascript">
 
        var panelarray = new Array();
        var shortpanelarray = new Array();
 
        function setLongScrollingPanels(longPanelNames) {
            var panellist = longPanelNames.split(",");
            for (i = 0; i < panellist.length; i++) {
                panelarray[i] = document.getElementById(panellist[i]);
            }
        }
 
        function setShortScrollingPanels(shortPanelNames) {
            var panellist = shortPanelNames.split(",");
            for (i = 0; i < panellist.length; i++) {
                shortpanelarray[i] = document.getElementById(panellist[i]);
            }
        }
 
        function setPanelWidths(strPageSizeTheme, strNavBarMode) {
            var longPanelWidth;
            var shortPanelWidth;
            var bodyContentWidth;
 
            var containerWidth = document.getElementById("divWrapper").clientWidth - 30;
            if (strPageSizeTheme == "flexible") {
                bodyContentWidth = (strNavBarMode == "expanded") ? (containerWidth - 240) : (containerWidth - 40); //TODO:adjust width
                longPanelWidth = (strNavBarMode == "expanded") ? (containerWidth - 260) : (containerWidth - 60); //TODO:adjust width
                shortPanelWidth = (strNavBarMode == "expanded") ? ((containerWidth - 280) * 0.50) : ((containerWidth - 80) * 0.50); //TODO:adjust width
 
                bodyContentWidth = bodyContentWidth + "px";
                longPanelWidth = longPanelWidth + "px";
                shortPanelWidth = shortPanelWidth + "px";
            }
            else {
                bodyContentWidth = (strNavBarMode == "expanded") ? "76%" : "96%";
                longPanelWidth = (strNavBarMode == "expanded") ? "700px" : "890px";
                shortPanelWidth = (strNavBarMode == "expanded") ? "350px" : "430px";
            }
 
            for (i = 0; i < panelarray.length; i++) {
                if (panelarray[i] != null)
                    panelarray[i].style.width = longPanelWidth;
            }
 
            for (i = 0; i < shortpanelarray.length; i++) {
                if (shortpanelarray[i] != null)
                    shortpanelarray[i].style.width = shortPanelWidth;
            }
 
            document.getElementById("tdBodyContent").style.width = bodyContentWidth;
 
        }
 
        function hideLeftMenu() {
            document.getElementById("tdLeftNavBar").style.display = "none";
            document.getElementById("tdCollapsedLeftNavBar").style.display = "block";
 
            document.getElementById("hiddenNavBarMode").value = "collapsed";
 
            setPanelWidths(document.getElementById("hiddenPageSizeMode").value, "collapsed");
            document.getElementById("tdCollapsedLeftNavBar").style.width = "17px";
 
            CallServer("Navbarcollapsed", "");
        }
 
        function showLeftMenu() {
            document.getElementById("tdLeftNavBar").style.display = 'block';
            document.getElementById("tdCollapsedLeftNavBar").style.display = 'none';
            document.getElementById("hiddenNavBarMode").value = "expanded";
            setPanelWidths(document.getElementById("hiddenPageSizeMode").value, "expanded");
            document.getElementById("tdLeftNavBar").style.width = '216px';
 
            CallServer("Navbarexpanded", "");
        }
 
        function initializeMasterPageLayout(strPageSizeTheme, strBannerMode,  strLongPanelNames, strShortPanelNames, strApplicationURL) {
            document.getElementById("hiddenApplicationURL").value = strApplicationURL;
 
            document.getElementById("hiddenPageSizeMode").value = strPageSizeTheme;
            document.getElementById("hiddenNavBarMode").value = "";
            document.getElementById("hiddenLongPanels").value = strLongPanelNames;
            document.getElementById("hiddenShortPanels").value = strShortPanelNames;
            document.getElementById("hiddenBannerMode").value = strBannerMode;
 
            if (strPageSizeTheme == "flexible")
                document.getElementById("divWrapper").style.width = "95%";
            else
                document.getElementById("divWrapper").style.width = "970px";
 
            if (strLongPanelNames != "") {
                setLongScrollingPanels(strLongPanelNames);
            }
            if (strShortPanelNames != "") {
                setShortScrollingPanels(strShortPanelNames);
            }
 
           
 
            if (strBannerMode == "expanded")
                expandBanner();
            else
                collapseBanner();
        }
 
        function ReceiveServerData(arg, context) {
            //alert(arg);
        }
 
        function openRadAlert(alertContentControlID, alertTitle) {
            window.setTimeout(function () { radalert(document.getElementById(alertContentControlID).value, 427, 340, alertTitle); }, 0);
            return false;
        }
 
        function openRadWindow(targetURL, windowName, windowTitle) {
            var oWindow = window.radopen(document.getElementById("hiddenApplicationURL").value + targetURL, windowName);
            //oWindow.SetSize(400, 400);
            //oWindow.SetTitle(windowTitle);
            return false;
        }
        </script>
</head>
<body id="main" runat="server">
    <form id="frmMasterForm" runat="server" defaultbutton="btnPageDefaultDisabled">
    <asp:ScriptManager ID="MasterScriptManager" runat="server"></asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
    </telerik:RadAjaxManager>
    <div id="divWrapper" class="container-wrapper">
         <div class="container">
             <input id="hiddenApplicationURL" type="hidden" name="hiddenApplicationURL" value="" />
             <input id="hiddenNavBarMode" type="hidden" name="hiddenNavBarMode" value="" />
             <input id="hiddenBannerMode" type="hidden" name="hiddenBannerMode" value="" />
             <input id="hiddenPageSizeMode" type="hidden" name="hiddenPageSizeMode" value="" />
             <input id="hiddenShortPanels" type="hidden" name="hiddenShortPanels" value="" />
             <input id="hiddenLongPanels" type="hidden" name="hiddenLongPanels" value="" />
             <asp:Button ID="btnPageDefaultDisabled" style="display:none;" OnClientClick = "return false;" runat="server"/>
            <div class="banner">
              <UC:Banner runat="server" ID="ctrlBanner" />
            </div>
            <asp:Panel runat="server" ID="pnlTopNavBar" CssClass="banner">
                    <UC:TopNav runat="server" ID="ctrlTopNav" />
            </asp:Panel>
            <table id="tblMainBody" class="mainbody" cellpadding="0" cellspacing="0" border="0">
                   <tr valign="top">
                        <td class="sectionspacer">
                            <asp:Image ID="imgSpacer1" runat="server" ImageUrl="~/Images/master/sectionspacer.png" />
                        </td>
                        <td id="tdBodyContent" class="bodyContent" valign="top">
                            <div>
                                <asp:Panel ID="pnlAlertMsg" runat="server" Visible="false">
                                    <asp:Label ID="lblAlertMessage" runat="server" Text="" CssClass="contentLabel" Visible="false" />
                                </asp:Panel>
                                <asp:ContentPlaceHolder ID="bodyContentHolder" runat="server">
                                </asp:ContentPlaceHolder>
                            </div>
                        </td>
                        <td class="sectionspacer">
                            <asp:Image ID="imgSpacer2" runat="server" ImageUrl="~/Images/master/sectionspacer.png" />
                        </td>
                    </tr>
             </table>
             <div class="footer">
                <table width="100%" >
                    <tr>
                       
                        <td >
                             
                        </td>
                    </tr>
                    <tr>
                        
                        <td >
                            Maintained By:
                            <asp:Label runat="server" ID="lblMaintainedBy" Text="<Maintained By>" />
                            <b class="headfieldseparator">| </b>Business Owner:
                            <asp:Label runat="server" ID="lblBusinessOwner" Text="<yyyy-mon-dd>" />
                            <b class="headfieldseparator">| </b>Last Modified:
                            <asp:Label runat="server" ID="lblLastModified" Text="<yyyy-mon-dd>" />
                        </td>
                    </tr>
                </table>
              </div>
        </div>
    </form>
</body>
</html>

MyDashboard Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/CLCALayout.master" AutoEventWireup="true" CodeFile="MyDashboard.aspx.cs" Inherits="MyDashboard" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<%@ Register src="Controls/ChartControl.ascx" TagName="Chart" TagPrefix="UC"  %>
<%@ Register src="Controls/MyIssuesControl.ascx" TagName="Issue" TagPrefix="UC"  %>
<%@ Register src="Controls/MyActionsControl.ascx" TagName="Action" TagPrefix="UC"  %>
<asp:Content ID="bodyContent" ContentPlaceHolderID="bodyContentHolder" Runat="Server" >
<table width="100%">
    <tr>
        <td style="width:100%">
            <telerik:RadPanelBar ID="radpnlChartList" CausesValidation="False" runat="server" Width="100%" ExpandAnimation-Type="InOutQuad" style="vertical-align:top" >
                <Items>
                    <telerik:RadPanelItem runat="server" Text="My Chart" Expanded="True" AccessKey="C" >
                        <Items>
                             <telerik:RadPanelItem runat="server" Text="" Value="details" >
                                <ItemTemplate>
                                    <table class="pageBackground" width="100%">
                                        <tr>
                                            <td align="center" style="width:100%">
                                               <UC:Chart runat="server" ID="ctrlChart" />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
        </td>
    </tr>
     <tr>
        <td style="width:100%">
            <telerik:RadPanelBar ID="radpnlMyIssueAction" CausesValidation="False" runat="server" Width="100%" style="vertical-align:top">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="My Issues and Action" Expanded="True" AccessKey="M"  >
                        <Items>
                             <telerik:RadPanelItem runat="server" Text="" Value="details"  style="vertical-align:top">
                                <ItemTemplate >
                                    <table class="pageBackground" width="100%"  style="vertical-align:top"  >
                                        <tr>
                                            <td  align="center" style="vertical-align:top">
                                                <table width="100%" style="vertical-align:top" >
                                                    <tr>
                                                        <td align="left" style="vertical-align:top;">
                                                              <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Outlook" SelectedIndex="0" MultiPageID="RadMultiPage1" Align="Justify" style="Width:700px;float:left"   >
                                                                <Tabs>
                                                                    <telerik:RadTab Text="My <u>I</u>ssues" Width="150px" AccessKey="I">
                                                                    </telerik:RadTab>
                                                                    <telerik:RadTab Text="My <u>A</u>ctions" Width="150px" AccessKey="A">
                                                                    </telerik:RadTab>
                                                                </Tabs>
                                                            </telerik:RadTabStrip>                                       
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left"  style="vertical-align:top">
                                                            <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0"
                                                                Width="100%" CssClass="multiPage" ScrollBars="Auto" Height="450">
                                                                <telerik:RadPageView runat="server" ID="RadPageView1" CssClass="corporatePageView">
                                                                   <UC:Issue runat="server" ID="ctrlMyIssue" />
                                                                </telerik:RadPageView>
                                                                <telerik:RadPageView runat="server" ID="RadPageView2" CssClass="corporatePageView">
                                                                   <UC:Action runat="server" ID="ctrlMyActions" />
                                                                </telerik:RadPageView>
                                                            </telerik:RadMultiPage>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                              
                                    </table>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
        </td>
    </tr>
</table>
</asp:Content>


Tsvetina
Telerik team
 answered on 04 May 2011
1 answer
215 views
I am tring to rotate through my radgrid to get the information  to save. The insert works fine becuase I can response.write my sql statement and it goes in fine.  I gets through one rotation and then seems to break the second time around.  I don't get it, it seems to work but does not work.

Here is my Ragrid.
 <td><telerik:RadGrid ID="myGridDental" runat="server" Width="100%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040">
                                                            <MasterTableView AutoGenerateColumns="false" DataKeyNames="intQuestionId" HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerBind"
                                                                BorderColor="#404040" Font-Size="12" Font-Names="Veranda,arial,sans-serif" HeaderStyle-HorizontalAlign="Center"
                                                                GridLines="Both" BorderWidth="1px" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png"
                                                                ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                                <AlternatingItemStyle BackColor="#B0C4DE" />
                                                                <HeaderStyle ForeColor="White" CssClass="backColor" BackColor="Steelblue" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                                                <Columns>
                                                                    <telerik:GridBoundColumn DataField="strQuestion" HeaderText="Question" />
                                                                    <telerik:GridTemplateColumn HeaderText="Help">
                                                                         <ItemTemplate>
                                                                            <asp:HyperLink ID="hylAttach" runat="server" ImageUrl="~/Images/paperclip.png" NavigateUrl='<%# bind("strUrl") %>' Target="_blank"
                                                                            Visible='<%# Not String.IsNullOrEmpty(Eval("strUrl")) %>' />
                                                                         </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn HeaderText="GO\NOGO">
                                                                        <ItemTemplate>
                                                                            <asp:RadioButtonList ID="rblDental" runat="server" RepeatDirection="Horizontal" CellPadding="5" CellSpacing="5" TextAlign="Right">
                                                                                <asp:ListItem Value="0" Text="GO" />
                                                                                <asp:ListItem Value="1" Text="NO\GO" />
                                                                            </asp:RadioButtonList>
                                                                            <asp:RequiredFieldValidator ID="valDRadio" runat="server" ControlToValidate="rblDental" ErrorMessage="Not Answered" ForeColor="Red" ValidationGroup="Dental" />
                                                                        </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn HeaderText="Data">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="txtData" runat="server" Width="60" />
                                                                        </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn HeaderText="Remarks">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="txtRemarks" runat="server" Width="200" />
                                                                        </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                    <telerik:GridTemplateColumn HeaderText="Record Date">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="txtCal" runat="server" Width="100" style="cursor:pointer" />
                                                                            <asp:CalendarExtender ID="txtCal_CalendarExtender" runat="server" TargetControlID="txtCal" />
                                                                        </ItemTemplate>
                                                                    </telerik:GridTemplateColumn>
                                                                </Columns>
                                                                <DetailTables>
                                                                    <telerik:GridTableView Name="mySubDental" runat="server" DataKeyNames="intQuestionId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="12" AutoGenerateColumns="False"
                                                                        HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both">
                                                                        <ParentTableRelation>
                                                                            <telerik:GridRelationFields DetailKeyField="intQuestionId" MasterKeyField="intQuestionId" />
                                                                        </ParentTableRelation>
                                                                        <HeaderStyle ForeColor="White" BackColor="SteelBlue" Font-Bold="true" HorizontalAlign="Center" />
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn DataField="strTaskName" HeaderText="Task" />
                                                                            <telerik:GridBoundColumn DataField="dtFound" HeaderText="Date" />
                                                                            <telerik:GridBoundColumn DataField="strNotes" HeaderText="Remarks" />
                                                                        </Columns>
                                                                    </telerik:GridTableView>
                                                                </DetailTables>
                                                            </MasterTableView>
                                                        </telerik:RadGrid></td>
                                                    </tr>
                                                     <tr>
                                                        <td><asp:LinkButton ID="lnkSubmitDental" runat="server" ValidationGroup="Dental">Submit</asp:LinkButton></td>
                                                    </tr>
                                                </table>

Here is my code behind, it gets through one loop and then breaks and give me this error.

Object reference not set to an instance of an object.   and then point to my sql statement.

 Protected Sub lnkSubmitDental_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSubmitDental.Click
        Dim userlogon As String = Split(Current.User.Identity.Name, "\")(1)
        Dim lblErrorMsg As Label = DirectCast(Me.Master.FindControl("lblErrorMsg"), Label)
        Dim aError As HtmlAnchor = DirectCast(Me.Master.FindControl("aError"), HtmlAnchor)
        Dim lblError As Label = DirectCast(Me.Master.FindControl("lblError"), Label)
        Dim PersId As String = HFID.Value
        Dim AttendId As String = HFAttendID.Value

        For Each item As GridDataItem In myGridDental.Items
            Dim QuesId As Integer = myGridDental.Items(item.ItemIndex).GetDataKeyValue("intQuestionId")
            Dim data As TextBox = (TryCast(item.FindControl("txtData"), TextBox))
            Dim Remarks As TextBox = TryCast(item.FindControl("txtRemarks"), TextBox)
            Dim Dtdate As TextBox = TryCast(item.FindControl("txtCal"), TextBox)
            Dim answer As RadioButtonList = TryCast(item.FindControl("rblDental"), RadioButtonList)

            sql = "Insert tblSRpEventData (intPersonnelId, intSRPAttendId, intQuestionId, intAnswer, strData, strRemarks, strDocDate, dtLogged, strlogged) VALUES ('" & PersId & "',  " & AttendId & ", " _
                & "" & QuesId & ", " & answer.SelectedValue & " , '" & Replace(data.Text, "'", "") & "', '" & Replace(Remarks.Text, "'", "") & "', '" & Replace(Dtdate.Text, "'", "") & "', '" & Date.Today & "', " _
                & "'" & userlogon & "')"
           
            Try
                insertUpdateDelete(sql)
            Catch ex As Exception
                lblError.Text = ex.Message.ToString & " - ERROR Save Dental   <br> " & lblErrorMsg.Text
                SetFocus(aError)
            End Try
        Next

    End Sub

Iana Tsolova
Telerik team
 answered on 04 May 2011
1 answer
84 views
Hi Team,
               I'm using Telerik Grid. inside it i'm having CheckboxList in Edit Item Template. also i'm using RadGrid EditTemplate()function to populate the values to Drop down and Checkboxlist controls. these are the dynamic controls.

My Grid is showing the data in below format. The Available Location is Checkbox list control and Format is DropDownlist control. both are EdititemTemplate controls.         

Emp Id

Emp Name

Emp Type

Available Location

Format

1001

Alexis

Permanent

New York

$##,###,###.00

1002

Michel

Permanent

New Jersey

$##,##.00

1003

Erin Smith

Permanent

Philadelphia

$##,##

1004

Brown Liza

Temporary

Los Angels

Mmm/yyyy




The Expected Grid is attached here. and the Checkboxlist items status has to be maintain between postbacks. every time i'm updating the Grid values using the concept of Auto Save(http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx ) . and every time when i tried to save the grid line, it take me to RadGrid1_EditTemplate() function.


Please tell me how to taggle this situation.
Please reply ASAP.


Thanks
Alexis

Iana Tsolova
Telerik team
 answered on 04 May 2011
3 answers
925 views
Hi all, I am having trouble with the visible property of an  GridTemplateColumn.

I have an AutoGenerated EditType edit screen because of the dynamic nature of the requirement. I have added a necessary dropdown onto this edit area by adding an GridTemplateColumn to the <Columns> area of the radgrid.

I need this GridTemplateColumn to only be visible under certain circumstances but I have no luck. Setting the visible property = "false" in the tag itself does not work. Nor does setting the .Display, .ReadOnly or .Visible properties in the code behind. I have tried hooking into the column in both ItemDataBound and PreRender events. I have tried finding the column from the MasterTable and other methods as well.

Every time I find the column correctly (verified by debugging the UniqueName) but the column is always visible.

I tried adding a label inside the GridTemplateColumn and set EditFormHeaderTextFormat to an empty string but the column space is reserved and thus my label is indented.

A solution to either would solve this issue. Need some help please!

Thanks :)

EDIT - My column is of type EditItemTemplate so that it shows on the Edit Form. If I change it to ItemTemplate I am able to make the column Visible = false
Brad
Top achievements
Rank 1
 answered on 04 May 2011
1 answer
102 views
Hi ,
I was tring to select TreeListDataItem dynamically using the following code.

foreach (TreeListDataItem item in RadTreeList1.Items)
                {
                    if (value != null && value.Count > 0)
                    {
                        foreach (Facility facility in value.Facility)
                        {
                            if (item["Key"].Text == facility.Key)
                            {
                                item.Selected = true;
                                break;
                            }
                        }
                    }
                }

However what I found that the only the parent items can be selected.
I am not able to select any of the child or sub child items.
Please advice what the best way to select any child items if they need to be selected.

Thanks in advance.

Veli
Telerik team
 answered on 04 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?