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

Displaying RadGrid

1 Answer 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 15 Oct 2013, 08:17 PM
Good afternoon,
In my Web Application I do have searching criteria with RadComboBox on it.RadComboBox consist of 2 values.Based on these value I am displaying RadGrid on the screen.
If value 'A' - all 4 Grids are displaying
if value 'P' - only 2 Grids are displaying.
My question is:If user select  value 'A' I need to display only 2 Grids and these grids are described in aspx page two bottom grids.How to display these 2 grids on the top of the screen like overlayed first two.
Because if I make first two visible=false then 2 other grids will display on the bottom of the page.

Thanks so much for your help

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Oct 2013, 09:47 AM
Hi,

I have tried your described scenario,the grids were aligning perfectly,even when the grids above are hidden,the below grids are moved up.Below is the sample code snippet that I tried.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
    <Items>
        <telerik:RadComboBoxItem Text="A" Value="A" />
        <telerik:RadComboBoxItem Text="P" Value="P" />
    </Items>
</telerik:RadComboBox>
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" Visible="false">
    <MasterTableView>
    </MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="SqlDataSource2" Visible="false">
    <MasterTableView>
    </MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadGrid ID="RadGrid3" runat="server" DataSourceID="SqlDataSource3" Visible="false">
    <MasterTableView>
    </MasterTableView>
</telerik:RadGrid>
<br />
<telerik:RadGrid ID="RadGrid4" runat="server" DataSourceID="SqlDataSource4" Visible="false">
    <MasterTableView>
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    string val=RadComboBox1.SelectedValue;
    if (val == "A")
    {
        RadGrid1.Visible = true;
        RadGrid2.Visible = true;
        RadGrid3.Visible = true;
        RadGrid4.Visible = true;
    }
    if(val=="P")
    {
        RadGrid1.Visible = false;
        RadGrid2.Visible = true;
        RadGrid3.Visible = false;
        RadGrid4.Visible = true;
    }
}

Thanks,
Shinu
Tags
General Discussions
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or