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

Firing SelectedIndex Change Event

4 Answers 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jebamalai
Top achievements
Rank 1
Jebamalai asked on 18 Sep 2008, 07:46 AM
Dear All,

I am using the Rad Grid for AJAX. 

In that I have bounded the selected index change event, but it is not firing.

My designer code is:

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        Skin="Office2007" AutoGenerateColumns="false" GroupingEnabled="False" PageSize="5"
        ShowStatusBar="True" AllowMultiRowSelection="true">
        <PagerStyle Mode="Slider" />
        <MasterTableView NoDetailRecordsText="No Versions Found." NoMasterRecordsText="No Documents Found."
            HierarchyLoadMode="Client">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="True" AllowColumnHide="True" AllowColumnsReorder="True"
            ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
        <FilterMenu EnableTheming="True" Skin="Office2007">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>


Can any one help me in this regard?

Thanks a lot in advance.

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 18 Sep 2008, 08:17 AM
Hello Jebamalai,

Have you set the SelectedIndexChanged event for the grid since i could not find it in the code you had provided.  If yes, then try setting the EnablePostBackOnRowClick property to true ass shown below.
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
            <MasterTableView> 
              .... 
            </MasterTableView>             
            <ClientSettings EnablePostBackOnRowClick="True" > 
                 <Selecting AllowRowSelect="True" /> 
            </ClientSettings> 
</telerik:RadGrid> 

Thanks
Princy.

0
Jebamalai
Top achievements
Rank 1
answered on 18 Sep 2008, 08:48 AM
Dear Princy,

Thanks for your timely support.


0
Jebamalai
Top achievements
Rank 1
answered on 11 Nov 2008, 11:46 AM
Dear Princy,

I have successfully fired the event and performed the required operations.

But now I have bounded a child table (Detail View) to the Master view.

When I click on the row in the child / detail table, the event is fired but, it is not taking the selected item.

Can you tell me how to get the selected item in the child / details table.

Thanks a lot in advance.
0
Shinu
Top achievements
Rank 2
answered on 12 Nov 2008, 06:50 AM
Hi Jebamalai,

You can try out the following code snippet to access the selected text in both Master as well as Detail table.

CS:
 protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.SelectedItems) 
        { 
            string selectedItem = item["columnUniqueName"].Text.ToString(); 
        } 
    } 


Thanks
Shinu.
Tags
Grid
Asked by
Jebamalai
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jebamalai
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or