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

grid selection question

4 Answers 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saro
Top achievements
Rank 1
Saro asked on 04 May 2012, 09:29 PM
I have a read only grid control on the web.  When you click on a row i want to be able to display whole bunch of information on the right side of the grid.  For example lets say you have a first name and last name showing on the grid.  Upon clicking on the grid row user can see further information such as address, email, etc on that user on the right side of the grid.
My questions are
 #1 the SelectedIndexChanged doesn't fire why? am i doing something wrong?
#2 I see the manual say use a checkbox.  It doesn't really work for me but I figured i place a checkbox on the grid( i don't see an option for autopostback on the checkbox column).  Anyways, I run  the app and the checkbox is disabled ( i can't click on it).
Can someone help me here?
Thanks

4 Answers, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 04 May 2012, 09:56 PM
your actual html would be helpful
for instance, if you have a combo box in a template column and the AutoPostBack is not set the selectedindex event won't fire
there are other ways of selecting a row on a grid but again, we need to see your actual grid (and the javascripts that go with it)
0
Saro
Top achievements
Rank 1
answered on 05 May 2012, 12:24 AM
Thanks for replying.  Here is the code i have:

<

 

telerik:RadGrid ID="gridSecondaryContacts" runat="server" Width="176px"

 

 

CellSpacing="0" GridLines="None" AutoGenerateColumns="False"

 

Height="271px" onneeddatasource="gridSecondaryContacts_NeedDataSource"

 

onselectedindexchanged="gridSecondaryContacts_SelectedIndexChanged"

 

AllowAutomaticInserts="True" >

 

<ClientSettings>

 

<Selecting AllowRowSelect="True" />

 

</ClientSettings>

 

<MasterTableView>

 

<CommandItemSettings ExportToPdfText="Export to PDF" />

 

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">

 

<HeaderStyle Width="20px" />

 

</RowIndicatorColumn>

 

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">

 

<HeaderStyle Width="20px" />

 

</ExpandCollapseColumn>

 

<Columns>

 

<telerik:GridCheckBoxColumn FilterControlAltText="Filter checked column"

 

UniqueName="checked">

 

</telerik:GridCheckBoxColumn>

 

<telerik:GridBoundColumn FilterControlAltText="Filter column column"

 

UniqueName="First_Name" DataField="First_Name" HeaderText="First Name">

 

</telerik:GridBoundColumn>

 

<telerik:GridBoundColumn FilterControlAltText="Filter column"

 

UniqueName="Last_Name" DataField="Last_Name" HeaderText="Last Name">

 

</telerik:GridBoundColumn>

 

</Columns>

 

<EditFormSettings>

 

<EditColumn FilterControlAltText="Filter EditCommandColumn column">

 

</EditColumn>

 

</EditFormSettings>

 

</MasterTableView>

 

<FilterMenu EnableImageSprites="False">

 

</FilterMenu>

 

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">

 

</HeaderContextMenu>

 

</telerik:RadGrid>



like i said just a grid with 2 columns and click on a row and see if it fires SelectedIndexChange
Thanks

 

 

 

 

 

 

protected void gridSecondaryContacts_SelectedIndexChanged(object sender, EventArgs e)

{

 

protected void gridSecondaryContacts_SelectedIndexChanged(object sender, EventArgs e)

{


 

protected void gridSecondaryContacts_SelectedIndexChanged(object sender, EventArgs e)

{

0
Elliott
Top achievements
Rank 2
answered on 07 May 2012, 03:57 PM
try adding this to your grid
<ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" >
0
Saro
Top achievements
Rank 1
answered on 07 May 2012, 04:13 PM
thanks.
That worked!
Tags
Grid
Asked by
Saro
Top achievements
Rank 1
Answers by
Elliott
Top achievements
Rank 2
Saro
Top achievements
Rank 1
Share this question
or