how to handle GridDropDownColumn change event at server side inside MasterTableView column in radgrid Aspx

1 Answer 130 Views
DropDownList Grid
Kiran
Top achievements
Rank 1
Kiran asked on 01 Mar 2023, 06:06 PM | edited on 02 Mar 2023, 04:06 AM

Iam using telerik grid of asp.net

I want to disable column "telerik:GridNumericColumn " in below code snippet on changing "telerik:GridDropDownColumn" I am not aware of how to handle selection change event of GridDropDownColumn on server side and make one column disabled.

Please help in this regard.

Regards, Kiran

 

Below is the radgrid declaration


<telerik:RadGrid ID="rg" runat="server"
                                                AllowSorting="False"
                                                AutoGenerateColumns="False" Width="730px" Height="263px"
                                                OnUpdateCommand="rg_Update"
                                                OnInsertCommand="rg_Insert"
                                                OnDeleteCommand="rg_Delete"
                                                OnItemCreated="rg_ItemCreated"
                                                OnItemCommand="rg_ItemCommand"
                                                OnSelectedIndexChanged="rg_SelectedIndexChanged"
                                                OnNeedDataSource="rg_NeedDataSource"
                                                OnDataBound="rg_DataBound"
                                                GridLines="None"
                                                CellSpacing="0"
                                                MasterTableView-Caption="Routing Rules">
                                                <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
                                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                                    <Selecting AllowRowSelect="True" />
                                                </ClientSettings>

                                                <MasterTableView CommandItemDisplay="Top" DataKeyNames="Id,IndexId">
                                                    <CommandItemSettings AddNewRecordText="Add New Routing Rule" />
                                                    <Columns>
                                                        <telerik:GridButtonColumn UniqueName="editButton" ButtonType="ImageButton" CommandName="Edit" FilterControlAltText="Filter editButton column"
                                                            HeaderText="Edit" HeaderStyle-Width="34px" ItemStyle-HorizontalAlign="Left" Resizable="false"
                                                            ImageUrl="~\Images\pencil.png">
                                                        </telerik:GridButtonColumn>
                                                        <telerik:GridButtonColumn UniqueName="deleteButton" ButtonType="ImageButton" CommandName="Delete" FilterControlAltText="Filter deleteButton column"
                                                            HeaderText="Delete" HeaderStyle-Width="47px" ItemStyle-HorizontalAlign="Left" Resizable="false"
                                                            ImageUrl="~\Images\delete.png"
                                                            ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?">
                                                        </telerik:GridButtonColumn>
                                                        <telerik:GridBoundColumn Visible="false" DataField="Id" UniqueName="RoutingRuleRuleId" ReadOnly="True" />
                                                        <telerik:GridNumericColumn DataField="Priority" UniqueName="RoutingRulePriority" HeaderText="Priority" DataType="System.Int32" MaxLength="3" />

                                                        <telerik:GridDropDownColumn
                                                            HeaderText="Rule Type" DataField="RoutingRuleDefinitionId" SortExpression="uRuleType" UniqueName="uRuleType"
                                                            ColumnEditorID="myRuleTypeDropDownEditor"
                                                            ListTextField="Name" ListValueField="Id" EnableEmptyListItem="True"
                                                            EmptyListItemValue="0" Visible="False">
                                                        </telerik:GridDropDownColumn>
</MasterTableView>
</telerik:RadGrid>

Kiran
Top achievements
Rank 1
commented on 02 Mar 2023, 08:36 AM

Can we achieve this with GridDropDownColumn?

1 Answer, 1 is accepted

Sort by
0
Doncho
Telerik team
answered on 06 Mar 2023, 01:34 PM

Hi Kiran,

By default, the GridDropDownColumn renders a RadComboBox (or a DropDownList, if it is set as the DropDownControlType). You can access this edit control programmatically and subscribe to its SelectedIndexChanged event to execute the desired custom logic upon changing the selection:

Here are some relevant resources:

I hope this will help you achieve the desired.

Please let me know if any further questions come up.

Kind regards,
Doncho
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DropDownList Grid
Asked by
Kiran
Top achievements
Rank 1
Answers by
Doncho
Telerik team
Share this question
or