I have a RadGrid bound to SqlDataSource. All items are always in edit mode.
protected void RadGPozycje_PreRender(object sender, EventArgs e)
{
for (int i = 0; i < RadGPozycje.PageSize; i++)
{
RadGPozycje.EditIndexes.Add(i);
}
RadGPozycje.Rebind();
}
When bound, my cell “Vat” should change value to “zw” when value from database is equal to -1. I tried to do this like that:
private void RadGPozycje_ItemDataBound(object sender, GridItemEventArgs e)
{
GridDataItem item;
item = e.Item as GridDataItem;
if (item["Vat"].Text == "-1")
item["Vat"].Text = "zw";
}
and it doesn’t work. How can I do this so it will work?
I menaged to make it work at grid prerender instead of itemdatabound.