Straight to the point..
I have two RadGridView objects in separate RadTiles. The first is populated on page load and does not change. The second grid shows data depending on what is selected in the first grid.
When the CurrentCellChanged event is fired from the first grid, it should change the ItemSource of the second grid but the second grid doesn't change at all.
I'm sure I have missed a couple of lines of code somewhere, if someone could point out where I am going wrong, I would be very grateful :)
I have two RadGridView objects in separate RadTiles. The first is populated on page load and does not change. The second grid shows data depending on what is selected in the first grid.
When the CurrentCellChanged event is fired from the first grid, it should change the ItemSource of the second grid but the second grid doesn't change at all.
I'm sure I have missed a couple of lines of code somewhere, if someone could point out where I am going wrong, I would be very grateful :)
/*This is the codebehind for the page containing the first grid*/ |
public partial class Panel3 : RadPage |
{ |
public Panel3() |
{ |
InitializeComponent(); |
//Get the list of sites |
var proxy = new ServiceReference1.Service1Client(); |
proxy.GetSitesCompleted += new EventHandler<ServiceReference1.GetSitesCompletedEventArgs>(proxy_GetSitesCompleted); |
proxy.GetSitesAsync(); |
} |
void proxy_GetSitesCompleted(object sender, ServiceReference1.GetSitesCompletedEventArgs e) |
{ |
//Put the list of sites into the grid |
SiteGrid.ItemsSource = e.Result; |
} |
private void SiteGrid_CurrentCellChanged(object sender, GridViewCurrentCellChangedEventArgs e) |
{ |
//Get the value of the selected cell |
string SelectedSite = SiteGrid.CurrentCell.Value.ToString(); |
//Query using the value of the selected cell |
var proxy = new ServiceReference1.Service1Client(); |
proxy.SelectedZoneCompleted += new EventHandler<ServiceReference1.SelectedZoneCompletedEventArgs>(proxy_SelectedZoneCompleted); |
proxy.SelectedZoneAsync(SelectedSite); |
} |
void proxy_SelectedZoneCompleted(object sender, ServiceReference1.SelectedZoneCompletedEventArgs e) |
{ |
//Call some code from the other page.... |
//MessageBox.Show(e.Result.ToString()); |
new Panel4(e.Result); |
} |
} |
/*This is the codebehind for the page containing the second grid*/ |
public partial class Panel4 : RadPage |
{ |
public Panel4() |
{ |
InitializeComponent(); |
//This will load some default data |
GetGridData(1120009); |
} |
public Panel4(int site) |
{ |
InitializeComponent(); |
//This is called from Panel3 |
GetGridData(site); |
} |
void GetGridData(int site) |
{ |
//Get Data for the grid |
var proxy = new ServiceReference1.Service1Client(); |
proxy.GetCountsCompleted += new EventHandler<ServiceReference1.GetCountsCompletedEventArgs>(proxy_GetCountsCompleted); |
proxy.GetCountsAsync(site, DateTime.Today.AddDays(-15), DateTime.Today.AddDays(-14), DateTime.Now.AddHours(-2), DateTime.Now); |
} |
void proxy_GetCountsCompleted(object sender, ServiceReference1.GetCountsCompletedEventArgs e) |
{ |
//Change the ItemSource |
Grid1.ItemsSource = e.Result; |
} |
} |