This is a migrated thread and some comments may be shown as answers.

CRUD with template, Filtering is not working

1 Answer 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 28 Apr 2012, 07:44 PM
Hi, I have an automatic CRUD grid, but the filtering process is not working. Can you help me?

Insert/Delete/Edit all is working ok, but the Filtering is not.

<telerik:RadGrid id="grdReporto"
        ShowStatusBar="true" DataSourceID="sqlReporto"
        runat="server" OnItemCommand="grdReporto_ItemCommand" OnItemCreated="grdReporto_ItemCreated"  OnItemInserted="grdReporto_ItemInserted"
        OnItemDeleted="grdReporto_ItemDeleted" OnDataBound="grdReporto_DataBound" OnItemUpdated="grdReporto_ItemUpdated"
        AllowPaging="true" AllowFilteringByColumn="true"
        AllowSorting="true" AllowNaturalSort="false"
        AutoGenerateColumns="false"
        AllowMultiRowSelection="false">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView PageSize="15" NoDetailRecordsText="Sin Informacion"  CommandItemDisplay="Top" NoMasterRecordsText="Sin Informacion" AutoGenerateColumns="false"
        DataSourceID="sqlReporto" DataKeyNames="rowno" AllowFilteringByColumn="true">
        <CommandItemTemplate>
            <table style="width:100%">
                <tr>
                    <td width="50%" align="left">
                        <asp:LinkButton ID="InitInsertButton"  Text="Nuevo Usuario" CommandName="InitInsert" runat="server">
                        <img src="../../img/21.png" alt="" /> Nuevo Usuario
                        </asp:LinkButton>
                    </td>
                    <td width="50%" align="right">
                        <asp:LinkButton ID="LinkButton9" Text="Refresca" CommandName="Rebind" runat="server">
                        <img src="../../img/21.png" alt="" /> Refresca
                        </asp:LinkButton>
                    </td>
                </tr>
            </table>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Reporto" ImageUrl="../../img/accept.png" UniqueName="Reporto" />
            <telerik:GridBoundColumn
                UniqueName="rowno" ReadOnly="true"
                DataField="rowno" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Matricula" SortExpression="matricula" UniqueName="matricula"  EditFormColumnIndex="0">
                <ItemTemplate>
                    <asp:Literal runat="server" ID="litMatricula" Text='<%# Eval("matricula") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <span>
                        <telerik:RadTextBox runat="server" ID="txtMatricula" Width="150px" Text='<%# Bind("matricula") %>' />
                        <span style="color: Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMatricula" ErrorMessage="*" runat="server" />
                        </span>
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Nombre" SortExpression="nombre" UniqueName="nombre"  EditFormColumnIndex="0">
                <ItemTemplate>
                    <asp:Literal runat="server" ID="litNombre" Text='<%# Eval("nombre") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <span>
                        <telerik:RadTextBox runat="server" ID="txtNombre" Width="200px" Text='<%# Bind("nombre") %>' />
                        <span style="color: Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtNombre" ErrorMessage="*" runat="server" />
                        </span>
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Correo (sin @)" SortExpression="email" UniqueName="email"  EditFormColumnIndex="1">
                <ItemTemplate>
                    <asp:Literal runat="server" ID="litEmail" Text='<%# Eval("email") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <span>
                        <telerik:RadTextBox runat="server" ID="txtEmail" Width="150px" Text='<%# Bind("email") %>' />
                        <span style="color: Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtEmail" ErrorMessage="*" runat="server" />
                        </span>
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Ext" SortExpression="extension" UniqueName="extension"  EditFormColumnIndex="1">
                <ItemTemplate>
                    <asp:Literal runat="server" ID="litExt" Text='<%# Eval("extension") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <span>
                        <telerik:RadTextBox runat="server" ID="txtExt" Width="100px" Text='<%# Bind("extension") %>' />
                        <span style="color: Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtExt" ErrorMessage="*" runat="server" />
                        </span>
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn
                DataField="lastupdate" ReadOnly="true"
                HeaderText="Actualizacion" Visible="false"
                SortExpression="lastupdate"
                UniqueName="lastupdate">
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
            <telerik:GridButtonColumn ConfirmText="Eliminar este Usuario?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Eliminar" ButtonType="ImageButton" CommandName="Delete" Text="Eliminar"
                UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings ColumnNumber="2" CaptionDataField="nombre" CaptionFormatString="Editar Usuario {0}" InsertCaption="Nuevo Usuario">
            <FormTableItemStyle Wrap="False"></FormTableItemStyle>
            <FormCaptionStyle CssClass="tb1"></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="Inserta" UpdateText="Actualiza"
                UniqueName="EditCommandColumn1" CancelText="Cancelar">
            </EditColumn>
            <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true" />
    <PagerStyle Mode="NumericPages"></PagerStyle>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
iomega 55
Top achievements
Rank 1
answered on 29 Apr 2012, 04:42 AM
Tags
Grid
Asked by
iomega 55
Top achievements
Rank 1
Answers by
iomega 55
Top achievements
Rank 1
Share this question
or