or


<telerik:RadGrid ID="approvalGrid" runat="server" AllowPaging="true" ShowStatusBar="true" ShowFooter="false" AllowFilteringByColumn="false" FilterItemStyle-HorizontalAlign="Center" ShowGroupPanel="false"AutoGenerateColumns="false" PageSize="25" AllowSorting="true" AllowMultiRowSelection="false" GirdLines="Vertical" Skin="WebBlue" AlternatingItemStyle-HorizontalAlign="Center"ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" GroupingSettings-CaseSensitive="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowAutomaticDeletes="true" OnItemCommand="approvalGrid_ItemCommand"OnNeedDataSource="approvalGrid_NeedDataSource" OnItemDataBound="approvalGrid_ItemDataBound" Width="1080" EnableLinqExpressions="false"><EditFormSettings CaptionFormatString=" Approve ID #{0}" CaptionDataField="ID" EditFormType="Template"><PopUpSettings Modal="false" Width="550px" /><FormTemplate ><asp:Label ID="ApprovalWindowError" runat="server" Font-Bold="true" Font-Size="Large" Font-Underline="true" ForeColor="#990000" /<fieldset><legend><asp:Label ID="editLabel" runat="server" Text="Select A Location" Font-Bold="true" Font-Size="Medium"></asp:Label> </legend><table> <tr><td align="left"> Original Location:</td> <td align="left"> <telerik:RadButton ID="SendToOrig" runat="server" ButtonType="ToggleButton" ToggleType="Radio" GroupName="ApproveGroup" Text='<%#Bind("OrigLocation") %>'> </telerik:RadButton></td></tr><tr><td align="left">Receiving Location: </td> <td align="left"> <telerik:RadButton ID="SendToLocation" runat="server" ButtonType="ToggleButton" ToggleType="Radio" GroupName="ApproveGroup" Text='<%#Bind("Location") %>'></telerik:RadButton> </td></tr> </table> <table><tr><td align="right"> <telerik:RadButton ID="approveButton" runat="server" Text="Approve" Font-Bold="true" CommandName="Update"></telerik:RadButton><telerik:RadButton ID="cancelButton" runat="server" Text="Cancel" Font-Bold="true" CommandName="Cancel"></telerik:RadButton></td></tr></table></fieldset> </FormTemplate></EditFormSettings>protected void approvalGrid_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "Update") { GridEditableItem item = e.Item as GridEditableItem; //checks if at least one radio is pushed if ((item.FindControl("SendToOrig") as RadButton).Checked || (item.FindControl("SendToLocation") as RadButton).Checked) { if ((item.FindControl("SendToOrig") as RadButton).Checked) { successLabel.Text = "Adjustment Approved For Original Location"; } else { successLabel.Text = "Adjustment Approved For Receiving Location"; } } //if neither radios are pushed else { errorLabel.Text = "Approval Failed: You Did Not Select A Location"; } } if (e.CommandName == "Cancel") { errorLabel.Text = "Approval Canceled"; } }
Protected Sub RadButton1_Click(sender As Object, e As System.EventArgs) Handles RadButton1.Click Dim sql = (From p In DbContext.VUE_BACKOFFICE_INTERFACE_PHOTOs Select p Where p.etablissement.Contains(RadTextBox1.Text) Or p.titre.Contains(RadTextBox1.Text) Or p.description.Contains(RadTextBox1.Text) Or p.copyright.Contains(RadTextBox1.Text) Or p.tag.Contains(RadTextBox1.Text) Or p.sous_collection.Contains(RadTextBox1.Text) Order By p.id_photo Descending) If sql.Count <> 0 Then RadFilter1.RootGroup.Expressions.Clear() RadFilter1.RootGroup.GroupOperation = RadFilterGroupOperation.Or For Each result In sql Dim expr1 As New RadFilterEqualToFilterExpression(Of Integer)("id_photo") expr1.Value = result.id_photo RadFilter1.RootGroup.AddExpression(expr1) Next RadFilter1.RecreateControl() RadFilter1.FireApplyCommand() End If End Sub