
e.values("fieldName") = myValue ...

the problem is this, I added update panel to my page and even tried the RadAjax panel as well and both had the same trouble. The site works fine without the ajax, but as soon as I ajaxify and then click on one of my link buttons on the radgrid it pulls up all the modalpopup windows on the page and I do mean all of them. I went back and checked the modal opoups to make sure its calling the correct panels and buttons and each have there own, and like I said it calls only 1 when the page has no update panels. The following is the code of the radgrid.
The first one is a command item button that I am calling and the second sits on the datarow to add notes. I check all code behind and the only places I am calling the show is in this ItemCommand event. It makes no sense that the page works perfectly fine without ajax panels but when I put them in no matter which item command I call i shows both modal pop-ups. I would switch to Radwindow but there is data being saved via the pop-ups.
Protected Sub myradgrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles myradgrid.ItemCommand If (e.CommandName = "Tran") Then (this is a command item template button) Dim IssueIDs As String = "" For Each item As GridDataItem In myradgrid.Items Dim cb As CheckBox = item.FindControl("cbTransfer") Dim IssueId As String = item.GetDataKeyValue("intIssuedID").ToString If cb.Checked = True Then IssueIDs += IssueId & "," End If Next 'Check to see if they checked anything If IssueIDs = Nothing Then ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "noCheckbox();", True) Else 'Get the Issued Ids remove end comma to put in variable IssueIDs = IssueIDs.Remove(IssueIDs.Length - 1, 1) HFIssuedId.Value = IssueIDs FindEquip(IssueIDs) End If End If If (e.CommandName = "EditNotes") Then ( this is a row link button in radgrid) Dim Id As Integer = e.CommandArgument HFNotesID.Value = Id If CheckAdmin() = True Then GetNotes() End If pnlNotes_MPE.Show() End If If e.CommandName = "ExportToExcel" Then IsExport = True myradgrid.Columns(0).Visible = False myradgrid.Columns(3).Visible = False myradgrid.MasterTableView.GetColumn("NOTES").Visible = True myradgrid.ExportSettings.FileName = Replace(HFDigSig.Value, "'", "''") & "-iPBRHR" End If End SubThis is the fillEquip of the 1st Item command that calls the popup.
'get the items that where transferred to another user. Private Sub FindEquip(ByVal EquipId As String) sql = "statement" myRadItems.DataSource = getReader(sql) myRadItems.DataBind() pnlpop_MPE.Show() End Sub
<div style="width:100%; height:100%;"><table style="height:100%; width:100%;" border="0" cellspacing="0" cellpadding="0"> <tr style="height:100%; width:100%;"> <td style="height:100%; width:100%;"><telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" Height="100%" DataSourceID="SqlDataSource1" GridLines="None" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="true" ></Scrolling> </ClientSettings> <MasterTableView AutoGenerateColumns="True" DataKeyNames="ID" DataSourceID="SqlDataSource1" > <Columns> </Columns> </MasterTableView></telerik:RadGrid> </td> </tr></table> </div>
void PersistManager_LoadCustomSettings(object sender, PersistenceManagerLoadStateEventArgs e) { GridSettingsPersister loadPersister = new GridSettingsPersister(RadGrid1); string settings = (string)e.CustomSettings.ControlSettings[0].Value; loadPersister.LoadSettings(settings); RadGrid1.Rebind(); } void PersistManager_SaveCustomSettings(object sender, PersistenceManagerSaveStateEventArgs e) { GridSettingsPersister savePersister = new GridSettingsPersister(RadGrid1); e.CustomSettings.Add(new Telerik.Web.UI.ControlSetting() { Name = "clinics", Value = savePersister.SaveSettings() }); }Trying to use a RadSearchBox in a FilterTemplate while using OpenAccess (I believe using simple binding?) - not sure how to get the filtering to work/in code behind - looked at several samples/demos - but none seem to show how or if it will work when using OpenAccess (trying to stick with simple binding if possible)
Test code below
<telerik:RadGrid ID="RadGridResults" runat="server" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="OpenAccessLinqDataSource" GridLines="None" AllowPaging="True" AllowSorting="True" EnableLinqExpressions="False" AllowFilteringByColumn="True"> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <MasterTableView DataKeyNames="ProductID" DataSourceID="OpenAccessLinqDataSource1"> <Columns> <telerik:GridBoundColumn DataField="ProductRef" FilterControlAltText="Filter Product Ref column" HeaderText="ProductRef" SortExpression="ProductRef" UniqueName="ProductRef"> </telerik:GridBoundColumn> <telerik:GridDropDownColumn FilterControlAltText="Filter Brand Name column" UniqueName="ProductBrandName" DataSourceID="OpenAccessLinqDataSourceBrandName" DataField="ProductBrandNameID" HeaderText="Brand Name" SortExpression="CompanyName" ListValueField="CompanyID" AllowSorting="true" ListTextField="CompanyName" DropDownControlType="DropDownList"> <FilterTemplate> <telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="OpenAccessLinqDataSourceBrandName" DataTextField="CompanyName" DataValueField="CompanyID" ShowSearchButton="False" OnSearch="RadSearchBox1_Search"> </telerik:RadSearchBox> </FilterTemplate> </telerik:GridDropDownColumn>
Protected Sub RadSearchBox1_Search(sender As Object, e As SearchBoxEventArgs) RadGridResults.MasterTableView.FilterExpression = "([ProductBrandName] = " + e.Text + ")" Dim column As GridColumn = RadGridResults.MasterTableView.GetColumnSafe("ProductBrandName") column.CurrentFilterFunction = GridKnownFunction.EqualTo column.CurrentFilterValue = e.Text RadGridResults.DataBind() End Sub
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" Skin="Black" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated" AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false" OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand" OnPreRender="RadGrid1_PreRender" > <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Fixed" AllowMultiColumnSorting="True" EditMode="InPlace" > <DetailTables> <telerik:GridTableView DataKeyNames="CleaningId" CommandItemDisplay="Top" TableLayout="Fixed" Name="Cleaning" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false"> <Columns> <telerik:GridTemplateColumn Visible="false"> <ItemTemplate> <asp:Label ID="lblCleaningId" runat="server" Text='<%#Eval("CleaningId") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" ItemStyle-Width="25px" HeaderStyle-HorizontalAlign="Center" EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center"> </telerik:GridEditCommandColumn> <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');" ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderStyle-Width="180" UniqueName="Rate" HeaderText="Rate" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Right"> <ItemTemplate> <asp:RadioButton ID="rdbtnPerSqft" runat="server" Text="PerSqft" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' /> <asp:RadioButton ID="rdbtnFlat" runat="server" Text="Flat" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' /> </ItemTemplate> <EditItemTemplate> <asp:RadioButton ID="rdbtnPerSqftEdit" runat="server" Text="PerSqft" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' /> <asp:RadioButton ID="rdbtnFlatEdit" runat="server" CommandName="Flatrate" Text="Flat" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' /> <asp:TextBox ID="txtRateEdit" runat="server" Width="55" CssClass="AlgRgh" Visible="true" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>' onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px" ></asp:TextBox> </EditItemTemplate> <InsertItemTemplate> <asp:RadioButton ID="rdbtnPerSqftinsert" runat="server" Text="PerSqft" GroupName="Rate" /> <asp:RadioButton ID="rdbtnFlatinsert" runat="server" Text="Flat" GroupName="Rate" /> <asp:TextBox ID="txtRateinsert" runat="server" Width="55" CssClass="AlgRgh" onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px" ></asp:TextBox> </InsertItemTemplate> </telerik:GridTemplateColumn> </Columns> </telerik:GridTableView> </DetailTables> <Columns> <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false"> <ItemTemplate> <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left"> <ItemTemplate> <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="140px" HeaderStyle-Width="140px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left"> <ItemTemplate> <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label> </ItemTemplate> <FooterTemplate> <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label> </FooterTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true"> </ClientSettings></telerik:RadGrid>