Hi every one,
I want the grid bound column value when it is in edit mode
Here is my code.....In the following code the SERVICETYPE Grid boun colim is editable text box.When the user enters some value to update it I need to get the text the user entered and validate it
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ServiceType.ascx.cs" Inherits="Desktop_Modules_Service_Type_ServiceType" %>
<asp:Panel ID="pnlCompanyType" runat="server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function RowDblClick(sender, eventArgs) {
sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="rgServiceType">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgServiceType" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
<br />
<telerik:RadGrid ID="rgServiceType" runat="server" DataSourceID="sdsServiceType" Skin="Outlook" Width="97%"
ShowStatusBar="True" AllowSorting="True" PageSize="10" GridLines="None" AllowPaging="True"
AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
OnItemUpdated="rgCompanyType_ItemUpdated" OnItemDeleted="rgCompanyType_ItemDeleted"
OnItemInserted="rgCompanyType_ItemInserted" OnDataBound="rgCompanyType_DataBound" AutoGenerateColumns="False">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="nSERVICEID,nSERVICETYPE"
DataSourceID="sdsServiceType" HorizontalAlign="NotSet" EditMode="InPlace">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
<ItemStyle/>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="SERVICEID" DataField="nSERVICEID" HeaderText="SERVICEID" ReadOnly="True" HeaderStyle-Width="10%" />
<telerik:GridBoundColumn DataField="nSERVICETYPE" HeaderText="SERVICETYPE" SortExpression="nSERVICETYPE"
UniqueName="SERVICETYPE" ColumnEditorID="GridTextBoxColumnEditor1">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign="Center"/>
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings ColumnNumber="2" CaptionDataField="SEVICETYPE" CaptionFormatString="Edit Company {0}" InsertCaption="New SERVICETYPE">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle></FormCaptionStyle>
<FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
Width="100%" />
<FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
UniqueName="EditCommandColumn1" CancelText="Cancel edit">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
<br />
<asp:Label ID="lblMessage" runat="server" EnableViewState="false" />
<br />
<asp:SqlDataSource ID="sdsServiceType" runat="server"
ConnectionString="<%$ ConnectionStrings:DotNetNukeConnectionString2 %>"
SelectCommand="sp_ServiceTypeSelect" SelectCommandType="StoredProcedure"
DeleteCommand="sp_ServiceTypeDelete" DeleteCommandType="StoredProcedure"
InsertCommand="sp_ServiceTypeInsert" InsertCommandType="StoredProcedure"
UpdateCommand="sp_ServiceTypeUpdate" UpdateCommandType="StoredProcedure">
<DeleteParameters>
<asp:Parameter Name="nSERVICEID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="nSERVICEID" Type="Int32" />
<asp:Parameter Name="nSERVICETYPE" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="nSERVICETYPE" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<!-- content end -->
</asp:Panel>
Please help me thanks
I want the grid bound column value when it is in edit mode
Here is my code.....In the following code the SERVICETYPE Grid boun colim is editable text box.When the user enters some value to update it I need to get the text the user entered and validate it
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ServiceType.ascx.cs" Inherits="Desktop_Modules_Service_Type_ServiceType" %>
<asp:Panel ID="pnlCompanyType" runat="server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function RowDblClick(sender, eventArgs) {
sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="rgServiceType">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rgServiceType" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager>
<br />
<telerik:RadGrid ID="rgServiceType" runat="server" DataSourceID="sdsServiceType" Skin="Outlook" Width="97%"
ShowStatusBar="True" AllowSorting="True" PageSize="10" GridLines="None" AllowPaging="True"
AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
OnItemUpdated="rgCompanyType_ItemUpdated" OnItemDeleted="rgCompanyType_ItemDeleted"
OnItemInserted="rgCompanyType_ItemInserted" OnDataBound="rgCompanyType_DataBound" AutoGenerateColumns="False">
<PagerStyle Mode="NextPrevAndNumeric" />
<MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="nSERVICEID,nSERVICETYPE"
DataSourceID="sdsServiceType" HorizontalAlign="NotSet" EditMode="InPlace">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
<ItemStyle/>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn UniqueName="SERVICEID" DataField="nSERVICEID" HeaderText="SERVICEID" ReadOnly="True" HeaderStyle-Width="10%" />
<telerik:GridBoundColumn DataField="nSERVICETYPE" HeaderText="SERVICETYPE" SortExpression="nSERVICETYPE"
UniqueName="SERVICETYPE" ColumnEditorID="GridTextBoxColumnEditor1">
</telerik:GridBoundColumn>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn">
<ItemStyle HorizontalAlign="Center"/>
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings ColumnNumber="2" CaptionDataField="SEVICETYPE" CaptionFormatString="Edit Company {0}" InsertCaption="New SERVICETYPE">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle></FormCaptionStyle>
<FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
Width="100%" />
<FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
UniqueName="EditCommandColumn1" CancelText="Cancel edit">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
<br />
<asp:Label ID="lblMessage" runat="server" EnableViewState="false" />
<br />
<asp:SqlDataSource ID="sdsServiceType" runat="server"
ConnectionString="<%$ ConnectionStrings:DotNetNukeConnectionString2 %>"
SelectCommand="sp_ServiceTypeSelect" SelectCommandType="StoredProcedure"
DeleteCommand="sp_ServiceTypeDelete" DeleteCommandType="StoredProcedure"
InsertCommand="sp_ServiceTypeInsert" InsertCommandType="StoredProcedure"
UpdateCommand="sp_ServiceTypeUpdate" UpdateCommandType="StoredProcedure">
<DeleteParameters>
<asp:Parameter Name="nSERVICEID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="nSERVICEID" Type="Int32" />
<asp:Parameter Name="nSERVICETYPE" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="nSERVICETYPE" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<!-- content end -->
</asp:Panel>
Please help me thanks