or
<telerik:RadGrid ID="grdCompanyList" runat="server" GridLines="None" AutoGenerateColumns="False" AllowSorting="True" AllowFilteringByColumn = "True" AllowPaging="True" EnableLinqExpressions="False" PageSize="10" OnNeedDataSource="grdCompanyList_NeedDataSource" OnItemCreated="grdCompanyList_ItemCreated"> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <MasterTableView DataKeyNames="watchlist_id" CommandItemDisplay="Top" EditMode="PopUp"> <CommandItemSettings ShowAddNewRecordButton="false"/> <Columns> <telerik:GridBoundColumn DataField="watchlist_id" DataType="System.Int32" HeaderText="watchlist_id" ReadOnly="True" SortExpression="watchlist_id" UniqueName="watchlist_id" Visible="false" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="company_id" DataType="System.Int32" HeaderText="company_id" ReadOnly="True" SortExpression="company_id" UniqueName="company_id" Visible="false" > </telerik:GridBoundColumn> <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="180px"> <ItemTemplate> <asp:Image width="142" height="58" ID="CompLogos" ImageUrl="<%# showCompLogo(Container.DataItem) %>" runat="server" AlternateText="Logo" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="company_name" HeaderText="Company name" SortExpression="company_name" ItemStyle-Width="450" UniqueName="company_name" ReadOnly="true"> <ItemStyle Width="450px" /> </telerik:GridBoundColumn> <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="50px"> <ItemTemplate> <asp:HyperLink ID="CoLink" runat="server" Text="Edit" ImageUrl="~/images/viewicon_big.png" ToolTip="View Details"></asp:HyperLink> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"></ClientSettings> </telerik:RadGrid>protected void grdCompanyList_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { HyperLink CoLink = (HyperLink)e.Item.FindControl("CoLink"); GridDataItem item = (GridDataItem)e.Item; string Cid = item["company_id"].Text; CoLink.Attributes["href"] = "CompanyDetails.aspx?Id=" + Cid; } }protected void RadGrid1_PreRender(object sender, EventArgs e){ RadGrid grid = ((RadGrid)sender); foreach (GridItem header in grid.MasterTableView.GetItems(GridItemType.Header)) { }}
If user changes the name in the textbox user is shown with confirm box ok , cancel
if user clicks on ok edited name need to be changed
if user clicks on cancel old name need to be repopulated
Here i am facing problem in
1. repopulating the textbox with oldvalue
2.these textbox is placed in textbox when ever page is getting loaded it is showing confirm box
function TextChanged(Sender,EventArgs) { var sSave; var Nametext = $find('<%= radtxtName.ClientID %>'); sSave = confirm("Name is changed"); alert(sSave); if (sSave == true) { var NewValue = EventArgs.get_newValue(); Nametext .set_value(NewValue); } else { var oldValue = EventArgs.get_oldValue(); Nametext .set_value(oldValue); } }
<telerik:RadTextBox ID="radtxtName" runat="server" >
<ClientEvents OnValueChanged="TextChanged" />
</telerik:RadTextBox>
if (e.CommandName == "Update")
{
GridEditableItem editedItem = (e.Item as GridEditableItem);
/* do something here*/
editedItem.Visible =
false; //not working
editedItem.Edit =
false; // not working
}
Compilation ErrorDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30201: Expression expected. Source Error: Line 258: Line 259: Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As GridColumnCreatedEventArgs) Line 260: Dim colSettings As ColumnSettings = Settings.AutoGeneratedColumnSettings.Find(Function(cs) cs.UniqueName = e.Column.UniqueName) Line 261: Dim column As GridColumn = e.Column Line 262: Source File: C:\Documents and Settings\ddownie\My Documents\SasquatchV11\App_Code\GridSettingsPersister.vb Line: 260Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As GridColumnCreatedEventArgs) Dim colSettings As ColumnSettings = Settings.AutoGeneratedColumnSettings.Find(Function(cs) cs.UniqueName = e.Column.UniqueName) Dim column As GridColumn = e.Column If colSettings IsNot Nothing Then SetColumnSettings(column, colSettings) End If End Sub