RadGrid1_ItemUpdated
event i'm calling that function. But control is not going inside RadGrid1_ItemUpdated event. I'm binding the grid dynamically from oracle database. Any help would be appreciated.
Aspx:
<
asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" PageSize="5"
Width="612px" AutoGenerateEditColumn="True"
oniteminserted="RadGrid1_ItemInserted" onitemupdated="RadGrid1_ItemUpdated"
onneeddatasource="RadGrid1_NeedDataSource">
<PagerStyle AlwaysVisible="True" />
<
MasterTableView>
<
RowIndicatorColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
RowIndicatorColumn>
<
ExpandCollapseColumn>
<
HeaderStyle Width="20px"></HeaderStyle>
</
ExpandCollapseColumn>
<PagerStyle AlwaysVisible="True" />
</
MasterTableView>
<EditItemStyle BackColor="#FFFF66" BorderColor="Black" BorderStyle="Solid" />
</telerik:RadGrid>
</ContentTemplate>
</asp:UpdatePanel>
aspx.cs file:
protected
void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
BAL.
BAL balobj = newBAL.BAL(); //Business layer object
int flag = 0;
GridEditableItem item = (GridEditableItem)e.Item;
string cty = item.GetDataKeyValue("city_name").ToString();
string id = item.GetDataKeyValue("city_id").ToString();
//calling validation function
flag = balobj.validate_cityName(cty);
if (flag == 0)
{
balobj.New_City_Name = cty;
balobj.City_Id = int.Parse(id);
balobj.city_modify();
}
else
{
Label1.Visible =
true;
Label1.Text =
"<script>alert('City name already exists')</script>";
}
}
}