I have a radcombo and a radgrid on a webpage. Both are ajax enabled (with RadAjaxManagerProxy)
If a user selects a value in the radcombo that is different to the combo's current value, I need to delete all the entries in the grid. Ive used this code
Ive set postback = true in the combo so the SelectedIndexChanged event gets fired, which in turn calls the DeleteGenres method. This works well, and the data displayed in the grid is deleted from the uderlying database. The problem is that the grid contents dont get refreshed, so the grid still shows the rows. If I hit the refresh button in the grid toolbar, the the grid contents disappear. I want the refresh to be part of the deletion method and I expected Rebind() to work. How Can I achieve this functionality ?
If a user selects a value in the radcombo that is different to the combo's current value, I need to delete all the entries in the grid. Ive used this code
protected void RadComboBoxType_SelectedIndexChanged1(object o, RadComboBoxSelectedIndexChangedEventArgs e) |
{ |
if (e.OldValue != e.Value) |
{ |
DeleteGenres(); |
} |
} |
private void DeleteGenres() |
{ |
long aid; |
bool ok = long.TryParse(this.HiddenArtistID.Value, out aid); |
if (ok) |
{ |
string _res = artistgenremanager.DeleteArtistGenres(aid); |
if (!string.IsNullOrEmpty(_res)) |
{ |
RadGridGenreCategories.Controls.Add(new LiteralControl("Unable to delete genres and categories. Reason: " + _res)); |
} |
else |
{ |
RadGridGenreCategories.Rebind(); |
} |
} |
} |