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

[Solved] Edit button not raising edit form

1 Answer 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 17 Jul 2009, 04:01 PM
I had this grid working fine at one point, but owing to some changes in design requirements I ended up scrapping a custom template edit form and just setting it to auto-generate the edit form instead.  Inserts still work fine, and everything with the child grid works fine, but for some reason I can't figure out clicking on the MasterGridView's edit button doesn't raise the edit form.  Sorry if this is a lot of code but I'm really not certain what is or isn't relevant at this point.

<telerik:RadGrid ID="grdUser" runat="server" DataSourceID="dsUserGrid" AllowPaging="false" AllowSorting="true" Skin="Default" AutoGenerateEditColumn="false"  
            AutoGenerateColumns="false" Width="750px" EnableLinqExpressions="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="true"  
            AllowAutomaticDeletes="true" OnColumnCreated="grdUser_ColumnCreated" > 
                <MasterTableView EditMode="PopUp" EditFormSettings-EditFormType="AutoGenerated" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New User" Width="750px" AutoGenerateColumns="false" DataKeyNames="UserKey"
                    <DetailTables> 
                        <telerik:GridTableView runat="server" DataSourceID="dsFacilityUser" EditMode="EditForms" HorizontalAlign="Right" InsertItemDisplay="Bottom"  
                        CommandItemDisplay="Bottom" CommandItemSettings-AddNewRecordText="Add Location" ShowHeader="false" AllowAutomaticInserts="true" AllowAutomaticDeletes="true"  
                        DataKeyNames="FacilityUserKey" Width='240px'
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="UserKey" MasterKeyField="UserKey" /> 
                            </ParentTableRelation> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="UserKey" Display="false" ReadOnly="true" /> 
                                <telerik:GridBoundColumn DataField="FacilityUserKey" Display="false" ReadOnly="true" /> 
                                <telerik:GridDropDownColumn DataField="FacilityKey" ListTextField="FacilityName" ListValueField="FacilityKey" DataSourceID="dsFacility" UniqueName="colFacility" /> 
                                <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" Text="Remove" /> 
                            </Columns> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <CommandItemSettings AddNewRecordText="Add New User" /> 
                    <Columns> 
                        <telerik:GridEditCommandColumn ButtonType="LinkButton" /> 
                        <telerik:GridBoundColumn HeaderText="UserName" DataField="UserName" UniqueName="colUserName" Display="false"/> 
                        <telerik:GridBoundColumn HeaderText="UserKey" DataField="UserKey" UniqueName="colUserKey" Display="false" ReadOnly="true" /> 
                        <telerik:GridBoundColumn HeaderText="Last Name" DataField="LastName" UniqueName="colLastName" Display="true" /> 
                        <telerik:GridBoundColumn HeaderText="First Name" DataField="FirstName" UniqueName="colFirstName" Display="true"/> 
                        <telerik:GridDropDownColumn HeaderText="Role" DataField="RoleKey" UniqueName="colRole" ListTextField="Role" ListValueField="RoleKey" DataSourceID="dsRole" /> 
                        <telerik:GridBoundColumn HeaderText="Phone" DataField="Phone" UniqueName="colPhone" MaxLength="12" /> 
                        <telerik:GridBoundColumn HeaderText="Email" DataField="Email" UniqueName="colEmail" ConvertEmptyStringToNull="true" Display='false' /> 
                        <telerik:GridBoundColumn HeaderText="Home District" DataField="DistrictName" UniqueName="colDistrictName" ReadOnly="true" /> 
                        <telerik:GridBoundColumn HeaderText="Home Location" DataField="FacilityName" UniqueName="colFacilityName" ReadOnly="true"/> 
                        <telerik:GridCheckBoxColumn HeaderText="User Editor" DataType="System.Boolean" DataField="UserEditor" UniqueName="colUserEditor" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="VVL Editor" DataType="System.Boolean" DataField="VVLEditor" UniqueName="colVVLEditor" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="Writer" DataType="System.Boolean" DataField="Writer" UniqueName="colWriter" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="Reader" DataType="System.Boolean" DataField="Reader" UniqueName="colReader" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="Task Manager" DataType="System.Boolean" DataField="TaskManager" UniqueName="colTaskEdit" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="Receives Emails" DataType="System.Boolean" DataField="EmailActive" UniqueName="colEmail" Display="false"/> 
                        <telerik:GridCheckBoxColumn HeaderText="Active User" DataType="System.Boolean" DataField="Active" UniqueName="colActive" Display="false"/> 
                        <telerik:GridExpandColumn UniqueName="colExpand" ButtonType="ImageButton" CollapseImageUrl="../images/grid-collapse.png" ExpandImageUrl="../images/grid-expand.png" /> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 

I should note that I have also tried setting AutoGenerateEditColumn=true with the same result.

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 21 Jul 2009, 11:46 AM
Hello Chris,

I tried binding the grid with a sample database and everything goes fine. For your convenience I created a simplified project (and dummy database) that is based on the provided code snippets.
If you still can't get the editor showing i would offer you to send us a simplified project so we can run it locally and find where the issue comes from.

Kind regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or