...ElseIf e.CommandName = "InitInsertElement" Then e.Canceled = True Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary() newValues("IncludeInTotal") = True 'IF THE CostType CELL IN THE PARENT ROW = UnitCost THEN HIDE THE uxIncludeInTotal CHECKBOX ON THIS INSERT FORM DirectCast(e.Item, Telerik.Web.UI.GridDataItem).ChildItem.NestedTableViews(0).InsertItem(newValues)ElseIf .....If CType(editedItem.FindControl("uxAddNewAfterSave"), CheckBox).Checked Then Dim parentItem = CType(e.Item.OwnerTableView.ParentItem, Telerik.Web.UI.GridDataItem) parentItem.FireCommandEvent("InitInsertElement", String.Empty)End Ifa.RadForm_Hay:hover .rfdInner {color: #ACB936 !important;}
<telerik:GridBoundColumn AllowFiltering="true" AllowSorting="true" DataField="Accountrole.Name" HeaderText="<%$ Resources:Administration,Role %>" UniqueName="Accountrole.RoleId"> <FilterTemplate> <telerik:RadComboBox ID="RadComboBoxRole" DataSourceID="RoleDataSource" DataTextField="Name" DataValueField="RoleId" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Accountrole.RoleId").CurrentFilterValue %>' runat="server" OnClientSelectedIndexChanged="RoleIndexChanged"> <Items> <telerik:RadComboBoxItem Text="<%$ Resources:Basic,All %>" /> </Items> </telerik:RadComboBox> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function RoleIndexChanged(sender, args) { var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); tableView.filter("Accountrole.RoleId", args.get_item().get_value(), "EqualTo"); } </script> </telerik:RadScriptBlock> </FilterTemplate> </telerik:GridBoundColumn>protected void MyCustomControl_ItemSelected(string returnedValue){ var control = (RadGrid1.EditItems[0] as GridEdittableItem).FindControl("MyCustomTextBox"); if (control != null) { control.Text = returnedValue; }}Hi,
I try to add the Save and Cancel buttons to a RadEditor’s Toolbar by using the approach on the http://www.telerik.com/help/aspnet-ajax/addingsaveandcancelbuttonstoolbar.html page. When I run the code, I have the javascript error: “Microsoft JScript runtime error: 'RadEditorCommandList' is undefined”. Could you please let me know what I am missing?
Thank you
window.onbeforeunload event fires. Is there a way to prevent this from happening?
Hi
I use this code for invisibling components in grid when I click on "Add New Record" but in running program the error "Object reference not set to an instance of an object." occured. how can I write this code that not cause this error?
public partial class Permissions : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
rwmSuccessPM.Visible =
false;
}
private void InitalizeGroupGrid()
{
IQueryable<CDS.Savin.DataAccess.tS000Group> groups = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveAll();
this.grdGroups.DataSource = groups;
this.grdGroups.DataBind();
}
protected void grdGroups_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
IQueryable<CDS.Savin.DataAccess.tS000Group> groups = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveAll();
this.grdGroups.DataSource = groups;
}
protected void grdGroups_EditCommand(object source, GridCommandEventArgs e)
{
GridDataItem item = (GridDataItem)e.Item;
rowindex = item.ItemIndex;
String id = item.GetDataKeyValue("GroupID").ToString();
Session[
"GroupID"] = id;
}
int rowindex = -1;
protected void grdGroups_ItemCommand(object source, GridCommandEventArgs e)
{
//GridEditFormInsertItem editItem = (GridEditFormInsertItem)grdGroups.MasterTableView.GetInsertItem();
// System.Web.UI.UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);
//if (e.CommandName == RadGrid.EditCommandName)
//{
// GridDataItem item = (GridDataItem)e.Item;
// rowindex = item.ItemIndex;
//}
switch (e.CommandName)
{
case RadGrid.InitInsertCommandName:
{
System.Web.UI.
UserControl userControl = (System.Web.UI.UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");
Grid1.Visible =
false;
CheckBox chkWrite = (CheckBox)userControl.FindControl("chkWrite");
chkWrite.Visible =
false;
CheckBox chkRead = (CheckBox)userControl.FindControl("chkRead");
chkRead.Visible =
false;
CheckBox chkModify = (CheckBox)userControl.FindControl("chkModify");
chkModify.Visible =
false;
CheckBox chkDelete = (CheckBox)userControl.FindControl("chkDelete");
chkDelete.Visible =
false;
break;
}
case "Delete":
{
}
protected void grdGroups_PreRender(object sender, EventArgs e)
{
if (grdGroups.MasterTableView.IsItemInserted)
{
GridEditFormInsertItem editItem = (GridEditFormInsertItem)grdGroups.MasterTableView.GetInsertItem();
System.Web.UI.
UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);
TextBox txtbox = (TextBox)userControl.FindControl("txtGroupName");
RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");
}
if (rowindex > -1)
{
GridEditFormItem editItem = (GridEditFormItem)grdGroups.MasterTableView.GetItems(GridItemType.EditFormItem)[rowindex];
GridDataItem item = (GridDataItem)editItem.ParentItem;
System.Web.UI.
UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);
TextBox txtbox = (TextBox)userControl.FindControl("txtGroupName");
rowindex = 1;
IQueryable<CDS.Savin.DataAccess.tS000Group> GroupName = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveGroupName(int.Parse(item.Cells[3].Text));
txtbox.Text = GroupName.First().GroupName;
RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");
Grid1.DataSource = CDS.Savin.Logic.BusinessObjects.UI.
GroupPermissions.Retrieve(int.Parse(item.Cells[3].Text));
Grid1.DataBind();
rowindex = -1;
}
}
}