M
Morris Neuman
sHi,
I have an add button that when clicked displays a blank DetailView form
giving the user the ability to input data before selecting insert or cancel.
The fields on the DetailsView are TextBox and are bound to fields on table 1.
When the blank DetailsView form is displayed, I would like to display from
another table (table 2) default values for the any of the fields if they
exists. The user then does not have to enter this data.
For example in the DetailsView below, I would like to have the scrren show a
value of 10(or from a field from table2) in the NumberOfRetires and "Tranfer
in the FailedRetryAction field. If the form field is a DropDownList then I
can bind it and show the possible values but don't see how if to display a
value from one field and bind to another. I tried DefaultValue but that does
not show on the screen.
<aspetailsView ID="DetailsView1" runat="server"
DataSourceID="AccessDataSource1"
Height="50px" AutoGenerateInsertButton="True"
AutoGenerateRows="False"
DefaultMode="Insert" Visible="False" BorderStyle="Solid"
BorderWidth="1px"
CellPadding="5" CellSpacing="1" Font-Names="verdana" Font-Size="8pt"
ForeColor="Navy" Width="125px" BorderColor="#FFC080"
OnItemInserted="DetailsView1_ItemInserted">
<Fields>
<asp:BoundField DataField="AttendantID" HeaderText="Attendant
ID" />
<asp:BoundField DataField="NumberOfRetries"
HeaderText="NumberOfRetries" />
<asp:TemplateField HeaderText="FailedRetryAction">
<EditItemTemplate>
<asp:TextBox ID="TextBox10" runat="server"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%#
Bind("FailedRetryAction") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%#
Bind("FailedRetryAction") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NameID" HeaderText="NameID" />
<asp:BoundField DataField="AlternateMessageID"
HeaderText="AlternateMessageID" />
</Fields>
I have an add button that when clicked displays a blank DetailView form
giving the user the ability to input data before selecting insert or cancel.
The fields on the DetailsView are TextBox and are bound to fields on table 1.
When the blank DetailsView form is displayed, I would like to display from
another table (table 2) default values for the any of the fields if they
exists. The user then does not have to enter this data.
For example in the DetailsView below, I would like to have the scrren show a
value of 10(or from a field from table2) in the NumberOfRetires and "Tranfer
in the FailedRetryAction field. If the form field is a DropDownList then I
can bind it and show the possible values but don't see how if to display a
value from one field and bind to another. I tried DefaultValue but that does
not show on the screen.
<aspetailsView ID="DetailsView1" runat="server"
DataSourceID="AccessDataSource1"
Height="50px" AutoGenerateInsertButton="True"
AutoGenerateRows="False"
DefaultMode="Insert" Visible="False" BorderStyle="Solid"
BorderWidth="1px"
CellPadding="5" CellSpacing="1" Font-Names="verdana" Font-Size="8pt"
ForeColor="Navy" Width="125px" BorderColor="#FFC080"
OnItemInserted="DetailsView1_ItemInserted">
<Fields>
<asp:BoundField DataField="AttendantID" HeaderText="Attendant
ID" />
<asp:BoundField DataField="NumberOfRetries"
HeaderText="NumberOfRetries" />
<asp:TemplateField HeaderText="FailedRetryAction">
<EditItemTemplate>
<asp:TextBox ID="TextBox10" runat="server"></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%#
Bind("FailedRetryAction") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%#
Bind("FailedRetryAction") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NameID" HeaderText="NameID" />
<asp:BoundField DataField="AlternateMessageID"
HeaderText="AlternateMessageID" />
</Fields>