Is there a resource that explains the difference between GridDataInsertItem, GridDataItem, GridEditableItem, etc... I'm working with doing the edit form functionality but getting confused who and what I should use when I do either EditMode=InPlace or EditMode=EditForms.
For instance if do EditMode=InPlace and have a GridBoundColumn, how do I reference it in an insertCommand? If its EditMode=EditForms I might do this:
where 'TextBoxName' is a TextBox control that exists in the FormTemplate on my designer page AND as a GridBoundColumn:
But if you do EditMode=InPlace I think I would do the following:
Basically not sure how to get value of TextBoxName when doing InPlace EditMode
For instance if do EditMode=InPlace and have a GridBoundColumn, how do I reference it in an insertCommand? If its EditMode=EditForms I might do this:
GridEditFormInsertItem edititem = (GridEditFormInsertItem)e.Item; |
string EquipShortName = ((TextBox)edititem.FindControl("TextBoxName")).Text; |
where 'TextBoxName' is a TextBox control that exists in the FormTemplate on my designer page AND as a GridBoundColumn:
<MasterTableView CommandItemDisplay="Bottom" EditMode="EditForms"> |
<Columns> |
<telerik:GridBoundColumn UniqueName="TextBoxName" DataField="TextBoxName"> |
</telerik:GridBoundColumn> |
<telerik:GridEditCommandColumn |
UniqueName="EditCommandColumn" |
CancelText="Cancel" |
UpdateText="Update" |
InsertText="Insert" |
EditText="Edit" |
> |
</telerik:GridEditCommandColumn> |
<telerik:GridButtonColumn CommandName="Delete" Text="Delete"></telerik:GridButtonColumn> |
</Columns> |
<EditFormSettings EditFormType="Template"> |
<FormTemplate> |
<div style="color:#333333;"> |
<table width="100%" border="1" |
style=" |
background-color:#D9F0FF; |
font-family:Arial; |
font-size:9pt; |
border-color:Black; |
border-left-color:Black; |
" |
cellpadding="2" cellspacing="2" |
> |
<tr> |
<td style="width:50%"> |
<table cellpadding="0" cellspacing="0" border="0" width="100%"> |
<tr> |
<td>Name</td> |
<td align="right</td> |
</tr> |
</table> |
</td> |
<td style="width:50%"> |
<asp:TextBox ID="TextBoxName" runat="server" |
Text='<%# Bind("TextBoxName") %>' |
Width="99%" TextMode="MultiLine" Rows="3" |
></asp:TextBox> |
</td> |
</tr> |
</table> |
</FormTemplate> |
</EditFormSettings> |
</MasterTableView> |
But if you do EditMode=InPlace I think I would do the following:
<MasterTableView CommandItemDisplay="Bottom" EditMode="InPlace"> |
<RowIndicatorColumn> |
<HeaderStyle Width="120px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="120px"></HeaderStyle> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn DataField="TextBoxName" HeaderText="TextBoxName" UniqueName="TextBoxName"> |
</telerik:GridBoundColumn> |
<telerik:GridEditCommandColumn |
UniqueName="EditCommandColumn" |
CancelText="Cancel" |
UpdateText="Update" |
InsertText="Insert" |
EditText="Edit" > |
</telerik:GridEditCommandColumn> |
<telerik:GridButtonColumn CommandName="Delete" Text="Delete"></telerik:GridButtonColumn> |
</Columns> |
<EditFormSettings > |
</EditFormSettings> |
</MasterTableView> |
Basically not sure how to get value of TextBoxName when doing InPlace EditMode