2011-08-02 6 views
0

私はこのようにASPxGridLookupを持っています。Devexpress:ASPxGridLookupのすべてのボタンをクリアします。

<dx:ASPxGridLookup ID="GridLookup" runat="server" Text='<%# Bind("AKTOR") %>' 
         ClientInstanceName="gridLookup" DataSourceID="SqlDataSource3" 
         KeyFieldName="KOD" MultiTextSeparator=";" SelectionMode="Multiple" 
         TextFormatString="{0}"> 
         <GridViewProperties> 
          <SettingsPager PageSize="20" /> 
         </GridViewProperties> 
         <Columns> 
          <dx:GridViewCommandColumn ShowSelectCheckbox="True" /> 
          <dx:GridViewDataColumn FieldName="KOD" /> 
          <dx:GridViewDataColumn CellStyle-Wrap="False" FieldName="ACIKLAMA" /> 
         </Columns> 
        </dx:ASPxGridLookup> 

このように見えます。

enter image description here

私は、このコントロールにClear Allボタンを追加します。どうやってやるの?

:このexampleのように、Closeボタンを押します。

答えて

1

この例は、別の製品に基づいています。 DropDownEditorも使いたいかもしれません。グリッドビューを配置し、クライアント側の機能を使用して必要なものを実現できるはずです。たぶんリストボックスで十分でしょう。 DropDownEditorを使用すると、他のコントロールを複雑に配置したテンプレートを使用できます。

[編集1]

ですから、このような何かを行うことができます:

あなたが実際にあなたがそのグリッドにしたい何かを行うことができますので、DropDownEditのグリッドをラップ
<dx:ASPxDropDownEdit ClientInstanceName="checkComboBox" ID="ASPxDropDownEdit1" SkinID="CheckComboBox" Width="210px" runat="server" EnableAnimation="False"> 
    <DropDownWindowStyle BackColor="#EDEDED" /> 
    <DropDownWindowTemplate> 
     <dx:ASPxGridLookup ID="GridLookup" runat="server" Text='<%# Bind("AKTOR") %>' 
        ClientInstanceName="gridLookup" DataSourceID="SqlDataSource3" 
        KeyFieldName="KOD" MultiTextSeparator=";" SelectionMode="Multiple" 
        TextFormatString="{0}"> 
        <GridViewProperties> 
         <SettingsPager PageSize="20" /> 
        </GridViewProperties> 
        <Columns> 
         <dx:GridViewCommandColumn ShowSelectCheckbox="True" /> 
         <dx:GridViewDataColumn FieldName="KOD" /> 
         <dx:GridViewDataColumn CellStyle-Wrap="False" FieldName="ACIKLAMA" /> 
        </Columns> 
     </dx:ASPxGridLookup> 
     <dx:ASPxButton ID="btnClear" runat="server" Text="Clear" AutoPostBack="False" /> 
    </DropDownWindowTemplate> 
</dx:DropDownEdit> 

。このボタンは、所望の動作をトリガするために使用することができる。次に、クライアントサイドスクリプトを使用するか、サーバー側を使用するかを決定する必要があります。しかし、それはあなた次第です。代替

あなたはフッターのテンプレートを使用する場合があります。

<dx:ASPxGridView ID="ASPxGridView1" runat="server" Settings-ShowFooter="true"> 
    <Templates> 
     <FooterRow> 
      Hallo ! 
     </FooterRow> 
    </Templates> 
</dx:ASPxGridView> 

あなたが好きな場所に置くことができますので、自由に感じてください。

+0

いいえ、 'Dropdowneditor'はパラメータとして列名を受け入れないため、' GridLookup'を使用します。あなたは何か考えていますか? –

関連する問題