Dynamically change the label name and add the label name in ASP.NET for ext gridview

n706683

New member
Joined
May 14, 2023
Messages
1
Programming Experience
Beginner
In the below .aspx markup based on group field the tree view is getting bound in the frontend but to that tree view for the child values I need to bind select all and unselect all based on the condition like if all the child values in the Group are selected the it should show Unselect all, if child values are not selected it should show Select All. How can I achieve this?

ASP.net:
<ext:Store ID="stStudents" runat="server" GroupField="Subjects">
    <Model>
        <ext:Model ID="Model8" runat="server">
            <Fields>
                <ext:ModelField Name="ID" />
                <ext:ModelField Name="Name" />
            </Fields>
        </ext:Model>
    </Model>
    <Sorters>
        <ext:DataSorter Property="Name" Direction="ASC" />
    </Sorters>
</ext:Store>
<ext:Container runat="server">
    <LayoutConfig>
        <ext:HBoxLayoutConfig Align="Middle"/>
    </LayoutConfig>
    <Items>
        <ext:DisplayField runat="server" FieldLabel="<%$ Resources: Src,Rpeople%>" ID="DisplayField1"></ext:DisplayField>
        <ext:Panel runat="server" Flex="25" Title="<%$ Resources: Src,people%>">
            <Items>
                <ext:MultiSelect runat="server" ID="MultiSelect1" MultiSelect="true" DisplayField="Name" ValueField="ID" ShowCheckbox="false" SingleSelect="true" StoreID="stpeople">
                </ext:MultiSelect>
                <ext:GridPanel ID="GridPanel1" runat="server" Border="true" TitleAlign="Center" AutoHeight="true" Hidden="true" StoreID="stpeople">
                    <ColumnModel ID="ColumnModel2" runat="server">
                        <Columns>
                            <ext:Column ID="Column1" runat="server" Text="<%$ Resources: Src,Name%>" DataIndex="Name" Flex="1">
                            </ext:Column>
                            <ext:CommandColumn runat="server" Hidden="true">
                                <GroupCommands>
                                    <ext:CommandSpacer/>
                                    <ext:GridCommand Icon="Tick" CommandName="Select All">
                                        <ToolTip Title="Select" Text="" />
                                    </ext:GridCommand>
                                    <ext:CommandSpacer/>
                                    <ext:GridCommand Icon="Cross" CommandName="DeSelect All">
                                        <ToolTip Title="Deselect" Text="" />
                                    </ext:GridCommand>
                                </GroupCommands>
                                <Listeners>
                                    <GroupCommand Fn="onGroupCommand" />
                                </Listeners>
                            </ext:CommandColumn>
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CheckboxSelectionModel runat="server" ID="CheckboxSelectionModel1" Mode="Simple" ShowHeaderCheckbox="true">
                        </ext:CheckboxSelectionModel>
                    </SelectionModel>
                    <View>
                        <ext:GridView ID="GridView1" runat="server" TrackOver="false" ></ext:GridView>
                    </View>
                    <Features>
                        <ext:GroupingSummary runat="server" EnableNoGroups="true" HideGroupedHeader="true" EnableGroupingMenu="false" StartCollapsed="true">
                        </ext:GroupingSummary>
                    </Features>
                </ext:GridPanel>
            </Items>
        </ext:Panel>
    </Items>
</ext:Container>
7K5s4.png
 
You might get better answers from a forum that is more focused on EXT.net controls.

But if EXT.net follows along with the conventions setup by ASP.NET, anything that is runat="server" and has and ID should be accessible from your server side code, so you should be able to modify the properties and values of that control from the server side whenever there is a postback. If you are hoping to dynamically change those without a postback, that will really depend on what builtin support that EXT control has for client side updates. For that see my first paragraph above, or hope that someone on the forum here has that expertise or is patient enough to go through the documentation (that you hopefully have already checked).
 
Back
Top Bottom