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

Show detail view like Edit view

5 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 02 Nov 2010, 07:36 PM
Hi

I have a grid with the default Edit format in-Grid.   This works fine but what I actually want
is a similar detail view that is not editable, and does not show an 'Update' link. ie choices are only
'view detail' or 'Delete' 

I could make all the items read-only in Edit mode, but how to I get read of the 'Update' link?

Am I going about this the wrong way?

Thanks for help!

Clive

Q2 2010/asp.net 4.0

5 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 03 Nov 2010, 08:45 AM
Hello Clive Hoggar,

You may use a custom edit form template and put whatever controls you need in it. You may check this demo showing this approach (note that here the update and cancel button are explicitly declared at the end of the template).
Another option is to remove the the default GridEditCommandColumn and use a custom button that puts the relevant item in edit mode.

Sincerely yours,
Marin
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
0
Clive Hoggar
Top achievements
Rank 1
answered on 03 Nov 2010, 11:14 AM
Hi Marin

Thanks. This is what I did finally:
1. Made all the columns into templates, and set edit templates to ReadOnly=True
    (May not be strictly necessary)
2. Removed the autogenerated edit and delete links, and replaced them with declared buttons
    and changed the text for the Edit button into 'View detail'
3. Explicitly declared the update and cancel buttons
    and made the Cancel text 'Close' and the Update text nothing
   
The grid + simple detail view is a very common need and I suggest for a future release that there
should be an explicit option for a 'view detail' window that has the same in-line or popup options
as the built-in edit form.

Thanks

Clive
0
Marin
Telerik team
answered on 03 Nov 2010, 03:50 PM
Hello Clive Hoggar,

I am glad to hear this worked. And thank you for sharing this information and for the feedback.
Feel free to ask if you have any other questions.

Sincerely yours,
Marin
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
0
smdk
Top achievements
Rank 1
answered on 24 Nov 2010, 09:17 PM
I agree with Clive the detail option will be great.

Clive, I am trying to do the same thing, can you please post your source code?

Thanks
0
Princy
Top achievements
Rank 2
answered on 25 Nov 2010, 07:51 AM
Hello,

Here is the sample ASPX code that I tried in my application. Hope this will help.
ASPX:
<telerik:RadGrid runat="server" ID="RadGrid1" DataSourceID="SqlDataSource1" AutoGenerateColumns="false">
    <MasterTableView CommandItemDisplay="Top">
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <br />
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind( "EmployeeID") %>' ReadOnly="true"></asp:TextBox>
                <br />
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind( "FirstName") %>' ReadOnly="true"></asp:TextBox>
                <br />
                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CommandName="Cancel"></asp:Button>
            </FormTemplate>
        </EditFormSettings>
        <Columns>
            <telerik:GridBoundColumn DataField="EmployeeID" UniqueName="EmployeeID" HeaderText="EmployeeID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="FirstName">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Edit" Text="ViewDetails">
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy.
Tags
Grid
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Marin
Telerik team
Clive Hoggar
Top achievements
Rank 1
smdk
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or