Telerik Forums
UI for ASP.NET AJAX Forum
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
493 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
141 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
125 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
98 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
1 answer
73 views
Hi
I have an ASP.Net application with two RadGrids. The first grid contains the master table, and the second grid contains the details table. I need to insert new records in the second grid (details), but how can I set the foreign key to the record to be insert? And I need to complete some values in the record that doesn´t appear as a column in the grid, how can I do that? Can you help me?

Thanks in advanced...
Sami
Princy
Top achievements
Rank 2
 answered on 08 Aug 2013
2 answers
212 views
I have two pages named WorkingExpand.aspx and NotWorkingExpand.aspx. Both pages have this declaration:

            <telerik:RadGrid ID="rgRequirements" runat="server" Width="100px" CellSpacing="0" GridLines="None" EnableEmbeddedSkins="True" Skin="Black" >
                <MasterTableView AutoGenerateColumns="False">
                    <NoRecordsTemplate>
                        <asp:Label ID="nocourses" runat="server" Font-Size="16px" Text="No courses are currently selected for this organization."></asp:Label>
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" >
<!-- Some Column Definition -->
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

For WorkingExpand.aspx codebehind, I have this declaration on the Load method:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
        ' Some code omitted.
        fill_requirements()
    end if           
End Sub
 
Sub fill_requirements()
    Dim dt As DataTable = New DataTable
    dt = ThisMethodReallyReturnsData()
        Me.rgRequirements.DataSource = dt
 
    'Grouping declared here
    Me.rgRequirements.GroupingEnabled = True
    Dim groupExpression As GridGroupByExpression = GridGroupByExpression.Parse("Module Group By Module")
    Me.rgRequirements.MasterTableView.GroupByExpressions.Add(groupExpression)
    Me.rgRequirements.DataBind()
     
End Sub

So notice that the binding to the grid was called on the page load method. There was no need to use advanced databinding to make the expand/collapse work. It just works. 

However for the NotWorkingExpand.aspx code behind, here is how the data is bind:

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'No related code
   End Sub
 
   Protected Sub rgRequirements_NeedDataSource(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
       LoadGrid()
   End Sub
 
   Protected Sub LoadGrid()
       ' dtRequirements is a global variable
       dtRequirements = MethodThatHasDataAsWell()
       Me.rgRequirements.DataSource = dtRequirements
 
       Me.rgRequirements.GroupingEnabled = True
       Dim groupExpression As GridGroupByExpression = GridGroupByExpression.Parse("Module Group By Module")
       Me.rgRequirements.MasterTableView.GroupByExpressions.Add(groupExpression)
   End Sub

When the collapse/expand button is selected, it throws an error


Unhandled exception at line 6, column 74203 in http://localhost:30710/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentContent_rsmTrainingRequirements_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2013.2.611.40,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:8a277cf4-155d-4ba9-b3c0-d6f62646e5f2:16e4e7cd:ed16cbdc:f7645509:58366029
 
0x800a138f - Microsoft JScript runtime error: 'undefined' is null or not an object

Any help?
Patrick
Top achievements
Rank 1
 answered on 08 Aug 2013
10 answers
175 views
Hi,

In IE10 if you clear date from RadDatePicker where RadDatePicker's min date is set and click somewhere else it is giving following error.

Unhandled exception at line 151, column 1 in http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Calendar/RadDatePicker.js

0x800a138f - JavaScript runtime error: Unable to get property 'toString' of undefined or null reference ..

in RadDatePicker.js file. How to solve this?


Best Regards,
Damodar
Damodar
Top achievements
Rank 1
 answered on 08 Aug 2013
2 answers
50 views
Using the sample here http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/draganddropnodes/defaultcs.aspx I am able to produce the drag and drop feature perfectly. However when I place that same RadTreeView inside of a multipage, the radtreeview becomes disabled and then I am unable to do anything with this. The placement of the code is the only thing that changes.

I'm hoping someone has seen this before. My assumption is there is something with the RadPageView that causes the javascript not to find the RadTree. Anybody experiences this before?

var gridId = "<%= My_RadTreeView.ClientID %>";

my guess is the gridId can no longer be found? Any help is welcomed!

I have verified that all the code is placed inside of a RadScriptBlock so if anybody has the answer i'm open!

Joshua
Top achievements
Rank 1
 answered on 07 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?