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

Passing Grid.SelecteditemID to RadTabStrip

4 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bricton Perez
Top achievements
Rank 1
Bricton Perez asked on 06 May 2010, 04:06 AM
Does somebody has an example for how Passing Grid.SelecteditemID to RadTabStrip

I appreciate your help

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 May 2010, 06:56 AM

Hello Bricton,

If I unserstand correctly, you want to select the RadTab based on the index of griditem selected. If so, one suggestion would be setting the SelectedIndex property of the RadTabStrip in 'SelectedIndexChanged' event of RadGrid.

C#:

 
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)  
    {  
        RadTabStrip1.SelectedIndex = RadGrid1.SelectedItems[0].ItemIndex;  
    } 

[I set the ClientSettings -> EnablePostBackOnRowClick property to True for grid]

-Shinu.

0
Bricton Perez
Top achievements
Rank 1
answered on 06 May 2010, 02:54 PM
Ok Shinu, thanks for reply, but I just want to ask you if I have to set the ItemCommand too...

Thank you

0
Shinu
Top achievements
Rank 2
answered on 07 May 2010, 11:52 AM

Hi Bricton Perez,

It is not neccessary to attach 'ItemCommand' event to Radgrid. But if you want to try same functionality by using ItemCommand, then try the following code snippet.

C#:

 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == "RowClick")  
        {  
            int index = (e.Item as GridDataItem).ItemIndex;  
            RadTabStrip1.SelectedIndex = index;  
        }  
    } 

Regards,

Shinu.

0
Bricton Perez
Top achievements
Rank 1
answered on 07 May 2010, 07:50 PM
Thanks for your answer but I have something: I have a RadGrid and a Tabstrip with 3 tabs "tab1|Tab2|Tab3 if I select the first row in the grid in thte first tab I have to get just the fields for that row, Ok... the same happen with the others 2 tabs, till now nothing new. But If I select the second row in the grid, if I click once the tab1 still shows the fields from the first row that I selected before, but if I click twice the grid in the tab1 update.

I don't know if that make sense, I hope you did understand me...

Can you tell me what can I do to fix it?

Regards
Tags
Grid
Asked by
Bricton Perez
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Bricton Perez
Top achievements
Rank 1
Share this question
or