Hello Every One,
EditFormSettings inside RadComboBox Not Update ,
In my form EditFormSettings i have two RadComboBox first one choose that wise assign in second RadComboBox ,
In First RadComboBox that relevant values are come but not assigned in second RadComboBox,
aspx page.
.cs page assign procedure
Thanks,
Mohamed.
EditFormSettings inside RadComboBox Not Update ,
In my form EditFormSettings i have two RadComboBox first one choose that wise assign in second RadComboBox ,
In First RadComboBox that relevant values are come but not assigned in second RadComboBox,
aspx page.
<
tr
>
<
td
valign
=
"top"
align
=
"left"
>
Route Name
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"combo_routname"
runat
=
"server"
Width
=
"85%"
DataValueField
=
"routecode"
DataTextField
=
"routename"
MaxLength
=
"6"
AutoPostBack
=
"true"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"height: 5px;"
>
</
td
>
</
tr
>
<
tr
>
<
td
valign
=
"top"
align
=
"left"
>
Location
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"RadCombo_Location"
runat
=
"server"
Width
=
"85%"
MaxLength
=
"6"
DataValueField
=
"locationcode"
DataTextField
=
"locationplan"
>
</
telerik:RadComboBox
>
</
td
>
</
tr
>
.cs page assign procedure
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
{
if (e.Item.OwnerTableView.IsItemInserted)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
RadComboBox serviceprovname = (RadComboBox)item.FindControl("ComboBox_servprod");
RadComboBox routename = (RadComboBox)item.FindControl("combo_routname");
RadComboBox Location = (RadComboBox)item.FindControl("RadCombo_Location");
using (var db = new DoskContractServicesDataContext(Globals.strCon))
{
var orgreqfinal = (from a in db.dsroutemasters
where a.status != "DEL"
select new { a.routecode, a.routename }).ToList();
routename.DataSource = orgreqfinal;
routename.DataValueField = "routecode";
routename.DataTextField = "routename";
var datamaster = (from a in db.dsdatamasters
where a.status != "DEL" && a.datatype == "serpro"
select new { a.clientcode, a.clientname }).ToList();
serviceprovname.DataSource = datamaster;
serviceprovname.DataValueField = "clientcode";
serviceprovname.DataTextField = "clientname";
if (routename.SelectedValue != "")
{
Location.Text = "";
Location.SelectedValue = "";
Location.ClearSelection();
Location.Items.Clear();
string LocationWise = ("select distinct locationcode, locationplan from dslocationmaster where status <> 'del' and routecode = '" + routename.SelectedValue + "' ");
Location.DataSource = oDBClientADO.GetDataTable(LocationWise);
Location.DataValueField = "locationcode";
Location.DataTextField = "locationplan";
Location.DataBind();
}
else
{
string LocationWise = ("select distinct locationcode, locationplan from dslocationmaster where status <> 'del'");
Location.DataSource = oDBClientADO.GetDataTable(LocationWise);
Location.DataValueField = "locationcode";
Location.DataTextField = "locationplan";
}
}
}
else
{
GridEditFormItem item = (GridEditFormItem)e.Item;
RadComboBox serviceprod = (RadComboBox)item.FindControl("ComboBox_servprod");
RadComboBox routename1 = (RadComboBox)item.FindControl("combo_routname");
RadComboBox Location = (RadComboBox)item.FindControl("RadCombo_Location");
using (var db = new DoskContractServicesDataContext(Globals.strCon))
{
var orgreqfinal = (from a in db.dsroutemasters
where a.status != "DEL"
select new { a.routecode, a.routename }).ToList();
routename1.DataSource = orgreqfinal;
routename1.DataValueField = "routecode";
routename1.DataTextField = "routename";
var datamaster = (from a in db.dsdatamasters
where a.status != "DEL" && a.datatype == "serpro"
select new { a.clientcode, a.clientname }).ToList();
serviceprod.DataSource = datamaster;
serviceprod.DataValueField = "clientcode";
serviceprod.DataTextField = "clientname";
if (routename1.SelectedValue != "")
{
string LocationWise = ("select distinct locationcode, locationplan from dslocationmaster where status <> 'del' and routecode = '" + routename1.SelectedValue + "' ");
Location.DataSource = oDBClientADO.GetDataTable(LocationWise);
Location.DataValueField = "locationcode";
Location.DataTextField = "locationplan";
}
else
{
string LocationWise = ("select distinct locationcode, locationplan from dslocationmaster where status <> 'del'");
Location.DataSource = oDBClientADO.GetDataTable(LocationWise);
Location.DataValueField = "locationcode";
Location.DataTextField = "locationplan";
}
}
if (e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditFormItem editForm = (GridEditFormItem)e.Item;
string serviceid = editForm["servprovcde"].Text;
if (serviceid != " ")
{
SERVICEID1 = Convert.ToInt32(serviceid);
if (SERVICEID1 > 0)
{
RadComboBox Servprd = (RadComboBox)item.FindControl("ComboBox_servprod");
RadComboBox Rutnam = (RadComboBox)item.FindControl("combo_routname");
RadComboBox lctn = (RadComboBox)item.FindControl("RadCombo_Location");
List<
dsservicedeptnotify
> service = DbClient.GetList<
dsservicedeptnotify
>("servprovcde = " + SERVICEID1);
Servprd.SelectedValue = service[0].providercode.ToString();
Rutnam.SelectedValue = service[0].routecode.ToString();
lctn.SelectedValue = service[0].location.ToString();
}
}
}
}
}
}
Thanks,
Mohamed.