Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
209 views
Hi 

I'm using .net 2.0 and vb.net , web forms

On my master page there is a radmenu. This menu has 4 buttons that if you hover over any of them then , then a drop down will appear. and each drop down has 1 to 5 buttons.  example below

......home...... menu1........menu 2.......menu3.....menu4
                      a                 t                  s             v
                      b                                    w                    
                      c                                    q
                      d
                      e


my question is:

from the code behind on my .aspx page, how do I disable "menu1" and all its buttons.

I still want to see it  but just it must not link.

right now I have this   


Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

Me.FindControl("Mymenu").Visible = True

          'how do I disable "menu1" and all its buttons.

        Dim m As Telerik.Web.UI.RadMenu = CType(MyBase.Master.FindControl("Mymenu"), Telerik.Web.UI.RadMenu)

        m.item find("menu1").Disable()


    End Sub
End Class




Code
Top achievements
Rank 1
 answered on 08 Aug 2013
1 answer
121 views
Hi

How to set the radwindow behavior to close from javascript?

Thanks
Saravanan
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2013
1 answer
486 views
Trying to Copy Paste date format(01/01/2013) is accepting in numeric text box. after moving out of that control it is displaying (01012013). But when i moving out of the control, i need to display a warning message, please enter valid numeric values instead of removing special character.
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2013
1 answer
142 views
Hi

Is there any event available for radwindow that will fire on maximizing the radwindow?

Thanks for replying
Ivy
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2013
1 answer
2.9K+ views
How to catch client event of  filter add expression button and apply button?

Hello i using list box when i press add expression button or  apply button i going  add specifics class to my items but it seems like i add class and only then it build list again i need to run my function after the event of button add  expression  or apply  button is finished, sow how can i do this?
Angel Petrov
Telerik team
 answered on 08 Aug 2013
7 answers
519 views
Hi there,
            $find("RadAjaxManager1") returns null particularly when call from modal pop up button click. but while call from page controls events it works. Thanks in advance
Vincy
Top achievements
Rank 1
 answered on 08 Aug 2013
12 answers
1.1K+ views
We like the Metro theme but would like to make a SMALL change. When the button is clicked we would like it's background color to change to #F6781F (orange) from the standard metro blue color. How can we do this???

Thank you so much!
darren
Top achievements
Rank 1
 answered on 08 Aug 2013
1 answer
159 views

Hi,

My requirement is to disable the menu items in the RadFilter. Let me explain it, I have a RadFilter linked dynamically to a RadGrid. On load  he RadFilter opens with a predefined expression. Now i need to change the Data Field and filter function drop down boxes such that , only the first value is set and user will not be allowed to access the drop down box.

I have attached the screenshot, in that i need to set the value as TASK and CONTAINS then the drop down should be diabled
Antonio Stoilkov
Telerik team
 answered on 08 Aug 2013
2 answers
130 views
Hello,

I want to raise an ajaxRequest from a Masterpage to a RadAjaxPanel within a RadWindow.
Is this possible? - My resulting object is always null...

My clientside code within RadWindowManager OnWindowBeforeClose Event:

function OnWindowBeforeClose(sender, args) {
    
   var oOpener = sender.get_openerElementID(); // OpenerElementID is the Ajaxable Object (RadAjaxPanel in this case)
   if (oOpener != null) {
 
          var oMan = GetRadWindowManager();
          var oActive = oMan.getActiveWindow();
          if (oActive != null) {
                var content = oActive.get_contentFrame().contentWindow;
 
                           // how can i find the object here?
                           var oAjaxable = content.get$(oOpener); // results = null
                           var oAjaxable = $telerik.$(oOpener); // results = null
 
                           if (oAjaxable.ajaxRequest != null) {
                                oAjaxable.ajaxRequest("beforeclose::" + args.get_argument());
                                return;
                            }
 
          }
 
   }
 
}


Thanks

Stefan
TIMEOS GmbH und Co KG
Top achievements
Rank 1
 answered on 08 Aug 2013
4 answers
106 views
I have a RadGrid (Q3 2010).

I want to dynamic create GridView Column and Row, so I create A template like that :

<telerik:RadGrid ID="rgView" runat="server" AutoGenerateColumns="False" GridLines="None"
    OnItemDataBound="rgView_ItemDataBound">
    <MasterTableView>
        <Columns>
            <telerik:GridTemplateColumn>
                <HeaderTemplate><br>
                    <asp:Table ID="tblHeaderItem" runat="server">
                    </asp:Table>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Table ID="tblItem" runat="server">
                    </asp:Table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


It mean , I have a template Control and Header Template of it is Table Control. And Item Template of it also is table.
I create Session Variable .

public DataView dv
    {
        get { return Session["AllControl_Academic_BookActivity_View_View_dv"]==null?null:(DataView)(Session["AllControl_Academic_BookActivity_View_View_dv"]); }
        set { Session["AllControl_Academic_BookActivity_View_View_dv"] = value; }
    }


Okie , In PageLoad Event I bind data for grid.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindTimeTable();
        }
    }
private void BindTimeTable()
    {
        dv = new DataView(learningActivityModal.GetInformationAboutBooking((DateTime)this.rdpBookingDate.SelectedDate,   SimpleWebSessionManagement.CurrentBranches, SimpleWebSessionManagement.CurrentTrainningProgram));//It just binddata
        DataTable workTable = new DataTable();
        workTable.Columns.Add("RoomName", typeof(String));
        DataRow row = workTable.NewRow();
        row[0] = "";
        workTable.Rows.Add(row);
        this.rgView.DataSource = workTable;
        this.rgView.DataBind();
    }


In RadGrid DataItem Bound event, I create dynamic data and add each cell of table ( Is Template of control). If room is used , CheckBox and Lable of status ' room is bound, else the Empty Lable is bound.(Don't care about the content of code, I just demo)

protected void rgView_ItemDataBound(object sender, GridItemEventArgs e)
    {  
        if (e.Item.ItemType == GridItemType.Header)
        {
            Table tblHeader = e.Item.FindControl("tblHeaderItem") as Table;
            tblHeader.Width = new Unit("100%");
            TableRow tblRow = new TableRow();
            tblRow.Width = new Unit("100%");
            TableCell tblCell = new TableCell();
 
            tblCell.HorizontalAlign = HorizontalAlign.Left;
            tblCell.Width = new Unit("10%");
            Label lblHeader = new Label();
            lblHeader.Text = "";
            tblCell.Controls.Add(lblHeader);
            tblRow.Cells.Add(tblCell);
 
            for (int i = 0; i < dtProgramSlot.Rows.Count; i++)
            {
                tblCell = new TableCell();
                tblCell.HorizontalAlign = HorizontalAlign.Left;
                lblHeader = new Label();
                lblHeader.Text = dtProgramSlot.Rows[i]["SlotName"].ToString() + "<br/> (" + dtProgramSlot.Rows[i]["StartTime"].ToString() + " - " +
                                                                                  dtProgramSlot.Rows[i]["EndTime"].ToString() + ")";
                tblCell.Controls.Add(lblHeader);
                tblRow.Cells.Add(tblCell);
            }
 
            tblHeader.Rows.Add(tblRow);
        }
 
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            Table tblItem = e.Item.FindControl("tblItem") as Table;
            tblItem.Width = new Unit("100%");
            TableRow tblRow;
            TableCell tblCell;
 
            int scale = (int)(90 / dtProgramSlot.Rows.Count);
 
            for (int i = 0; i < dtRoom.Rows.Count; i++)
            {
                //Add Rooms
                tblRow = new TableRow();
                tblRow.Width = new Unit("100%");
                tblCell = new TableCell();
                tblCell.BorderWidth = 1;
                tblCell.HorizontalAlign = HorizontalAlign.Left;
                tblCell.Width = new Unit("10%");
                Label lblHeader = new Label();
                lblHeader.Text = dtRoom.Rows[i]["RoomName"].ToString();
                tblCell.Controls.Add(lblHeader);
                tblRow.Cells.Add(tblCell);
                 
 
                //Add Infor              
                for (int j = 0; j < dtProgramSlot.Rows.Count; j++)
                {
                    dv.RowFilter = "RoomName = '" + dtRoom.Rows[i]["RoomName"].ToString() + "' and SlotsId =" + dtProgramSlot.Rows[j]["SlotsId"].ToString();
                    tblCell = new TableCell();
                    tblCell.Width = new Unit(scale.ToString()+"%");
                    tblCell.HorizontalAlign = HorizontalAlign.Left;
                     
                    if (dv.Count > 0)
                    {
                        DataTable dtInfor = dv.ToTable(true);
                        string strInfor, strGroups = "";
                        strInfor = dtInfor.Rows[0]["CourseName"].ToString() + "<br/>" + dtInfor.Rows[0]["UserName"].ToString() + "<br/>";
                        for (int k = 0; k < dtInfor.Rows.Count; k++)
                        {
                            strGroups += dtInfor.Rows[k]["GroupName"].ToString() + "<br/>,";
                        }
 
                        strGroups = strGroups.Substring(0, strGroups.Length - 1);
                        strInfor += strGroups;
 
                        RoomSlot rs = new RoomSlot();
                        CheckBox chkSelected = new CheckBox();
                        chkSelected.ID = "chkSelected" + Index.ToString();
                        rs.Index = Index;
                        rs.RoomId = i;
                        rs.SlotId = j;
                        rs.TermId = StringUtil.IsNullOrEmpty(dtInfor.Rows[0]["TermId"]) ? -1 : int.Parse(dtInfor.Rows[0]["TermId"].ToString());
                        rs.CourseId = Int32.Parse(dtInfor.Rows[0]["CourseId"].ToString());
                        this.lstRoomSlot.Add(rs);
                        Index++;
                        tblCell.Controls.Add(chkSelected);
                        Label lb = new Label();
                        lb.BorderStyle = BorderStyle.None;
                        lb.Text = strInfor;
                        //lb.Attributes["style"] += "cursor:pointer;cursor:hand;";
                        string msg = "";
                        msg += "brandid=" + SimpleWebSessionManagement.CurrentBranches + "&";
                        msg += "programid=" + SimpleWebSessionManagement.CurrentTrainningProgram + "&";
                        msg += "termid=" + dtInfor.Rows[0]["TermId"].ToString() + "&";
                        msg += "courseid=" + dtInfor.Rows[0]["CourseId"].ToString() + "&";
                        msg += "areaid=" + this.AreaId + "&";
                        msg += "bookdate=" + rdpBookingDate.SelectedDate.Value.ToShortDateString() + "&";
                        msg += "slotid=" + dtProgramSlot.Rows[j]["SlotsId"].ToString() + "&";
                        msg += "roomid=" + dtRoom.Rows[i]["id"].ToString() + "&";
                        msg += "lecturer=" + dtInfor.Rows[0]["UserName"].ToString() + "&";
                        msg += "courseslot=" + dtInfor.Rows[0]["Course_Slot"].ToString() + "&";
                        msg += "groups=" + strGroups;
                         
                        lb.BackColor = Color.Transparent;
                        lb.ForeColor = Color.Red;
                        tblCell.Controls.Add(lb);
 
                        rs.Update = "";
                        rs.Update += "brandid=" + SimpleWebSessionManagement.CurrentBranches + "&";
                        rs.Update += "programid=" + SimpleWebSessionManagement.CurrentTrainningProgram + "&";
                        rs.Update += "termid=" + dtInfor.Rows[0]["TermId"].ToString() + "&";
                        rs.Update += "courseid=" + dtInfor.Rows[0]["CourseId"].ToString() + "&";
                        rs.Update += "areaid=" + this.AreaId + "&";
                        rs.Update += "bookdate=" + rdpBookingDate.SelectedDate.Value.ToShortDateString() + "&";
                        rs.Update += "slotid=" + dtProgramSlot.Rows[j]["SlotsId"].ToString() + "&";
                        rs.Update += "roomid=" + dtRoom.Rows[i]["id"].ToString() + "&";
                        rs.Update += "lecturer=" + dtInfor.Rows[0]["UserName"].ToString() + "&";
                        rs.Update += "groups=" + strGroups;
 
                        this.lstRoomSlot.Add(rs);
                    }
                    else
                    {
                        Label lb = new Label();
                        lb.ForeColor = Color.Green;
                        lb.Text = "Đang trống";
                        tblCell.Controls.Add(lb);
                    }
 
                    tblRow.Cells.Add(tblCell);
                }
 
                tblItem.Rows.Add(tblRow);
            }
        }
    }


I have a RadDatePicker to choose day which find Date from RadDatePicker and fill Data in the form.

<telerik:RadDatePicker ID="rdpBookingDate" runat="server" AutoPostBack="True" OnSelectedDateChanged="rdpBookingDate_SelectedDateChanged">
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                </Calendar>
                <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" AutoPostBack="True">
                </DateInput>
                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
            </telerik:RadDatePicker>
 
protected void rdpBookingDate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
    {
        BindTimeLIne();
    }


I have a button, when you click it, all checked CheckBox control in Item Template will select. After that , control will delete in database (like that)

public void BtnDelete_Method(object sender,EventArgs e)
    {
        lbMessage.Text = string.Empty;
 
        GridDataItem item = rgView.Items[0];
        for (int i = 0; i < Index; i++)
        {
            CheckBox chk = item.FindControl("chkSelected" + i.ToString()) as CheckBox;
            if (chk != null & chk.Checked)
            {
                string msg = learningActivityModal.DelelteObjectData((DateTime)rdpBookingDate.SelectedDate, ReturnValueWithoutException.ReturnInt(dtRoom.Rows[rs.RoomId]["id"]), ReturnValueWithoutException.ReturnInt(dtProgramSlot.Rows[rs.SlotId]["SlotsId"]));
 
                        if (msg == FixedVariable.DoneOutPutFromDatabaseAsString)
                            lbMessage.Text += "Delete  " + dtRoom.Rows[rs.RoomId]["RoomName"].ToString()+" "+dtProgramSlot.Rows[rs.RoomId]["SlotName"].ToString()+"<br/>";
                        else
                            lbMessage.Text += msg+"<br/>";
            }
        }
 
        BindTimeTable();
    }


Every thing is okie , if you don't select day from RadDatePicker.
But If you selecte date from RadDatePicker, control will rebind TimeTable.And when you click to button, every check-box status is unchecked.

I spend a lot of time in the internet, but I can't find reason.

Please help me. My project is very urgent. This control must be release in the next week.

Tell me why and how to fix it,please .
 
Tung
Top achievements
Rank 1
 answered on 08 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?