Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
127 views
I have a Heierarchy RadGrid with one detail table and when I perform an insert on the detail table I perform an insert into the datasource of the parent table and everything works fine until I try to rebind the grid using " e.Item.OwnerTableView.ParentItem.OwnerTableView.DataBind()" in the RadGrid1_InsertCommand. I get an error "Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object." I tried to step through and it seems as if maybe it's erroring when trying to populate a control although I'm not sure. If I remove the rebind line it does the insert and I see the change after refreshing the grid which leads me to believe the data is good. Thanks for any help.
AkAlan
Top achievements
Rank 2
 answered on 11 Jan 2011
4 answers
240 views
Hi,

is there a possibility how I can hide directories displayed in right side (grid) of fileexplorer ?

I just want to display directories on left side.

I tried this:

 

function OnFileExplorerClientLoad(oExplorer, args) {
var masterTable = oExplorer.get_grid().get_masterTableView();

var items = masterTable.get_dataItems();

for (var i = 0; i < items.length; i++) {

var row = items[i];

row.visible = row.isDirectory();
}

Thank you

Dobromir
Telerik team
 answered on 11 Jan 2011
1 answer
85 views
I have a link (lnkSearch) that is ajaxed, which populates a grid when its clicked.  (link is ajaxed using RadAjaxManager)
I also have a button (btnExport) in the grid's PagerTemplate, which when clicked does the telerik grid.masterview.ExportToExcel() command.
However, since lnkSearch is ajaxed, the ExportToExcel() command doesn't work.

The lnkSearch is outside of the grid, so the following suggested telerik workaround doesn't get fired off when the user
clicks lnkSearch.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="OnRequestStart"

<script type="text/javascript">
   function onRequestStart(sender, args)
   {
       if (args.get_eventTarget().indexOf("btnExport") >= 0)
           args.set_enableAjax(false);
   }
</script>  

I have also tried the following but it didn't help either.
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    {
        Button btnExport = (Button)e.Item.FindControl("btnExport");
        ScriptManager.GetCurrent(Page).RegisterPostBackControl(btnExport);
    }
}

The ExportToExcel() does work when I disable ajax for the lnkSearch, which I want to avoid.

Thanks for your help!
- weezie

Mira
Telerik team
 answered on 11 Jan 2011
3 answers
74 views

i tried using this method in creating a Custom Filter Column

http://www.telerik.com/help/aspnet/grid/grdfilteringwithdropdownlist.html
and it works fine but when i tried using the radcombobox instead of MS DropDown List the selceted index changed doesn't works so can anyone help me in this

public class FilteringTemplateColumns : GridBoundColumn
   {
 
       string _dataSourceID;
 
       public string DataSourceID
       {
           get { return _dataSourceID; }
           set { _dataSourceID = value; }
       }
 
       string _dataTextField;
 
       public string DataTextField
       {
           get { return _dataTextField; }
           set { _dataTextField = value; }
       }
 
       string _dataValueField;
 
       public string DataValueField
       {
           get { return _dataValueField; }
           set { _dataValueField = value; }
       }
 
       protected override void SetupFilterControls(TableCell cell)
       {
           base.SetupFilterControls(cell);
           cell.Controls.RemoveAt(0);
           RadComboBox rcBox = new RadComboBox();
           rcBox.ID = "cmb" + this.DataField;
           rcBox.AutoPostBack = true;
           rcBox.DataTextField = DataTextField;
           rcBox.DataValueField = DataValueField;
           rcBox.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(rcBox_SelectedIndexChanged);
           rcBox.DataSourceID = DataSourceID;
           rcBox.AppendDataBoundItems = true;
           rcBox.Items.Insert(0, new RadComboBoxItem("", ""));
           rcBox.Items.Insert(1, new RadComboBoxItem("All", "All"));
           cell.Controls.AddAt(0, rcBox);
           cell.Controls.RemoveAt(1);
       }
 
       void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
       {
           RadComboBox list = sender as RadComboBox;
           GridFilteringItem filterItem = (sender as RadComboBox).NamingContainer as GridFilteringItem;
           if (this.DataType == System.Type.GetType("System.Int32") ||
               this.DataType == System.Type.GetType("System.Int16") ||
               this.DataType == System.Type.GetType("System.Int64"))
           {
               filterItem.FireCommandEvent("Filter", new Pair("EqualTo", this.UniqueName));
           }
           else // treat everything else like a string
           {
               if (list.SelectedValue != "All")
                   filterItem.FireCommandEvent("Filter", new Pair("Contains", this.UniqueName));
               else
                   filterItem.FireCommandEvent("Filter", new Pair("NoFilter", this.UniqueName));
           }
 
 
       }
 
 
 
       protected override void SetCurrentFilterValueToControl(TableCell cell)
       {
           base.SetCurrentFilterValueToControl(cell);
           RadComboBox list = (RadComboBox)cell.Controls[0];
           if (this.CurrentFilterValue != string.Empty)
           {
               list.Items.Clear();
               list.AppendDataBoundItems = true;
               list.DataBind();
               list.SelectedItem.Text = this.CurrentFilterValue;
               list.Items.Insert(0, new RadComboBoxItem("", ""));
               list.Items.Insert(1, new RadComboBoxItem("All", "All"));
           }
       }
 
       protected override string GetCurrentFilterValueFromControl(TableCell cell)
       {
           RadComboBox list = (RadComboBox)cell.Controls[0];
           return list.SelectedItem.Text;
       }
       protected override string GetFilterDataField()
       {
           return this.DataField;
       }
 
   }

Nikolay Rusev
Telerik team
 answered on 11 Jan 2011
1 answer
137 views
I'm trying to handle a RadDock close command client side so that I can set some other booleans in javascript, but I can't figure it out. I tried doing:
<tel:DockCommand OnClientCommand="CloseEmail" />

then having a javascript function

function CloseEmail(sender, eventArgs) {
    if (sender.get_dockZoneID() != "") {
        showingEmailDetail = false;
        sender.set_closed(true);
    }
}

but that wasn't firing (I put an alert() in there that wasn't showing).
I also tried using
<tel:DockCloseCommand OnClientCommand="CloseEmail" />

but that didn't fire it either. The javascript function is declared globally. Any ideas?
Svetlina Anati
Telerik team
 answered on 11 Jan 2011
2 answers
70 views
I am having trouble getting my dock to save state when I move my panels.  Is there a way to make dock automatically trigger save state without clicking a button or something?  Also is there a way to make my controls auto refresh in my docks?  Like setup a timer in update panel. Thanks
Pero
Telerik team
 answered on 11 Jan 2011
2 answers
185 views
Hi guys,
I am using rad captcha in my site and want to prevent the user if
user type the wrong captcha test . So for this i am validate the captcha by coding.
But i am facing the problem that captcha always give Return false in if(radcaptcha1.isvalid) and print error.
Here my code of Default.aspx
<asp:Label ID="lblCaptcha" runat="server" ForeColor="Red"></asp:Label>
                           <telerik:RadCaptcha ID="RadCaptcha1" runat="server" validationgroup="Submit">
                        </telerik:RadCaptcha>
 <asp:UpdatePanel runat="server" ID="UPbtnUpload" >
                        <ContentTemplate>
                             <asp:ImageButton runat="server" ID="btnUpload" CssClass="btnAdd" ImageUrl="~/Images/btnUpload.jpg"
                                OnClick="btnUpload_OnClick" ValidationGroup="Submit" />
                                
                            </ContentTemplate>
                            <Triggers>
                            <asp:PostBackTrigger ControlID="btnUpload" />
                            </Triggers>
                        </asp:UpdatePanel>
And the code of default.aspx.cs is
protected void btnUpload_OnClick(object sender, EventArgs e)
       {
           RadCaptcha1.Validate();
          Page.Validate();
 
          
           if (RadCaptcha1.IsValid)
           {
                
               testimonial.ClubName = txtClub.Text;
               testimonial.Desciption = txtDiscription.Text;
               if (imageFileUpload.UploadedFiles.Count > 0)
               {
                   Guid guid = new Guid();
 
                   testimonial.FileName = imageFileUpload.UploadedFiles[0].FileName;
                   testimonial.FilePhysicalPath = imageFileUpload.TargetFolder;
                   testimonial.FileUrl = imageFileUpload.TargetFolder + imageFileUpload.UploadedFiles[0].FileName;
               }
               bool isCreated = KiwanisDataServices.CreateTestimonial(testimonial, ddlState.SelectedValue.ToString());
               ResetForm();
           }
           else
           {
               lblCaptcha.Enabled = true;
               lblCaptcha.Text = "The code you entered is not valid";
               return;
               //RadCaptcha1.ErrorMessage = "deepak";
           }
  Plz help me out for this problem there is any general solution of this.
I am structed with this problem plz telrik help me ya give me some example by this i can  accomplish it.
Pero
Telerik team
 answered on 11 Jan 2011
3 answers
192 views
Hi
I have a major prublem
 I have a grid and 4 check boxes   in User Control and they use in a MainGrid ,when I click on the Edit button in MainGrid, these components(gridUserControl and checkboxes ) fill but when I click on the Add New Record(whitout click on cancel button and close the edit ) they empty and don't bind . how can I bind them after clicking  add New Record?

the c# code is:

 

 

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)

 

{

 

 

 

switch (e.CommandName)

 

{

 

 

case RadGrid.InitInsertCommandName:

 

{

 

 

 

break;

 

}

 

 

 

case "Delete":

 

{

 

e.Canceled =

 

false;

 

 

 

GridDataItem dataItem = (GridDataItem)e.Item;

 

 

 

String id = dataItem.GetDataKeyValue("GroupID").ToString();

 

 

 

try

 

{

CDS.Savin.Logic.BusinessObjects.UI.

 

Groups.Delete(int.Parse(id));

 

}

 

 

catch { rwmSuccessPM.Visible = true; }

 

InitalizeGroupGrid();

 

 

break;

 

}

}

 

}

 

 

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");

 

 

 

 

 

 

 

//int? GroupID = CDS.Savin.Logic.BusinessObjects.UI.Groups.GroupID();

 

 

 

//Grid1.DataSource = CDS.Savin.Logic.BusinessObjects.UI.GroupPermissions.Retrieve(GroupID);

 

 

 

//Grid1.DataBind();

 

}

 

 

if (rowindex > -1)

 

{

 

}

 

}

 

 

protected void grdGroups_InsertCommand(object source, GridCommandEventArgs e)

 

{

}

 

 

protected void grdGroups_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

 

if (e.Item is GridEditFormItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted)

 

{

 

 

GridEditFormItem editItem = (GridEditFormItem)e.Item;

 

 

 

GridDataItem item = (GridDataItem)editItem.ParentItem;

 

System.Web.UI.

 

UserControl usercontrol1 = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

TextBox txtbox = (TextBox)usercontrol1.FindControl("txtGroupName");

 

 

 

RadGrid Grid1 = (RadGrid)usercontrol1.FindControl("PermissionGrid");

 

 

 

IQueryable<CDS.Savin.DataAccess.tS000Group> GroupName = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveGroupName(int.Parse(item.Cells[3].Text));

 

txtbox.Text = GroupName.First().GroupName;

 

 

ImageButton ImageButton1 = (ImageButton)usercontrol1.FindControl("ImageButton1");

 

ImageButton1.Visible =

 

false;

 

Grid1.Visible =

 

true;

 

 

 

CheckBox chkWrite = (CheckBox)usercontrol1.FindControl("chkWrite");

 

chkWrite.Visible =

 

true;

 

 

 

CheckBox chkRead = (CheckBox)usercontrol1.FindControl("chkRead");

 

chkRead.Visible =

 

true;

 

 

 

CheckBox chkModify = (CheckBox)usercontrol1.FindControl("chkModify");

 

chkModify.Visible =

 

true;

 

 

 

CheckBox chkDelete = (CheckBox)usercontrol1.FindControl("chkDelete");

 

chkDelete.Visible =

 

true;

 

Grid1.DataSource = CDS.Savin.Logic.BusinessObjects.UI.

 

GroupPermissions.Retrieve(int.Parse(item.Cells[3].Text));

 

Grid1.DataBind();

 

 

int kItems = Grid1.Items.Count;

 

 

 

for (int i = 0; i < kItems; i++)

 

{

CDS.Savin.DataAccess.

 

tS000GroupPermission groupPermision = new CDS.Savin.DataAccess.tS000GroupPermission();

 

groupPermision.GroupPermissionID =

 

int.Parse(Grid1.Items[i].OwnerTableView.DataKeyValues[Grid1.Items[i].ItemIndex]["ID"].ToString());

 

 

 

if ((Grid1.Items[i].FindControl("Modify") as CheckBox).Checked == false)

 

{

chkModify.Checked =

 

false; break;

 

}

 

 

else

 

chkModify.Checked =

 

true;

 

}

 

 

for (int i = 0; i < kItems; i++)

 

{

 

 

if ((Grid1.Items[i].FindControl("Delete") as CheckBox).Checked == false)

 

{

chkDelete.Checked =

 

false; break;

 

}

 

 

else

 

chkDelete.Checked =

 

true;

 

}

 

 

for (int i = 0; i < kItems; i++)

 

{

 

 

if ((Grid1.Items[i].FindControl("Read") as CheckBox).Checked == false)

 

{

chkRead.Checked =

 

false; break;

 

}

 

 

else

 

chkRead.Checked =

 

true;

 

}

 

 

for (int i = 0; i < kItems; i++)

 

{

 

 

if ((Grid1.Items[i].FindControl("Write") as CheckBox).Checked == false)

 

{

chkWrite.Checked =

 

false; break;

 

}

 

 

else

 

chkWrite.Checked =

 

true;

 

}

}

 

 

if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted )

 

{

 

 

GridEditFormInsertItem editItem = (GridEditFormInsertItem)e.Item;

 

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");

 

 

 

 

Label lblAccess = (Label)userControl.FindControl("lblAccess");

 

 

 

 

 

 

if (txtbox.Text == "")

 

{

 

lblAccess.Visible =

 

false;

 

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;

 

}

 

 

int? GroupID = CDS.Savin.Logic.BusinessObjects.UI.Groups.GroupID();

 

Grid1.DataSource = CDS.Savin.Logic.BusinessObjects.UI.

 

GroupPermissions.Retrieve(GroupID);

 

Grid1.DataBind();

 

}

}

 

 

}
the aspx code is:

 

<%

 

@ Page Title="" Language="C#" MasterPageFile="~/Template/WebUI.Master" AutoEventWireup="true"

 

 

 

 

 

 

 

CodeBehind="Permissions.aspx.cs" Inherits="CDS.Savin.WebUI.S000.Permissions" %>

 

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

 

 

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

 

 

 

 

 

 

 

<style type="text/css">

 

 

 

 

 

 

 

.EditFormHeader td

 

 

 

 

 

{

 

 

background: white;

 

 

 

padding: 5px 0px;

 

}

 

 

</style>

 

 

 

 

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

 

 

 

 

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

 

 

 

 

<script type="text/javascript">

 

 

 

 

 

 

 

function RowDblClick(sender, eventArgs) {

 

sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());

}

 

 

</script>

 

 

 

 

 

 

 

</telerik:RadCodeBlock>

 

 

 

 

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

 

 

 

 

<AjaxSettings>

 

 

 

 

 

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

 

 

 

 

 

<UpdatedControls>

 

 

 

 

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

 

 

 

 

</UpdatedControls>

 

 

 

 

 

 

 

</telerik:AjaxSetting>

 

 

 

 

 

 

 

</AjaxSettings>

 

 

 

 

 

 

 

</telerik:RadAjaxManager>

 

 

 

 

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

 

 

 

 

 

 

 

<telerik:RadGrid ID="grdGroups" runat="server" GridLines="None"

 

 

 

AllowPaging="True" CssClass="RadGrid"

 

 

 

 

 

 

 

AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True"

 

 

 

Skin="Office2007" onneeddatasource="grdGroups_NeedDataSource"

 

 

 

 

onitemcommand="grdGroups_ItemCommand"

 

 

 

onprerender="grdGroups_PreRender" oneditcommand="grdGroups_EditCommand"

 

 

 

oninsertcommand="grdGroups_InsertCommand" onitemdatabound="grdGroups_ItemDataBound"

 

 

 

 

>

 

 

 

 

 

 

 

<MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="GroupID"

 

 

 

Dir="RTL">

 

 

 

 

 

 

 

<CommandItemSettings AddNewRecordText="??? ???? ????" RefreshText="????????" />

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="????">

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<%

 

# Container.DataSetIndex + 1 %>

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="GroupID" HeaderText="?? ???? " Visible="false"

 

 

 

DataField="GroupID">

 

 

 

 

 

 

 

<HeaderStyle Width="60px"></HeaderStyle>

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="GroupTitle" HeaderText="??? ???? "

 

 

 

DataField="GroupName">

 

 

 

 

 

 

 

<HeaderStyle Width="60px"></HeaderStyle>

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridEditCommandColumn UniqueName="EditCommandColumn"

 

 

 

CancelText="??????" EditText="??????" UpdateText="?? ??? ?????">

 

 

 

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

 

 

 

<telerik:GridTemplateColumn>

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

<asp:LinkButton ID="DeleteColumn" Text="???" CommandName="Delete" runat="server" OnClientClick="return confirm('??? ??????? ?? ??? ????? ??? ????');" CausesValidation="False"></asp:LinkButton>

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

<%

 

-- <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="???" OnClientClick="return confirm('??? ??????? ?? ??? ????? ??? ????');"

 

CommandName="Delete" />--

 

 

%>

 

 

 

</Columns>

 

 

 

 

 

 

 

<EditFormSettings UserControlName="~/UserControls/Permission.ascx" EditFormType="WebUserControl">

 

 

 

 

 

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

 

 

 

 

 

</EditColumn>

 

 

 

 

 

 

 

</EditFormSettings>

 

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

 

<ClientSettings>

 

 

 

 

 

 

 

<ClientEvents OnRowDblClick="RowDblClick" />

 

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

<

 

 

HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>

 

 

 

 

 

 

 

</telerik:RadGrid><br />

 

 

 

 

 

 

 

<telerik:RadWindowManager ID="rwmSuccessPM" runat="server" CssClass="rtlstyle"

 

 

 

 

 

 

 

Visible="False" VisibleStatusbar="False" Height="185px" InitialBehaviors="Move"

 

 

 

 

 

 

 

Skin="Vista" Width="250px" Behavior="Default" InitialBehavior="Move">

 

 

 

 

 

 

 

<Windows>

 

 

 

 

 

 

 

<telerik:RadWindow ID="RadWindow2" runat="server" VisibleOnPageLoad="True" Behavior="Close,Move"

 

 

 

 

 

 

 

Behaviors="Move" InitialBehavior="Close" InitialBehaviors="Close" KeepInScreenBounds="True"

 

 

 

 

 

 

 

Modal="True" Left="" NavigateUrl="/Message/NotDelete.aspx" Style="display: none;"

 

 

 

 

 

 

 

Top="">

 

 

 

 

 

 

 

</telerik:RadWindow>

 

 

 

 

 

 

 

</Windows>

 

 

 

 

 

 

 

 

</telerik:RadWindowManager>

 

 

 

 

 

</

 

 

asp:Content>

 

 

 

 

the ascx code is:

<%

 

@ Control Language="C#" AutoEventWireup="true" CodeBehind="Permission.ascx.cs" Inherits="CDS.Savin.WebUI.UserControl.Permission" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

<

 

 

style type="text/css">

 

 

 

.style1

 

{

 

 

width: 48%;

 

}

 

 

.style3

 

{

 

 

width: 21px;

 

}

 

 

.style4

 

{

 

 

width: 180px;

 

}

 

 

.style5

 

{

 

 

width: 129px;

 

}

 

 

.style6

 

{

 

 

width: 159px;

 

}

 

 

.style7

 

{

 

 

width: 87px;

 

}

</

 

 

style>

 

<

 

 

table class="style1" dir="rtl" style="font-family: tahoma; font-size: small;">

 

 

 

<tr>

 

 

 

<td class="style7">

 

 

 

<asp:Label ID="Label1" runat="server" Text="??? ????:"></asp:Label>

 

 

 

</td>

 

 

 

<td class="style5">

 

 

 

<asp:TextBox ID="txtGroupName" runat="server"></asp:TextBox>

 

 

 

</td>

 

 

 

<td class="style4">

 

 

 

<asp:RequiredFieldValidator ID="rfvGroupName" runat="server"

 

 

 

ErrorMessage="RequiredFieldValidator" ControlToValidate="txtGroupName"

 

 

 

ForeColor="Red">*</asp:RequiredFieldValidator>

 

 

 

<asp:ImageButton ID="ImageButton1" runat="server" Height="16px"

 

 

 

ImageUrl="~/Template/Images/icon-plus.png" onclick="ImageButton1_Click"

 

 

 

Width="16px" />

 

 

 

</td>

 

 

 

<td class="style3">

 

 

 

&nbsp;</td>

 

 

 

<td>

 

 

 

&nbsp;</td>

 

 

 

</tr>

 

 

 

 

<tr>

 

 

 

<td class="style7">

 

 

 

&nbsp;</td>

 

 

 

<td class="style5">

 

 

 

&nbsp;</td>

 

 

 

<td class="style4">

 

 

 

<table>

 

 

 

 

<tr><td colspan="40"></td><td>

 

 

 

<asp:CheckBox ID="chkWrite" runat="server" Text="???"

 

 

 

AutoPostBack="True"

 

 

 

Font-Size="Small" TextAlign="Left"

 

 

 

oncheckedchanged="chkWrite_CheckedChanged" /></td><td>

 

 

 

<asp:CheckBox ID="chkModify" runat="server" Text="?????"

 

 

 

AutoPostBack="True" Font-Size="Small"

 

 

 

TextAlign="Left" oncheckedchanged="chkModify_CheckedChanged" /></td><td>

 

 

 

<asp:CheckBox ID="chkRead" runat="server" Text="??????"

 

 

 

AutoPostBack="True" Font-Size="Small"

 

 

 

TextAlign="Left" oncheckedchanged="chkRead_CheckedChanged" /></td><td>

 

 

 

<asp:CheckBox ID="chkDelete" runat="server" Text="???"

 

 

 

AutoPostBack="True" Font-Size="Small"

 

 

 

TextAlign="Left" oncheckedchanged="chkDelete_CheckedChanged" /></td>

 

 

 

</tr>

 

 

 

</table>&nbsp;</td>

 

 

 

<td class="style3">

 

 

 

&nbsp;</td>

 

 

 

<td>

 

 

 

&nbsp;</td>

 

 

 

</tr>

 

 

 

 

<tr>

 

 

 

<td class="style7">

 

 

 

<asp:Label ID="lblAccess" runat="server" Text="?????? ??:"></asp:Label>

 

 

 

</td>

 

 

 

 

 

<td colspan="4">

 

 

 

<telerik:RadGrid ID="PermissionGrid" runat="server" Skin="Windows7" GridLines="None"

 

 

 

AutoGenerateColumns="False"

 

 

 

onitemcommand="PermissionGrid_ItemCommand" Width="50%"

 

 

 

>

 

 

 

<MasterTableView EditMode="InPlace" DataKeyNames="ID,Action_ID" ShowFooter="true">

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="20px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn DataField="ID" HeaderText="??" UniqueName="column" Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Title" HeaderText="?????" ReadOnly="true" UniqueName="column1">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Action_ID" HeaderText="?? ????" Visible="false"

 

 

 

UniqueName="column2">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="?????">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="Write" Checked='<%# Eval("Write") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="?????">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="Modify" Checked='<%# Eval("Modify") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="??????">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="Read" Checked='<%# Eval("Read") %>' />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="???">

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox runat="server" ID="Delete" Checked='<%# Eval("Delete") %>' />

 

 

 

</ItemTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

<%

 

--<telerik:GridCheckBoxColumn DataField="Write" HeaderText="?????">

 

</telerik:GridCheckBoxColumn>

<telerik:GridCheckBoxColumn DataField="Modify" HeaderText="?????">

</telerik:GridCheckBoxColumn>

<telerik:GridCheckBoxColumn DataField="Read" HeaderText="??????">

</telerik:GridCheckBoxColumn>

<telerik:GridCheckBoxColumn DataField="Delete" HeaderText="???">

</telerik:GridCheckBoxColumn>--

 

 

%>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<HeaderStyle Font-Size="X-Small" />

 

 

 

<ItemStyle Font-Size="X-Small" />

 

 

 

<HeaderContextMenu EnableAutoScroll="True">

 

 

 

</HeaderContextMenu>

 

 

 

</telerik:RadGrid>

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr>

 

 

 

<td align="right" colspan="5">

 

<%

 

-- <asp:Button ID="btnUpdate" Text="??????" runat="server" CommandName="Update" onclick="btnUpdate_Click"

 

>

</asp:Button>

<asp:Button ID="btnInsert" Text="???" runat="server" CommandName="PerformInsert" onclick="btnInsert_Click"

></asp:Button>--

 

 

%>

 

<

 

 

asp:Button ID="Button1"

 

 

 

Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'

 

 

 

runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>

 

 

 

&nbsp;

 

<

 

 

asp:Button ID="btnCancel" Text="??????" runat="server" CausesValidation="False"

 

CommandName

 

 

="Cancel"></asp:Button>

 

 

 

</td>

 

 

 

</tr>

 

</

 

 

table>

 

 

hoda
Top achievements
Rank 1
 answered on 11 Jan 2011
2 answers
150 views
Hi all,

I have a RadGrid setup for in place editing.  On clicking a link on the page (but outside the grid) I want to programmatically add a row to the grid and insert some values into the controls.  So far I am able to put the grid into insert mode with the following code:

            rgrdTimesheet.MasterTableView.IsItemInserted = True
            rgrdTimesheet.Rebind()

How do I then get a reference to the insert row on the RadGrid?  And then get a reference to drop down lists within template columns on the RadGrid?

Thanks in advance.

Mike
Mike Sorel
Top achievements
Rank 1
 answered on 11 Jan 2011
3 answers
223 views
Hi,
    I am creating recurring appointment.I try to delete an appointment delete confirmation dialog popped up with two option
1.Delete this occurence
2.Delete series.

Now i want only to display (Delete series) option i am using following code,beacause of this delete Confirmation  dialog not shown.
function OnClientRecurrenceActionDialogShowing(sender, eventArgs)

    eventArgs.set_cancel(true);  
    eventArgs.set_editSeries(true);
}

Is there any way to show only one option i,e (Delete series) ? Can anyone Help ?


Thanks,
Ruchir
Ruchir
Top achievements
Rank 1
 answered on 11 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?