I need to access the content of each field prior to update/insert to make sure the content is valid.
One of the grids is named FULEGRID. On the click event for the update/insert needs to access the tbx fields inthe template but I can't seem construct the statement needed to 'view' their content. Give the following code can someone help out?
Cliff
Here is the source for this grid
<telerik:RadGrid ID="fuelgrid" runat="server" DataSourceID="SqlDataSource1" GridLines="None" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AutoGenerateEditColumn="True" Skin="Hay">
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="Id"
DataSourceID="SqlDataSource1">
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="Id" DataType="System.Int64" HeaderText="Id" ReadOnly="True"
SortExpression="Id" UniqueName="Id" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="fleet_id" DataType="System.Int64" HeaderText="fleet_id" SortExpression="fleet_id" UniqueName="fleet_id" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="beginning_miles" DataType="System.Double" HeaderText="Starting Miles"
SortExpression="beginning_miles" UniqueName="beginning_miles">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ending_miles" DataType="System.Double" HeaderText="Ending Miles"
SortExpression="ending_miles" UniqueName="ending_miles">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="gas_date" DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime"
HeaderText="Fill-up Date" SortExpression="gas_date" UniqueName="gas_date">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="gas_gallons" DataType="System.Double" HeaderText="Gallons"
SortExpression="gas_gallons" UniqueName="gas_gallons">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="gas_amt" DataType="System.Decimal" HeaderText="Price"
SortExpression="gas_amt" UniqueName="gas_amt" DataFormatString="{0:C}">
<HeaderStyle HorizontalAlign="Center" Width="80px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="create_date" DataType="System.DateTime" HeaderText="create_date"
SortExpression="create_date" UniqueName="create_date" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="create_id" HeaderText="create_id" SortExpression="create_id"
UniqueName="create_id" Visible="False">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
<FormTemplate>
<table style="width: 245px; height: 117px">
<tr>
<td>
<asp:Label ID="lblstart" runat="server" Text="Starting Miles"></asp:Label></td>
<td style="width: 8px">
<asp:TextBox ID="tbxstartingmiles" runat="server" Text='<%# Bind("beginning_miles") %>'></asp:TextBox></td>
<td style="width: 3px">
<asp:Label ID="Label1" runat="server" Text="######"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label ID="lblend" runat="server" Text="Ending Miles"></asp:Label></td>
<td style="width: 8px">
<asp:TextBox ID="tbxendingmiles" runat="server" Text='<%# Bind("ending_miles") %>'></asp:TextBox></td>
<td style="width: 3px">
<asp:Label ID="Label2" runat="server" Text="######"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label ID="lblgallons" runat="server" Text="Gallons"></asp:Label></td>
<td style="width: 8px">
<asp:TextBox ID="tbxgallons" runat="server" Text='<%# Bind("gas_gallons") %>'></asp:TextBox></td>
<td style="width: 3px">
<asp:Label ID="Label3" runat="server" Text="###.#"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label ID="lblgamt" runat="server" Text="Price"></asp:Label></td>
<td style="width: 8px">
<asp:TextBox ID="tbxgamt" runat="server" Text='<%# Bind("gas_amt") %>'></asp:TextBox></td>
<td style="width: 3px">
<asp:Label ID="Label4" runat="server" Text="$$$$.$$"></asp:Label></td>
</tr>
<tr>
<td>
<asp:Label ID="lblgdate" runat="server" Text="Fill-up Date"></asp:Label>
</td>
<td style="width: 8px">
<asp:TextBox ID="tbxgdate" runat="server" Text='<%# Bind("gas_date") %>'></asp:TextBox></td>
<td style="width: 3px">
<asp:Label ID="Label5" runat="server" Text="mm/dd/yyyy"></asp:Label></td>
</tr>
<tr>
<td colspan="3">
<asp:Button ID="btnupdate" runat="server"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' OnClick="btnupdate_Click"/>
</td>
</tr>
<tr>
<td colspan="3">
<asp:Button ID="btncancel" runat="server" Text="Cancel" CausesValidation="false"
CommandName="Cancel" />
</td>
</tr>
<tr>
<td colspan="3">
<asp:TextBox ID="tbxfleetid" runat="server"
Text='<%# Bind("fleet_id") %>'
Visible="False"></asp:TextBox>
<asp:TextBox ID="tbxcreaterid" runat="server"
Text='<%# Bind("create_id") %>'
Visible="False">
</asp:TextBox>
</td>
</tr>
<tr>
<td colspan="3">
<asp:Label ID="lblerror" runat="server" Text="Label"></asp:Label></td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="Hay">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid>