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

[Solved] radGrid - display data on button click after selecting combo box on screen

1 Answer 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 18 Jan 2010, 12:34 PM
Hi,

I am using two combo boxes on top of my screen and then after user selects his choices he/she will click command button(GET DATA) to get data in radgrid. Initially radgrid is not visbile as it is not binded to any data source. I am binding the grid after button click. After command button(GET DATA) click I am getting data in grid and things are fine until now.

But when I hit edit on any row OR or add new record link in the grid, the grid vanishes. But when i click commnad button(GET DATA), I see grid in edit mode with values in edit row.

Question 1) When I click radgrid edit row link for the first time, Why is the grid going away/refresh/un-bound(cant see grid in screen).

Question 2) DO any one has examples for displaying grid data  as per user selection in combo box. This combo is on screen NOT in grid?

MY WHOLE PROJECT IS STUCK WITH THIS BUG. I appreciate any help ASAP.

thanks and regards
shanker.b 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jan 2010, 12:00 PM
Hello Shanker,

You can try the Advanced databinding technique in order to populate the grid according to dropdownlist selection. Set the Visibility of grid in the ButtonClick event and Rebind the grid. In the NeedDataSource event the create query according to dropdownlist values.

CS:
 
    protected void Button2_Click(object sender, EventArgs e) 
    { 
        RadGrid1.Visible = true
        RadGrid1.Rebind(); 
    } 
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        //Set the DataSource for radgrid after gettingt the dropdown value 
    } 

-Shinu.
Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or