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

Different form templates in EditFormSettings of rad grid

4 Answers 377 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ankool
Top achievements
Rank 1
ankool asked on 18 Jun 2008, 09:43 AM
Hi,

Can we have different form template for different commands ?
In my application i want different templates in case of  'Add New Record' and 'Edit'. Is it possible ?

If yes, can you give an example of how to use it.


Thanks

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jun 2008, 09:54 AM
Hi Ankool,

You can achieve this using UserControl edit form as shown in the following help article.
Different edit forms on edit and insert

Thanks
Shinu.
0
ankool
Top achievements
Rank 1
answered on 18 Jun 2008, 10:50 AM
Thanks Shinu.


Also, i would like to know that can i bind a text field of a column in detail table to a column value in parent Master Table.


<

MasterTableView AllowMultiColumnSorting="True" Width="100%" CommandItemDisplay="Top" DataKeyNames="ID">
<DetailTables>
<radG:GridTableView Width="80%" AutoGenerateColumns="false" HierarchyLoadMode="ServerBind"
runat="server" CommandItemDisplay="Top" PageSize="3" Name="Roles" DataKeyNames="PartyID">
<ParentTableRelation>
<radG:GridRelationFields DetailKeyField="PartyID" MasterKeyField="ID" />
</ParentTableRelation>
<Columns>

<radG:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
</radG:GridEditCommandColumn>

<radG:GridBoundColumn SortExpression="PartyID" Visible="false" DataField="PartyID"UniqueName="PartyID">
</radG:GridBoundColumn>

<radG:GridBoundColumn SortExpression="PartyName" Visible="false" DataField="PartyName" UniqueName="PartyName">
</radG:GridBoundColumn>

<radG:GridBoundColumn SortExpression="Role" HeaderText="Role" DataField="Role" UniqueName="Role">
</radG:GridBoundColumn>

<radG:GridBoundColumn SortExpression="Component" HeaderText="Component" DataField="Component"UniqueName="Component">
</radG:GridBoundColumn>

<radG:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1"></radG:GridButtonColumn>

</Columns>

<EditFormSettings EditFormType="template">

<FormTemplate>
<asp:TextBox id="txtMasterTableColumnName" runat="server" Width="161px" CssClass="ContentFontReadOnly" Text='<%#Bind("Name") %>'></asp:TextBox>

</FormTemplate>

</EditFormSettings>

<PagerStyle Mode="numericPages" PagerTextFormat="" />

</radG:GridTableView>

</DetailTables>
<Columns>
<radG:GridBoundColumn SortExpression="ID" Visible="false" DataField="ID" UniqueName="ID"></radG:GridBoundColumn>
<radG:GridBoundColumn SortExpression="Name" HeaderText="Party Involved" DataField="Name" UniqueName="Name"></radG:GridBoundColumn>
</Columns>
</MasterTableView>


Now, in above code, i require binding of a textbox in formatemplate of a detail table with a column in master table called "Name".

Can this be achieved ?

0
Princy
Top achievements
Rank 2
answered on 18 Jun 2008, 11:44 AM
Hi Ankool,

You can achieve this if your are binding both the Master and detail table with the same DataSource.
Update/Insert/Delete in hierarchy

Princy.
0
ankool
Top achievements
Rank 1
answered on 18 Jun 2008, 12:33 PM
Hi,

Thanks but i am using a dataset ( created from a xml) to load both parent and child grid table views. So the only option to bind controls is by using <%#Bind("")%> syntax in controls value.

So what to do in this case ?
Tags
Grid
Asked by
ankool
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
ankool
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or