Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
184 views
Hi,

I have RadPanelbar (populating from database) and inside each panelbar item I am loading a radgrid (which is in usercontrol) with unique parameters for each panelbar item. The Grid contains few hundred records, and I am using radwindow to insert/edit items in the radgrid.

In this case, How can I improve the performance for the Panelbar with load on demand feature?


Thanks

Sunny
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
145 views
Date picker gets cut off horizontally in TimelineView when there are no appointments in the calendar.
Does anybody know a fix for this?

Toi Wright
Top achievements
Rank 1
 answered on 29 Oct 2009
2 answers
150 views
I have a RadToolTipManager set up with AutoTooltipify to change all of my tooltips to be RadToolTips.  These have no particular sizes because they are all the small img alts, etc.

Now I have the need to take a particular ToolTip and make the size 400x350 with scrolling but I am finding that the ToolTip is still falling under the RadToolTipManager. 

Any suggestions on a work around?
Christian
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
198 views
Hi Telrik Guys !

 I have deployed my application on to the SERVER.

 When I try to create an FOLDER withan application Iam getting the following exception :-

FileSystem's restriction: The directory '" + virtualTargetPath + "' cannot be created!";  

But , when I try to create a FOLDER within an application(within  LOCAL END), Iam able to CREATE a FOLDER.

Could you guys please suggest me whether there are some permissions issues for the folder or any other problem that exists on to the server.

Please help.

Ajay Jamwal
Fiko
Telerik team
 answered on 29 Oct 2009
4 answers
183 views
Hi.

The company I am working uses the RadNumericInput control with it's language set to Danish (Denmark). We need to allow the users to type in the group/thousands separator (i.e., comma - 1.750,75). However, the control only allows the input of the decimal symbol. Is there a way to let the users type in the group/thousands separator because it is part of the requirement of the application?

Thanks for your reply in advance.
Veli
Telerik team
 answered on 29 Oct 2009
1 answer
149 views
Hi,

A. I bound a radGrid control to a custom collection called FactoryList(of Tkey).
B. The FactoryList control derived from BindingList (of Tkey) and implements ITypedList as follow:
    1. The GetItemProperties return a collection of ColumnPropertyDescriptor objects, each is derived from PropertyDescriptor class
    2. The ColumnPropertyDescriptor class exposes information based on DataColumn meta-data i.e. ColumnName, ColumnType, and also handle SetValue and Get Value methods.
 
C. A FactoryList instance contains objects that are derived from a base class called BaseEntity. The BaseEntity class implements

ICustomTypeDescriptor, where the GetItemProperties retruns a collection of ColumnPropertyDescriptor same as the FactoryList class does.
D. I use the NeedDataSource event to bind the FactoryList to the radGrid  


All works fine, till I sort the grid rows by clicking on one of the grid column headers. In that case I got the following error:

No property or field 'LST_NAME' exists in type 'Object'  

 -  'LST_NAME' is one the columns I was trying to sort


radGrid:

<

 

telerik:RadGrid ID="grdCustomLists" runat="server" AllowPaging="True"

 

 

    AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"

 

 

    AutoGenerateEditColumn="True" GridLines="None"

 

 

    DataMember="esmBOA.SystemList">

 

<

 

MasterTableView CommandItemDisplay="Top" DataKeyNames="LST_ID" EditMode="InPlace"

 

 

    DataMember="esmBOA.SystemList">

 

 

<CommandItemSettings AddNewRecordText="New List" />

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="LST_ID" HeaderText="LST_ID" ReadOnly="True"

 

 

SortExpression="LST_ID" UniqueName="LST_ID" Visible="False"

 

 

Display="False">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LST_NAME" HeaderText="Name"

 

 

SortExpression="LST_NAME" UniqueName="LST_NAME">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="LST_DSC" HeaderText="Description"

 

 

SortExpression="LST_DSC" UniqueName="LST_DSC">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="LST_IS_SYSTEM" DataType="System.Boolean"

 

 

HeaderText="LST_IS_SYSTEM" SortExpression="LST_IS_SYSTEM"

 

 

UniqueName="LST_IS_SYSTEM" Visible="False" Display="False" ReadOnly="True">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridCheckBoxColumn DataField="LST_CAN_EDIT" DataType="System.Boolean"

 

 

HeaderText="LST_CAN_EDIT" SortExpression="LST_CAN_EDIT"

 

 

UniqueName="LST_CAN_EDIT" Visible="False" Display="False" ReadOnly="True">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridCheckBoxColumn DataField="LST_CAN_DELETE"

 

 

DataType="System.Boolean" HeaderText="LST_CAN_DELETE"

 

 

SortExpression="LST_CAN_DELETE" UniqueName="LST_CAN_DELETE"

 

 

Visible="False" Display="False" ReadOnly="True">

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridCheckBoxColumn DataField="LST_IS_DELETED"

 

 

DataType="System.Boolean" HeaderText="LST_IS_DELETED"

 

 

SortExpression="LST_IS_DELETED" UniqueName="LST_IS_DELETED"

 

 

Visible="False" Display="False" ReadOnly="True">

 

 

</telerik:GridCheckBoxColumn>

 

 

</Columns>

 

</

 

MasterTableView>

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

 

ColumnPropertyDescriptor Class (VB) - SystemField class stores the DataColumn meta-data

Public

 

Class ColumnPropertyDescriptor

 

 

Inherits System.ComponentModel.PropertyDescriptor

 

#Region

 

"Attributes"

 

 

    Private _column As SystemField

 

#End

 

Region

 

#Region

 

"Constractor"

 

 

 

Public Sub New(ByVal column As SystemField)

 

 

        MyBase.New(column.ColumnName, Nothing)

 

        _column = column

 

End Sub

 

#End

 

Region

 

#Region

 

"Properties"

 

 

Public Property Column() As SystemField

 

 

Get

 

 

    Return _column

 

 

End Get

 

 

Set(ByVal value As SystemField)

 

_column = value

 

End Set

 

 

End Property

 

#End

 

Region

 

#Region

 

"PropertyDescriptor Overrides"

 

#Region

 

"Properties"

 

 

Public Overrides ReadOnly Property Converter() As System.ComponentModel.TypeConverter

 

 

Get

 

 

    Return ComponentModel.TypeDescriptor.GetConverter(Me.PropertyType)

 

 

End Get

 

 

End Property

 

 

Public Overrides ReadOnly Property DisplayName() As String

 

 

Get

 

 

    Return _column.Properties.Caption

 

 

End Get

 

 

End Property

 

 

Public Overrides ReadOnly Property Name() As String

 

 

Get

 

 

    Return _column.ColumnName

 

 

End Get

 

 

End Property

 

 

Public Overrides ReadOnly Property ComponentType() As System.Type

 

 

Get

 

 

    Return Me.PropertyType

 

 

End Get

 

 

End Property

 

 

Public Overrides ReadOnly Property IsReadOnly() As Boolean

 

 

Get

 

 

    Return _column.Properties.IsEdit

 

 

End Get

 

 

End Property

 

 

Public Overrides ReadOnly Property PropertyType() As System.Type

 

 

Get

 

 

    Return _column.SystemColumnType

 

 

End Get

 

 

End Property

 

#End

 

Region

 

#Region

 

"Public Methods"

 

 

Public Overrides Function CanResetValue(ByVal component As Object) As Boolean

 

 

    Return False

 

 

End Function

 

 

 

Public Overrides Function GetValue(ByVal component As Object) As Object

 

 

 

    Dim item As BaseEntity = CType(component, BaseEntity)

 

 

    Return item.Field(Me._column.ColumnName)

 

 

End Function

 

 

 

 

Public Overrides Sub ResetValue(ByVal component As Object)

 

 

    Throw New NotImplementedException

 

 

End Sub

 

 

Public Overrides Sub SetValue(ByVal component As Object, ByVal value As Object)

 

 

    Dim item As BaseEntity = CType(component, BaseEntity)

 

    item.Field(

Me._column.ColumnName) = value ' value is stored in a key dictionary

 

 

End Sub

 

 

Public Overrides Function ShouldSerializeValue(ByVal component As Object) As Boolean

 

 

    Return False

 

 

End Function

 

#End

 

Region

 

 

#End

 

Region

 

End

 

Class

 



BaseEntity Class:

Imports

 

System.ComponentModel

 

Public

 

Class BaseEntity

 

 

        Implements ICustomTypeDescriptor

 

#Region

 

"Data Members"

 

 

Private _dataItem As Connectivity.DataItem

 

 

Private _values As New Dictionary(Of String, Object)

 

 

Private _originalID As String

 

 

Private _originalVTS As Date

 

 

Private _isNew As Boolean = False

 

 

Private _isModified As Boolean = False

 

 

Private _PropertyCollection As PropertyDescriptorCollection = New PropertyDescriptorCollection(Nothing)

 

#End

 

Region

 

#Region

 

"Constractor"

 

 

Public Sub New(ByRef DataItem As esmOPM.Connectivity.DataItem, ByVal fetchLevel As esmOPM.FetchLevel, ByVal entityDataRow As DataRow)

 

    _dataItem = DataItem

 

    If IsNothing(entityDataRow) Then

 

        _isNew =

True

 

 

        ' create empty dictionary

 

 

        For Each sf In _dataItem.Fields(fetchLevel)

 

            _values.Add(sf.ColumnName,

Nothing)

 

            _PropertyCollection.Add(

New ColumnPropertyDescriptor(sf))

 

 

    Next sf

 

 

Else

 

        _isNew =

False

 

 

        ' parse row-dara values

 

 

        For Each sf In _dataItem.Fields(fetchLevel)

 

        _values(sf.ColumnName) = entityDataRow(sf.ColumnName)

        _PropertyCollection.Add(

New ColumnPropertyDescriptor(sf))

 

 

    Next

 

    _originalID = entityDataRow(_dataItem.PKFieldName).ToString

    _originalVTS = entityDataRow(_dataItem.VTSFieldName)

 

End If

 

 

End Sub

 

#End

 

Region

 

#Region

 

"Public Data Properties"

 

 

Public Property Field(ByVal columnName As Object) As Object

 

 

Get

 

 

        Return _values(columnName)

 

 

End Get

 

 

Set(ByVal value As Object)

 

    _setFieldValue(columnName, value)

 

End Set

 

 

End Property

 

 

Public ReadOnly Property ID() As String

 

 

Get

 

 

    Return _values(_dataItem.PKFieldName).ToString

 

 

End Get

 

 

End Property

 

 

Public Property IsNew() As Boolean

 

 

Get

 

 

    Return _isNew

 

 

End Get

 

 

Set(ByVal value As Boolean)

 

    _isNew = value

 

End Set

 

 

End Property

 

 

Public Property IsModified() As Boolean

 

 

Get

 

 

    Return _isModified

 

 

End Get

 

 

Set(ByVal value As Boolean)

 

    _isModified = value

 

End Set

 

 

End Property

 

#End

 

Region

 

#Region

 

"Internal Properties"

 

 

Friend ReadOnly Property Original_ID() As String

 

 

Get

 

 

    Return _originalID

 

 

End Get

 

 

End Property

 

 

Friend ReadOnly Property Original_VTS() As Date

 

 

Get

 

 

    Return _originalVTS

 

 

End Get

 

 

End Property

 

#End

 

Region

 

#Region

 

"Public Methods"

 

 

Public Sub ParseValues(ByVal valuesDisctionary As Dictionary(Of String, Object))

 

 

    For Each de In valuesDisctionary

 

 

        Me.Field(de.Key) = de.Value

 

 

    Next de

 

 

End Sub

 

 

 

#End

 

Region

 

#Region

 

"Private Methods"

 

 

Private Sub _setFieldValue(ByVal columnName As String, ByVal value As Object)

 

 

        ' store old values

 

 

        If Not (_isNew) AndAlso columnName = _dataItem.PKFieldName Then

 

        _originalID =

Me.Field(columnName).ToString

 

 

        End If

 

 

        If Not (_isNew) AndAlso columnName = _dataItem.VTSFieldName Then

 

        _originalVTS =

CDate(Me.Field(columnName))

 

 

        End If

 

 

        ' set current value

 

    _values(columnName) = value

 

    ' mark this object as being modified

 

    _isModified =

True

 

 

    ' set new timestamp value

 

    _values(_dataItem.VTSFieldName) = Now()

 

End Sub

 

 #End

 

Region

 

 

Public Function GetAttributes() As System.ComponentModel.AttributeCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetAttributes

 

 

    Return New System.ComponentModel.AttributeCollection(Nothing)

 

 

End Function

 

 

Public Function GetClassName() As String Implements System.ComponentModel.ICustomTypeDescriptor.GetClassName

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetComponentName() As String Implements System.ComponentModel.ICustomTypeDescriptor.GetComponentName

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetConverter() As System.ComponentModel.TypeConverter Implements System.ComponentModel.ICustomTypeDescriptor.GetConverter

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetDefaultEvent() As System.ComponentModel.EventDescriptor Implements System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetDefaultProperty() As System.ComponentModel.PropertyDescriptor Implements System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetEditor(ByVal editorBaseType As System.Type) As Object Implements System.ComponentModel.ICustomTypeDescriptor.GetEditor

 

 

    Return Nothing

 

 

End Function

 

 

Public Function GetEvents() As System.ComponentModel.EventDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetEvents

 

 

    Return New EventDescriptorCollection(Nothing)

 

 

End Function

 

 

Public Function GetEvents(ByVal attributes() As System.Attribute) As System.ComponentModel.EventDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetEvents

 

 

    Return New EventDescriptorCollection(Nothing)

 

 

End Function

 

 

Public Function GetProperties() As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetProperties

 

 

    Return _PropertyCollection

 

 

End Function

 

 

Public Function GetProperties(ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetProperties

 

 

    Return _PropertyCollection

 

 

End Function

 

 

Public Function GetPropertyOwner(ByVal pd As System.ComponentModel.PropertyDescriptor) As Object Implements System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner

 

 

    Return Me

 

 

End Function

 

End

 

Class

and finally ... FactoryList Class:

 

Imports

 

System.ComponentModel

 

 

 

Imports

 

esmOPM.Connectivity

 

 

 

Public

 

Class esmList(Of Tkey)

 

 

    Inherits BindingList(Of Tkey)

 

 

    Implements ITypedList

 

 

 

 

#Region

 

"Data Members"

 

 

 

 

 

Private _PropertyCollection As PropertyDescriptorCollection = New PropertyDescriptorCollection(Nothing)

 

 

 

#End

 

Region

 

#Region

 

"Properties"

 

 

 

 

 

Friend WriteOnly Property Fields() As List(Of SystemField)

 

 

Set(ByVal value As List(Of SystemField))

 

 

 

End Set

 

 

 

 

 

End Property

 

#End

 

Region

 

#Region

 

"Constractors"

 

 

 

 

 

 

Public Sub New(ByVal fields As List(Of SystemField))

 

 

    MyBase.New()

 

 

    ' init propertyCollection

 

 

 

 

    _PropertyCollection.Clear()

 

    For Each sf In fields

 

        _PropertyCollection.Add(

New ColumnPropertyDescriptor(sf))

 

 

    Next sf

 

 

End Sub

 

#End

 

Region

 

 

 

 

 

Public Function GetItemProperties(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As System.ComponentModel.PropertyDescriptorCollection Implements System.ComponentModel.ITypedList.GetItemProperties

 

 

    Return _PropertyCollection

 

 

End Function

 

 

 

 

 

Public Function GetListName(ByVal listAccessors() As System.ComponentModel.PropertyDescriptor) As String Implements System.ComponentModel.ITypedList.GetListName

 

 

    Return "DefaultView"

 

 

 

 

 

 

 

 

End Function

 

 

 

 

 

 

 

 

End

 

Class

 

Mira
Telerik team
 answered on 29 Oct 2009
0 answers
100 views
I have tabstrip/multipage. pageviews are filled from user controls. I need to input some data (like first/last name) on the first pageview and then show this value on other pageviews.
server-side assigning is absolutely not appropriate as I have page already rendered when I start my input with the first tab clicked.
So I decided to change variables with jQuery on client-side when the tab is clicked.
But My Jquery cannot find the classes (and variables) from the pageviews.

When I take a look at page source I see that there is only first pageview. I assume that others are rendered dynamically.

Can you please advice me the best technique how I can change the variables with the same names and same classes on all my pageviews?

I tried the option to render page "OnDemand", but it didn't help.

Elena
Elena Lavrinenko
Top achievements
Rank 1
 asked on 29 Oct 2009
3 answers
149 views
hi,

 

I have a radcombobox and a button
i want to when clik the button a news windows open with doc pdf
I write this code :

 

Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click  
 
Dim varpdf As String = "../up_fic/" & RadComboBox1.SelectedValue  
 
If varpdf <> "" Then 
 
Response.Write("<script>window.open('" + varpdf + "');</script>")  
 
End If 
 
End Sub 
 
this work but not fine the pop up blocker block alltime this action
how i do to open normaly a news windows ?

Thanks.

casa51
Top achievements
Rank 2
 answered on 29 Oct 2009
5 answers
315 views
Hi, I am using a browser add-on called httpwatch which allows me to see network traffic while I upload a document, I notice when i am uploading I get a lot of HTTP 401 unauthorized errors which should not happen since I am an authenticated user, then imeadiately I get code 200 which indicates OK, I get this every few hundred bytes until the upload completes.  Can anyone explain what is happening here, I am executing some server side processing on the files in UploadedFiles collection so the Target property is not set.  The site does have windows authentication turned ON but again I am a authenticated user.  Is there any permissions needed to be applied because I am doing server-side processing.  I am using 2009 Q2 build 826.35.  Most of the 401 errors come from the RadUploadProgressHandler.ashx issuing GET requests.

Thanks Kerry
Genady Sergeev
Telerik team
 answered on 29 Oct 2009
2 answers
317 views
Hello I looked at an example here on how nested view template is used to have multiple grids. I am currently working on a grid using nested view template and have few question. Before I start my question here is my code:

ASPX:

<telerik:RadGrid runat="server" ID="rgCommittee" GridLines="None" AllowSorting="true"
                AllowPaging="true" AllowFilteringByColumn="true" PageSize="30" AutoGenerateColumns="false"
                ShowGroupPanel="true" ShowFooter="true" OnNeedDataSource="rgCommittee_NeedDataSource"
                OnItemDataBound="rgCommittee_ItemDataBound" OnItemCommand="rgCommittee_ItemCommand"
                OnItemCreated="rgCommittee_ItemCreated">
                <MasterTableView DataKeyNames="CommitteeID,CommitteeTypeID" AllowMultiColumnSorting="true"
                    GroupLoadMode="Server">
                    <NestedViewTemplate>
                        <asp:Panel ID="pnlMemberList" runat="server" Visible="true">
                            <telerik:RadGrid runat="server" ID="rgCommitteeMember" GridLines="None" AllowSorting="true"
                                AllowPaging="true" AllowFilteringByColumn="true" PageSize="30" AutoGenerateColumns="false"
                                ShowGroupPanel="true" ShowFooter="true" OnNeedDataSource="rgCommitteeMember_NeedDataSource"
                                OnItemCommand="rgCommitteeMember_ItemCommand" OnItemDataBound="rgCommitteeMember_ItemDataBound">
                                <ValidationSettings EnableValidation="true" ValidationGroup="vgGrid" />
                                <MasterTableView DataKeyNames="CommitteeMemberID,PersonID" HierarchyLoadMode="SeverOnDemand"
                                    EditMode="InPlace" CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add new committee member(s)">
                                    <Columns>
                                        <telerik:GridBoundColumn HeaderText="Member TypeID" AllowFiltering="true" DataField="CommitteeMemberID"
                                            SortExpression="CommitteeMemberID" Visible="false" />
                                        <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel"
                                            EditText="Edit" />
                                        <telerik:GridButtonColumn ButtonType="LinkButton" ConfirmText="Are you sure you want to delete this record?"
                                            CommandName="Delete" Text="Delete" UniqueName="DeleteColumn" />
                                        <telerik:GridTemplateColumn>
                                            <EditItemTemplate>
                                                <PersonSearch:GridPersonSearch ID="gpsMemberName" runat="server" SearchType="Employee" ReturnField="PersonID"
                                                    TwoColumnSearch="false" RequiredFlag="false" />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblEmpName" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                    <NoRecordsTemplate>
                                        <div>
                                            There are no member(s) for this committee.</div>
                                    </NoRecordsTemplate>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </asp:Panel>
                    </NestedViewTemplate>
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="Committee TypeID" AllowFiltering="true" DataField="CommitteeTypeID"
                            SortExpression="CommitteeTypeID" Visible="false" />
                        <telerik:GridBoundColumn HeaderText="Committee Type" AllowFiltering="true" DataField="CommitteeTypeName"
                            SortExpression="CommitteeTypeName" />                       
                    </Columns>
                    <NoRecordsTemplate>
                        <div>
                            There are no committee assigned to you.</div>
                    </NoRecordsTemplate>
                </MasterTableView>
            </telerik:RadGrid>
C# code:
        protected void rgCommittee_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgCommittee.DataSource = Data.Committee.GetList(PersonID);
        }

        protected void rgCommittee_ItemDataBound(object source, GridItemEventArgs e)
        {
            GridDataItem gdiItem = e.Item as GridDataItem;

            if (gdiItem == null)
            {
                return;
            }
            else
            {
                if(!gdiItem.IsInEditMode)
                {
                    //if ((DataBinder.Eval(gdiItem.DataItem, "EmpName") == null) && (DataBinder.Eval(gdiItem.DataItem, "ChairFlag") == null))
                    //{
                        
                    //}

                }
            }
        }

        protected void rgCommittee_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                ((GridDataItem)e.Item).ChildItem.FindControl("pnlMemberList").Visible = !e.Item.Expanded;
            }
        }

        protected void rgCommittee_ItemCreated(object source, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                intCommitteeID = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CommitteeID"].ToString());
            }

            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("pnlMemberList").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }

        protected void rgCommitteeMember_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid rgCommitteeMember = source as RadGrid;
            rgCommitteeMember.DataSource = Data.CommitteeMember.GetList();
        }

        protected void rgCommitteeMember_ItemDataBound(object source, GridItemEventArgs e)
        {
            if (e.Item is GridDataInsertItem)
            {
                if (e.Item.IsInEditMode)
                {
                    #region Declare Controls

                    UserControls.GridPersonSearch gpsMemberName = (UserControls.GridPersonSearch)e.Item.FindControl("gpsMemberName");

                    #endregion

                    #region Bind Controls

                    int intPersonID;
                    if (gpsMemberName != null && e.Item.ItemIndex != -1 &&
                        e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonID"] != null &&
                        int.TryParse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonID"].ToString(), out intPersonID))
                    {
                        gpsMemberName.SetDropDownPersonID = intPersonID;
                    }
                    #endregion

                }
            }
            else if (e.Item is GridDataItem)
            {
                #region Controls

                if (!e.Item.IsInEditMode)
                {
                    // view mode (Label controls)
                    ((Label)e.Item.FindControl("lblEmpName")).Text = DataBinder.Eval(e.Item.DataItem, "EmpName") != null ? DataBinder.Eval(e.Item.DataItem, "EmpName").ToString() : string.Empty;
                }
                else
                {
                    // edit mode

                    #region Declare Controls

                    //Committee Type un-editable column.
                    UserControls.GridPersonSearch gpsMemberName = (UserControls.GridPersonSearch)e.Item.FindControl("gpsMemberName");

                    #endregion

                    #region Bind Controls

                    int intPersonID;
                    if (gpsMemberName != null && e.Item.ItemIndex != -1 &&
                        e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonID"] != null &&
                        int.TryParse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["PersonID"].ToString(), out intPersonID))
                    {
                        gpsMemberName.SetDropDownPersonID = intPersonID;
                    }

                    #endregion
                }

                #endregion
            }
        }

        protected void rgCommitteeMember_ItemCommand(object sender, GridCommandEventArgs e)
        {
            //int intRoleID;
            GridDataItem gdiItem = e.Item as GridDataItem;

            if (gdiItem == null)
            {
                return;
            }

            if (e.Item.IsInEditMode)
            {
                UserControls.GridPersonSearch gpsMemberName = (UserControls.GridPersonSearch)e.Item.FindControl("gpsMemberName");

                switch (e.CommandName)
                {
                    case "PerformInsert":
                        Page.Validate("vgGrid");

                        if (Page.IsValid)
                        {
                           
                        }
                       else
                       {
                          rgCommitteeList.Controls.Add(new LiteralControl(string.Format("<span class=\"ErrorText\">There was an error inserting the record.</span>")));
                       }
                        break;
                    case "Update":
                        Page.Validate("vgGrid");

                        if (Page.IsValid)
                        {                          
                           
                        }
                        else
                        {
                           rgCommitteeList.Controls.Add(new LiteralControl(string.Format("<span class=\"ErrorText\">There was an error updating the record.</span>")));
                        }
                        break;
                }
            }          
        }

The parent Grid displays Committee Name for example student committee. When I click on the student committee it loads the rad grid inside the nested view template that displays me the names of the student associated to that committee.

If there aren't any students for that committee it should display the message from no records template.

My questions are:

When the I call the child rad grid from the nested view template it does not display message from the no record template.
Secondly if there is data it does not display data either on the child grid.
But when I click the add button on the child rad grid it fires the NeedDataSource Event on the Child grid and displays the no records template message or displays student data then!

Can you please tell me how do I handle this, since after I  click the committee name it should call the need data source event on child but it isn't doing that for some reason can you kindly let me know about it.

Thanks and Regards
Amitesh
thecruciable
Top achievements
Rank 1
 answered on 29 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?