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

[Solved] Popup form template is not appear after grouping

4 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 20 Jan 2010, 02:40 AM
Hi! i just facing a problem when the grid either in edit/insert with popup. the popup( with modal) function is working fine without any grouping. but when there is any grouping in the grid and the popup edit form template will not appear but the screen become modal. it is fine for add record but not for update existing record. the code is attact below. please kindly to give me any advice (version 2008.3.1314.20)

<telerik:RadGrid ID="grdComment" runat="server" AutoGenerateColumns="False" GridLines="None" Skin="Office2007" AllowPaging="True" AllowSorting="True" Height="250px" ShowGroupPanel="True" OnNeedDataSource="grdComment_NeedDataSource" PageSize="20" OnItemCreated="grdComment_ItemCreated" > 
                                <HeaderContextMenu Skin="Office2007">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </HeaderContextMenu> 
                                <MasterTableView CommandItemDisplay="Top" EditMode="PopUp" Name="ServiceBusiness" DataKeyNames="Project_Service_Id_Text"  ClientDataKeyNames="Project_Service_Id_Text">  
                                    <Columns> 
                                        <telerik:GridEditCommandColumn > 
                                        </telerik:GridEditCommandColumn> 
                                        <telerik:GridBoundColumn DataField="Project_Service_Id_Text" HeaderText="Project_Service_Id_Text" 
                                            UniqueName="Project_Service_Id_Text">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Parent_Service_Business_Id_Text" UniqueName="Parent_Service_Business_Id_Text" DataField="Parent_Service_Business_Id_Text" Visible="False">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service Category" UniqueName="Parent_Service_Business_Name" DataField="Parent_Service_Business_Name">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service_Business_Id_Text" UniqueName="Service_Business_Id_Text" DataField="Service_Business_Id_Text" Visible="False">  
                                            <HeaderStyle Width="100px" /> 
                                            <ItemStyle Width="100px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Service" UniqueName="Service_Business_Name" DataField="Service_Business_Name">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Service_Status_Id_Text" HeaderText="Service_Status_Id_Text" 
                                            UniqueName="Service_Status_Id_Text" Visible="False">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Service_Status_Name" HeaderText="Status" UniqueName="Service_Status_Name">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Start Date" UniqueName="Start_Date" DataField="Start_Date" DataFormatString="{0:d-MMM}" DataType="System.DateTime">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn HeaderText="Latest Comment" UniqueName="Latest_Comment" DataField="Latest_Comment">  
                                            <HeaderStyle Width="250px" /> 
                                            <ItemStyle Width="250px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Employee_Name" HeaderText="Employee" UniqueName="Employee_Name">  
                                            <HeaderStyle Width="120px" /> 
                                            <ItemStyle Width="120px" /> 
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Latest_Comment_Date" DataFormatString="{0:dd/MM/yyyy hh:mm:ss}" 
                                            DataType="System.DateTime" HeaderText="Date" UniqueName="Latest_Comment_Date">  
                                            <HeaderStyle Width="150px" /> 
                                            <ItemStyle Width="150px" /> 
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                    <NoRecordsTemplate> 
                                        No Service and Comment found!  
                                    </NoRecordsTemplate> 
                                    <CommandItemSettings AddNewRecordText="+ Service" /> 
                                    <EditFormSettings   EditFormType="Template" > 
                                        <PopUpSettings  Modal="True" Width="300px"/>  
                                        <FormTemplate> 
                                            <table border="0" cellpadding="0" cellspacing="1" width="100%">  
                                                <tr> 
                                                    <td>Service:</td> 
                                                    <td> 
                                                        <telerik:RadComboBox ID="cboServiceType" runat="server" Skin="Outlook" Width="200px">  
                                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                        </telerik:RadComboBox> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Status:</td> 
                                                    <td> 
                                                        <telerik:RadComboBox ID="cboServiceStatus" runat="server" Skin="Outlook" Width="200px">  
                                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                        </telerik:RadComboBox> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td>Start Date:</td> 
                                                    <td> 
                                                        <telerik:RadDatePicker ID="dtpServiceStartDate" runat="server" Skin="Default2006" Width="200px">  
                                                            <Calendar Skin="Default2006" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                                                ViewSelectorText="x">  
                                                            </Calendar> 
                                                            <DatePopupButton HoverImageUrl="" ImageUrl="" /> 
                                                            <DateInput DateFormat="dd-MM-yyyy">  
                                                            </DateInput> 
                                                        </telerik:RadDatePicker> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td colspan="2" align="right">  
                                                        <asp:Button ID="btnServiceAdd" runat="server" Text="Add" CommandName="Cancel" OnClientClick="if (!btnServiceAdd_OnClick()) return false;" Width="64px" /> 
                                                        <asp:Button ID="btnServiceUpdate" runat="server" Text="Update" CommandName="Cancel" OnClientClick="if (!btnServiceUpdate_OnClick()) return false;" Width="64px" /> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                            <asp:HiddenField ID="fldProjectServiceIdText" runat="server" /> 
                                              
                                        </FormTemplate> 
                                        <EditColumn UniqueName="EditCommandColumn1">  
                                        </EditColumn> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                                <FilterMenu Skin="Office2007">  
                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                </FilterMenu> 
                                <ClientSettings AllowDragToGroup="True">  
                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                                    <ClientEvents OnPopUpShowing="PopUpShowing" /> 
                                </ClientSettings> 
                            </telerik:RadGrid> 
 
protected void grdComment_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
    {  
        if (PropertyId != null)  
        {  
            DataSet ds = new DataSet();  
            ds = GetCommentDataSet(EmployeeId, PropertyId);  
            ds.Tables[0].PrimaryKey = new DataColumn[] { ds.Tables[0].Columns["Project_Service_Id_Text"] };   
            grdComment.DataSource = ds;  
        }  
    }  
 
 
    protected void grdComment_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        RadComboBox radCombo;  
        Button btn;  
        RadDatePicker dtp;  
        HiddenField fld;  
          
        if (e.Item.OwnerTableView.Name == "ServiceBusiness") {  
            if ( e.Item is GridEditFormItem && e.Item.IsInEditMode){  
                if (e.Item.OwnerTableView.IsItemInserted)  
                {  
                    GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();  
                    if (insertedItem != null)  
                    {  
                        radCombo = (RadComboBox)insertedItem.FindControl("cboServiceType");  
                        radCombo.DataSource = GetServiceBusinessDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Name";  
                        radCombo.DataValueField = "Service_Business_Id_Text";  
 
                        radCombo = (RadComboBox)insertedItem.FindControl("cboServiceStatus");  
                        radCombo.DataSource = GetServiceBusinessStatusDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Status_Name";  
                        radCombo.DataValueField = "Service_Status_Id_Text";  
                        btn = (Button)insertedItem.FindControl("btnServiceAdd");  
                        btn.Visible = true;  
                        btn = (Button)insertedItem.FindControl("btnServiceUpdate");  
                        btn.Visible = false;  
                    }  
                }  
                else {   
                    GridItem updatedItem = e.Item;  
                    if (updatedItem != null)  
                    {  
                        radCombo = (RadComboBox)updatedItem.FindControl("cboServiceType");  
                        radCombo.DataSource = GetServiceBusinessDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Name";  
                        radCombo.DataValueField = "Service_Business_Id_Text";  
 
                        if (DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text") != null)  
                        {  
                            radCombo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text").ToString();  
                        }  
                        radCombo.Enabled = false;  
 
                        radCombo = (RadComboBox)updatedItem.FindControl("cboServiceStatus");  
                        radCombo.DataSource = GetServiceBusinessStatusDataSet().Tables[0];  
                        radCombo.DataTextField = "Service_Status_Name";  
                        radCombo.DataValueField = "Service_Status_Id_Text";  
                        if (DataBinder.Eval(e.Item.DataItem, "Service_Business_Id_Text") != null)  
                        {  
                            radCombo.SelectedValue = DataBinder.Eval(e.Item.DataItem, "Service_Status_Id_Text").ToString();  
                        }  
 
                        dtp = (RadDatePicker)updatedItem.FindControl("dtpServiceStartDate");  
                        if (DataBinder.Eval(e.Item.DataItem, "Start_Date") != null)  
                            if (DataBinder.Eval(e.Item.DataItem, "Start_Date") != DBNull.Value)  
                            {  
                                dtp.SelectedDate = DateTime.Parse( DataBinder.Eval(e.Item.DataItem, "Start_Date").ToString());  
                            }  
 
                        fld = (HiddenField)updatedItem.FindControl("fldProjectServiceIdText");  
                        if (DataBinder.Eval(e.Item.DataItem, "Project_Service_Id_text") != null)  
                            fld.Value = DataBinder.Eval(e.Item.DataItem, "Project_Service_Id_text").ToString();  
 
                        btn = (Button)updatedItem.FindControl("btnServiceAdd");  
                        btn.Visible = false;  
                        btn = (Button)updatedItem.FindControl("btnServiceUpdate");  
                        btn.Visible = true;  
 
                          
 
                    }  
                  
                }  
            }  
        }  
    } 

From CH

4 Answers, 1 is accepted

Sort by
0
CH
Top achievements
Rank 1
answered on 21 Jan 2010, 03:05 AM
anyone can give help?
0
Iana Tsolova
Telerik team
answered on 22 Jan 2010, 01:47 PM
Hi CH,

Indeed, when both grouping and scrolling are enabled, the grid popup edit form is not displayed as expected. However, to overcome this issue, you can try the approach illustrated in the attached sample.

I hope this helps.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CH
Top achievements
Rank 1
answered on 12 Feb 2010, 07:35 AM
I just checked with your sample... the popup edit form is showing up with single record edit but the popup window is blur and not allow for edit.... is there any way to solve this? thks!

From CH
0
Iana Tsolova
Telerik team
answered on 17 Feb 2010, 01:27 PM
Hi CH,

I tested the sample again and I observed that it works properly and the popup edit form is editable in IE8 and Firefox. However I was able to replicate the problem in IE7 and it seems it is connected with the way IE7 interprets stacking contexts.
I am afraid that currently it is limitation to have modal popup edit form in grid with static headers and grouping enabled.

Please excuse us for the inconvenience.

Sincerely yours,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
CH
Top achievements
Rank 1
Answers by
CH
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or