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

[Solved] RadGrid OnSelectedIndexChanged in Combobox

1 Answer 188 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 06 May 2008, 03:12 PM
I have what seems to me like a very simple use of a RadGrid inside a combo box, but I haven't found a working example of jus this simple case.  My RadGrid is data bound in the ASPX file to a SQLDataSource.  It displays fine.

However, I need to handle row selection in the grid on the server side so I can take additional action whenever the selection changes but my OnSelectedIndexChanged event never seems to fire for the RadGrid.

Here is my markup:

<radc:RadComboBox id="VisitList" Width="600px" runat="server" >
    <ItemTemplate>
        <radg:RadGrid id="VisitsGrid" Width="100%" runat="server" EnableAJAX="true" 
                    EnableOutsideScripts="true" UseEmbeddedScripts="False"
                    AllowSorting="False" AutoGenerateColumns="True"
                    AllowPaging="false"
                    EnableViewState="True" ShowGroupPanel="False"
                    GridLines="Horizontal" Skin="Valco"
                    CellPadding="1" 
                    OnSelectedIndexChanged="VisitsGrid_RowChanged"
                    radControlsDir="./Resources/RadControls/" >
            <MasterTableView AutoGenerateColumns="True" 
                DataSourceID="SqlDataSourceVisits" DataKeyNames="AccountID"
                
Width="100%">
            </MasterTableView>
            <ClientSettings EnableClientKeyValues="true" >
                <Selecting AllowRowSelect="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="60px" />
            </ClientSettings>
        </radg:RadGrid>
    </ItemTemplate>
    <Items>
        <radc:RadComboBoxItem ID="VisitsListItem" runat="server" Text=" ">
        </
radc:RadComboBoxItem>
    </Items>
</radc:RadComboBox>

Any suggestions?

Thanks

Ed Hinton

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 06 May 2008, 04:07 PM
Hello Ed,

You should set ClientSettings-EnablePostBackOnRowClick property of the RadGrid to true in order for the PostBack to occur.

All the best,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Ed
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or