I want to display an error message in the grid if some operation has failed (update, delete, etc)
Ive followed an example suggested in the forums, but it doesnt work
gridMessage is supplied a value when something fails, I then rebind the grid
there IS a value in gridMessage when the NeedDataSource is fired, but the error message never gets displayed.
Anyone see what Im doing wrong here ?
Ive followed an example suggested in the forums, but it doesnt work
protected void RadGridImages_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
List<
Business.Logic.BusinessObjects.ArtistImage
> lst = new List<
Business.Logic.BusinessObjects.ArtistImage
>();
int aid = -1;
bool isOK = int.TryParse(this.HiddenArtistID.Value, out aid);
if (isOK)
{
lst = artistImageManager.Get(aid);
if (lst != null)
{
this.RadGridImages.DataSource = lst;
}
else
{
if (this.RadGridImages.DataSourceID == "")
{
this.RadGridImages.DataSource = new string[] { };
}
}
}
if (!string.IsNullOrEmpty(gridMessage))
{
DisplayMessage(gridMessage);
}
}
private void DisplayMessage(string text)
{
RadGridImages.Controls.Add(new LiteralControl(string.Format("<
span
style
=
'color:red'
>{0}</
span
>", text)));
}
gridMessage is supplied a value when something fails, I then rebind the grid
there IS a value in gridMessage when the NeedDataSource is fired, but the error message never gets displayed.
Anyone see what Im doing wrong here ?