How to let my CheckBox selected by default in my GridPanel with its CheckboxSelectionModel?

  1. #1

    How to let my CheckBox selected by default in my GridPanel with its CheckboxSelectionModel?

    Hi :

    I have a Gridpanel with CheckboxSelectionModel. Now how can I let my CheckBoxs selected by default if I have some dateSource?
    Let us see my code:
    RowSelectionModel sm = GridPanelBU.SelectionModel.Primary as RowSelectionModel;
    SelectedRow row = new SelectedRow();
    foreach (var s in mylist)  //"mylist" means which rows need to be checked
        string buID = s.bu_id;
        row.RecordID = buID;
    But it has no use. Hope your helps. Thanks.
  2. #2

    Default check

    <ext:GridPanel ID="dgvIndividual" runat="server" Border="false" TrackMouseOver="true"
                   AutoScroll="true" Height="200">
                        <ext:Store ID="dsIndividual" runat="server" RemoteSort="true" UseIdConfirmation="true"
                                <ext:HttpProxy Url="/IndividualData/LoadIndividualToEvent/">
                                <ext:JsonReader IDProperty="ID" Root="data" TotalProperty="total">
                                        <ext:RecordField Name="ID" />
                                        <ext:RecordField Name="ProcessStatusCode" />
                                        <ext:RecordField Name="ProcessStatusCode_View" />
                                        <ext:RecordField Name="RelationshipToPrincipalRepresentative" />
                                        <ext:RecordField Name="RelationshipToPrincipalRepresentative_View" />
                                        <ext:RecordField Name="IndividualAge" Type="Int" />
                                        <ext:RecordField Name="ConcatenatedName" />
                                        <ext:RecordField Name="SexCode" />
                                        <ext:RecordField Name="SexCode_View" />
                                <ext:Parameter Name="limit" Value="15" Mode="Raw" />
                                <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                <ext:Parameter Name="dir" Value="ASC" />
                                <ext:Parameter Name="sort" Value="ID" />
                                <ext:Parameter Name="IndividualID" Value="" Mode="Value" />
                                <ext:Parameter Name="ProcessGroupID" Value="" Mode="Value" />
                            <SortInfo Field="ID" Direction="ASC" />
                                <Load Handler="dgvIndividual.getSelectionModel().selectRecords(records);" />
                    <ColumnModel ID="ColumnModel1" runat="server">
                            <ext:RowNumbererColumn />
                            <ext:Column ColumnID="IndividualID" DataIndex="ID" Header="" />
                            <ext:Column ColumnID="ProcessStatusCode" DataIndex="ProcessStatusCode" Header="Ind. Status">
                                <Renderer Fn="ChangeProcessStatusCode" />
                            <ext:Column ColumnID="ConcatenatedName" DataIndex="ConcatenatedName" Header="Full Name"
                                Width="240" />
                            <ext:Column ColumnID="SexCode" DataIndex="SexCode_View" Header="Sex" Width="150" />
                            <ext:Column ColumnID="IndividualAge" DataIndex="IndividualAge" Header="Age" Width="150" />
                            <ext:Column ColumnID="RelationshipToPrincipalRepresentative" DataIndex="RelationshipToPrincipalRepresentative_View"
                                Header="Relation to PA/HR1" Width="250" />
                        <ext:Toolbar ID="TransferToolbar" runat="server">
                                <ext:Label ID="Label1" runat="server" Text="Пожалуйста, выберите лиц." />                            
                        <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="15" />
                    <LoadMask ShowMask="true" />
                    <SaveMask ShowMask="true" />

Similar Threads

  1. [CLOSED] Checkbox Selected Rows in GridPanel
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 12, 2012, 1:00 PM
  2. [CLOSED] Default selected checkbox in gridview
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 06, 2010, 10:57 AM
  3. [CLOSED] CheckboxSelectionModel Checkbox hide
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 29, 2010, 2:14 PM
  4. Replies: 2
    Last Post: Jul 20, 2009, 1:10 PM
  5. Loading the GridPanel with checkbox selected
    By flaviodamaia in forum 1.x Help
    Replies: 0
    Last Post: Jun 03, 2009, 4:36 PM

Tags for this Thread

Posting Permissions