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

Reduce page space with Radgrid.

7 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcio Nascimento
Top achievements
Rank 1
Marcio Nascimento asked on 26 Aug 2009, 01:33 PM
Hi everyone,

I have this scenario: A web page with 7 RadGrids and all of them are related with each other.
It is possible when I select one row on the first RadGrid, this RadGrid shows only the row selected?

This procedure will help me to reduce the space used on the screen and at the same time shows only the relevant information to the user.

Thanks any help.

Marcio Nascimento

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Aug 2009, 05:01 AM
Hi Marcio,

Give a try with the following approach and see whether it helps. Set the EnablePostBackOnRowClick property  to true and then in the SelectedIndexChanged event hide the rows which are not selected.

ASPX:
 
<ClientSettings EnablePostBackOnRowClick="true"  > 

CS:
 
    protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (!item.Selected) 
                item.Display = false
        } 
    } 


Thanks
Shinu
0
Marcio Nascimento
Top achievements
Rank 1
answered on 30 Aug 2009, 01:56 PM
Hi Shinu,

Thanks for your code. It works fine.
However, if I use a column to select the row and disable the option in smart tag: "Enable Client-Side rows selection", I continue to be able to select the row but the code not work.
Are you familiarized with that ?

Regards,

Marcio Nascimento
0
Shinu
Top achievements
Rank 2
answered on 31 Aug 2009, 06:53 AM
Hello Marcio,

I am afraid that I understood your question correctly. I guess you are trying to implement server side selection using GridButtonColumn and the above given code is not working for you. But i tried with server side as well as client side selection and  the above given code is working fine on my end.

ASPX:
 
<telerik:GridButtonColumn HeaderText="ButtonColumn" UniqueName="BtnCol" Text="Select" CommandName="Select"></telerik:GridButtonColumn> 

CS:
 
 protected void RadGrid2_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid2.MasterTableView.Items) 
        { 
            if (!item.Selected) 
                item.Display = false
        }  
    } 


NOTE:
If you are implementing Server side selection set the EnablePostBackOnRowClick property to false.

Regards
Shinu
0
Marcio Nascimento
Top achievements
Rank 1
answered on 31 Aug 2009, 12:08 PM
Hi Shinu,

I think I'm missing something because the code you provide is not working for me.
I can only get it to work when the option on smart tag: "Enable Client-Side rows selection" is marked.
The problem is that if I use this option, the user could select any row without need the GridButtonColumn either.
Maybe this is a bug of RadGrid??

Regards,

Marcio Nascimento
0
Princy
Top achievements
Rank 2
answered on 01 Sep 2009, 04:50 AM
Hi Marcio,

When client-side row selection is enabled using ClientSettings.Selecting.AllowRowSelect, users can select rows by clicking anywhere within the row or using a GridClientSelectColumn. Go through the following help article for getting more details about client side row selection.
Selecting a row with a click (client-side)

Server side row selection can be achieved with the help of a Grid a GridButtonColumn or TemplateColumn as described in the following help articles.
Selecting a row with a checkbox (server-side)
Selecting a row with a select button (server-side)

Princy
0
NTR
Top achievements
Rank 1
answered on 04 Oct 2012, 07:51 PM
I am trying RadGrid1 CheckBox selected Rows display in RadGrid2. RadGrid1 has 5 columns including check box. If select 2 rows using checkbox in RadGrid1 then click SUBMIT button (buttons are seperate from the RadGrid1)  then selected checkbox rows to show in RadGrid2. If click Submit then the output will selected checkbox rows from the RadGrid1 and some the columns will add in the RadGrid2 output.
RadGrid2 OUTPUT= RadGrid1 output (Not Checkbox Column) + Some columns will add in RadGrid2

Can you please give me suggestions for this problem.
0
Tsvetina
Telerik team
answered on 09 Oct 2012, 03:11 PM
Hi,

Can you please share the code which you use for populating the rows from the first grid into the second one? The correct approach would be to build up a datasource for the second grid, based on the selected information from the first. Then assign this datasource to RadGrid2 and rebind it.

Kind regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Marcio Nascimento
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marcio Nascimento
Top achievements
Rank 1
Princy
Top achievements
Rank 2
NTR
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or