Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
55 views
I have a strange bug where if i click to open the window, it opens the modal and the parent window gets resized according to the width and height i had entered in the radwindowmanager controls.

If i remove these sizes then i don't get this bug. No problem in chrome etc just IE.

I am using the Twitter Bootstrap framework and it would seem the popup is triggering the responsive CSS which should only kick in on certain screen sizes.

If i remove this CSS then i don't have this bug but really i need this to be in place.  Has anyone ever encountered this before?

S
Marin Bratanov
Telerik team
 answered on 21 May 2013
1 answer
92 views
I am having issues with IE 10 and the RadMenu as menu items are not showing when you hover over them - well, they are but they seem to be hiding somewhere (you can see them slide out almost!). in IE9 and earlier including compat mode works just fine but not in IE10 or even IE10 compat mode.

any ideas how I can fix this? This is my code:

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

<div style="float: right;margin-left:89%; margin-top: 22px; position: absolute; z-index: 10001; color:White; font-family: Segoe UI, Arial, Sans-Serif; font-size:12px;font-weight:bold">

<asp:Literal runat="server" ID="litUserLoggedInDetails" />

</div><br />

<telerik:RadMenu runat="server" ID="RadMenuItems" Height="40px" Width="100%" ForeColor="White">

<DefaultGroupSettings OffsetY="-1" />

</telerik:RadMenu>




I am populating items from codebehind:

foreach (var parent in menuItemsResponse.Menus)
                    {
                        RadMenuItem parentMenuItem = new RadMenuItem(parent.MenuName, parent.PageURL);

                        this.RadMenuItems.Items.Add(parentMenuItem);
                    }

Boyan Dimitrov
Telerik team
 answered on 21 May 2013
4 answers
428 views
Hello,

I've looked throughout this forum, but I was not able to find the answer to my problem.

I am tasked to open the EditMode of a RadGrid in the codebehind for a webform to add a new item and this is what I use:

RadGrid1.MasterTableView.InsertItem();

The "EditMode" of the RadGrid is set to "PopUp", and the code above works just fine.  It opens the popup form if I were to put the code above in the click event of a button or Page_Load, for example.

My problem is that I have to send a value to an ASP text box in a databound template column within this popup "Edit" form from another page, but I'm unable to gain access to the template Item's text box on the popup edit form.

So, basically the steps would be like so:
1- the user clicks a link on a separate page, and either through session or querytring a value is sent to the page that contanins my RadGrid1.
2- the page containing the RadGrid1 opens, and the popup edit form is already open with the text of the querystring or session variable visible within the "AnnouncementsTextBox" textbox.

How do I go about populating the text box in the popup edit form?

Any help would be very much appreciated.

Here's the code for the template column:
<Columns>
     <telerik:GridTemplateColumn DataField="Announcements" UniqueName="AnnouncementsText">
          <EditItemTemplate>
              <asp:TextBox ID="AnnouncementsTextBox" runat="server" Text='<%# Bind("Announcements") %'></asp:TextBox>
          </EditItemTemplate>
          <ItemTemplate>
              <asp:Label ID="AnnouncementsLabel" runat="server" Text='<%# Eval("Announcements") %'></asp:Label>
          </ItemTemplate>
      </teleric:GridTemplateColumn>
</Columns>


Here's the code I've tried to use to set the value in the textbox:
foreach (GridDataItem item in RadGrid.Items)
{
   TextBox tb = (TextBox)item.FindControl("AnnouncementTextBox");
   tb.Text = "This is where the QueryString text would go.";
}
Princy
Top achievements
Rank 2
 answered on 21 May 2013
1 answer
83 views
Hi,
I am using rad scheduler to show the appointment and using web service for communication to the database.
I am using drop down in resource to show some data now what i want that when my first drop down will select my second drop down will populate data according to that.


thanks
Niharika
Plamen
Telerik team
 answered on 21 May 2013
1 answer
62 views

 

 

I have a combo box like this

<
telerik:RadComboBox ID="rcbAssets" runat="server" TabIndex="5" OnClientDropDownOpening="LoadAssets" OnItemsRequested="rcbAssets_ItemsRequested" OnClientDropDownClosed="showAssets"

 

 

 

AutoPostBack="false" Width="250px" >

 

 

 

<ItemTemplate>

 

 

 

<div>

 

 

 

<asp:CheckBox runat="server" ID="chk1" />

 

 

 

<asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">

 

<%

 

# Eval("AssetNumber")%>

 

 

 

</asp:Label>

 

 

 

</div>

 

 

 

</ItemTemplate>

 

 

 

</telerik:RadComboBox>

In code behind, I tried to check some check boxes and set the text of the radcombobox...

 

 

 

 

 

rcbSimilarParts.Text = "12354,12347";


This text is not displaying

Shinu
Top achievements
Rank 2
 answered on 21 May 2013
2 answers
170 views

I'm trying to filter two different (Data Picker's) that are in the same column at the grid. I try to reach a command with these two fields. The whole filtering process is going on in the code behind, and so far it is working for the other fields in the grid. But for one I'm getting a strange exception:

{"The argument types 'Edm.DateTime' and 'Edm.String' are incompatible for this operation. Near greater than or equals expression, line 6, column 15."}

In the DB the field is a datetime and it is a single column

My code :

                    <telerik:GridBoundColumn DataField="EntryDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}" FilterControlAltText="Filter EntryDate column"
                        HeaderText="Date" SortExpression="EntryDate" UniqueName="EntryDate" FilterControlWidth="50px">
                        <FilterTemplate>
                            From
                            <telerik:RadDatePicker ID="FromOrderDatePicker" runat="server" Width="100px" AutoPostBack="true"
                                OnSelectedDateChanged="FromOrderDatePicker_SelectedDateChanged" OnPreRender="FromOrderDatePicker_PreRender" />
                            to
                            <telerik:RadDatePicker ID="ToOrderDatePicker" runat="server" Width="100px" AutoPostBack="true"
                                OnSelectedDateChanged="ToOrderDatePicker_SelectedDateChanged" OnPreRender="ToOrderDatePicker_PreRender" />

                        </FilterTemplate>
                    </telerik:GridBoundColumn> 

Code behind:

     protected void FromOrderDatePicker_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
            {
                RadDatePicker picker = sender as RadDatePicker;
                ViewState["FromDatePicker"] = DateTimeToString(picker.SelectedDate.Value);

                ExpressionChanged();
            }
            protected void FromOrderDatePicker_PreRender(object sender, EventArgs e)
            {
                if (ViewState["FromDatePicker"] != null)
                {
                    RadDatePicker picker = sender as RadDatePicker;
                    picker.SelectedDate = StringToDateTime(ViewState["FromDatePicker"].ToString());
                }
            }


  private string DateTimeToString(DateTime dt)
    {
        return dt.Month + "/" + dt.Day + "/" + dt.Year;
    }
    private DateTime StringToDateTime(string s)
    {
        string[] dts = s.Split('/');
        DateTime dt = new DateTime(Int32.Parse(dts[2]), Int32.Parse(dts[0]), Int32.Parse(dts[1]));
        return dt;
    }

It would be just redundant to post the code (for the toDatePicker)

 private void ExpressionChanged()
    {
        //reset
        TimeReportGrid.MasterTableView.FilterExpression = null;
        TimeReportGrid.MasterTableView.Rebind();


        if (ViewState["FromDatePicker"] != null &&
            ViewState["ToDatePicker"] != null &&
            ViewState["FromDatePicker"].ToString() != "" &&
            ViewState["ToDatePicker"].ToString() != "")
        {
            TimeReportGrid.MasterTableView.FilterExpression += "(it.EntryDate >= '" + ViewState["FromDatePicker"].ToString() + "') AND (it.EntryDate <= '" + ViewState["ToDatePicker"].ToString() + "')";
        }

feel free to ask if there is any problem

Thanks for help and fast answer !

Nikola
Top achievements
Rank 2
 answered on 21 May 2013
1 answer
91 views
HI ,
i am working on Asp.Net Application. Can you please suggest how do we check user is currently logged in my site using Ajax .
regards,
Anandharaj
Anandharaj
Top achievements
Rank 1
 answered on 21 May 2013
4 answers
327 views
I have a situation where I have your RadContextMenu appearing when I right-click on any RadListBox item.  The problem is that the tooltip obscures (covers up) the Context Menu.

Might there be a way to adjust the position of either the tooltip or the Context Menu?  I assume this can be done with CSS code but I don't know the syntax/structure for either.

Any help would be much appreciated.

Thank you,

Robert W.
Robert
Top achievements
Rank 1
 answered on 21 May 2013
2 answers
123 views

Hi Sir/Madam
   I want to create ItemTemplate dynamically based on FromMonthDropDownList  and ToMonthDropDownList drop down.
  Column varies depends upon dates selected. I can not access the  FromMonthDropDownList.SelectedValue; in page_init.
  If i create the ItemTemplate elsewhere i can not export to Excel.
Is there any workaround to accomplish this task?



protected void Page_Init(object sender, EventArgs e)
    {
        
        string FromYearMonth = FromMonthDropDownList.SelectedValue;
        string ToYearMonth = ToMonthDropDownList.SelectedValue;

        rgPartSalesByVendor.MasterTableView.Columns.Clear();
        GridBoundColumn boundColumnVendor = new GridBoundColumn();
        boundColumnVendor.DataField = "Vendor";
        boundColumnVendor.UniqueName = "Vendor";
        boundColumnVendor.HeaderText = "Vendor";
        rgPartSalesByVendor.MasterTableView.Columns.Add(boundColumnVendor);

        //Bind sales By vendor Grid
        SqlDataSource1.SelectParameters["StartMonth"].DefaultValue = FromYearMonth.Substring(4, 2);
        SqlDataSource1.SelectParameters["StartYear"].DefaultValue = FromYearMonth.Substring(0, 4); //ddlStartYear.SelectedValue;
        SqlDataSource1.SelectParameters["EndMonth"].DefaultValue = ToYearMonth.Substring(4, 2); // ddlEndMonth.SelectedValue;
        SqlDataSource1.SelectParameters["EndYear"].DefaultValue = ToYearMonth.Substring(0, 4);  //ddlEndYear.SelectedValue;
        rgPartSalesByVendor.DataSource = SqlDataSource1;
        DataTable dt = null;
        DataView dv = null;
        dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

        for (int idx = rgPartSalesByVendor.MasterTableView.Columns.Count - 1; idx > 0; idx--)
        {
            rgPartSalesByVendor.MasterTableView.Columns.RemoveAt(idx);
        }
        if (dv != null)
        {
            dt = dv.ToTable();
            CreateTemplateColumn(dt);
        }

}

 private void CreateTemplateColumn(DataTable dt)
    {
        foreach (DataColumn dc in dt.Columns)
        {
            if (dc.ColumnName == "Vendor" || dc.ColumnName == "vendorID")
                continue;
            if (dc.ColumnName != "Vendor" && dc.ColumnName != "VendorID")
            {
                string ColName = dc.ColumnName;
                string[] DPMNameAndID = ColName.Split(';');
                string DPMName = DPMNameAndID[0];
                string DMPId = DPMNameAndID[1];
                GridTemplateColumn templateColumn = new GridTemplateColumn();
                templateColumn.ItemTemplate = new MyTemplate(ColName, FromMonthDropDownList.SelectedValue, ToMonthDropDownList.SelectedValue);
                templateColumn.SortExpression = ColName;
                templateColumn.HeaderText = DPMName;
                templateColumn.HeaderStyle.Font.Bold = true;
                templateColumn.FooterStyle.Font.Bold = true;
                templateColumn.FooterAggregateFormatString = "{0:F2}";
                templateColumn.DataField = ColName;
                templateColumn.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum;
                this.rgPartSalesByVendor.MasterTableView.Columns.Add(templateColumn);
            }
        }
    }


    private void CreateTemplateColumn(DataTable dt)
    {
        foreach (DataColumn dc in dt.Columns)
        {
            if (dc.ColumnName == "Vendor" || dc.ColumnName == "vendorID")
                continue;
            if (dc.ColumnName != "Vendor" && dc.ColumnName != "VendorID")
            {
                string ColName = dc.ColumnName;
                string[] DPMNameAndID = ColName.Split(';');
                string DPMName = DPMNameAndID[0];
                string DMPId = DPMNameAndID[1];
                GridTemplateColumn templateColumn = new GridTemplateColumn();
                templateColumn.ItemTemplate = new MyTemplate(ColName, FromMonthDropDownList.SelectedValue, ToMonthDropDownList.SelectedValue);
                templateColumn.SortExpression = ColName;
                templateColumn.HeaderText = DPMName;
                templateColumn.HeaderStyle.Font.Bold = true;
                templateColumn.FooterStyle.Font.Bold = true;
                templateColumn.FooterAggregateFormatString = "{0:F2}";
                templateColumn.DataField = ColName;
                templateColumn.Aggregate = Telerik.Web.UI.GridAggregateFunction.Sum;
                this.rgPartSalesByVendor.MasterTableView.Columns.Add(templateColumn);
            }
        }
    }

    private class MyTemplate : ITemplate
    {
   
        protected HyperLink SealeByVendorTrans;
       
        private string colname;
        private string _fromDate;
        private string _toDate;
        public MyTemplate(string cName,string fromDate,string toDate)
        {
            colname = cName;
            _fromDate = fromDate;
            _toDate = toDate;
        }
        public void InstantiateIn(System.Web.UI.Control container)
        {
            SealeByVendorTrans = new HyperLink();
            SealeByVendorTrans.ID = colname;
            SealeByVendorTrans.DataBinding += new EventHandler(SealeByVendorTrans_DataBinding);
            container.Controls.Add(SealeByVendorTrans);
        }
        void SealeByVendorTrans_DataBinding(object sender, EventArgs e)
        {
            HyperLink link = (HyperLink)sender;
            GridDataItem container = (GridDataItem)link.NamingContainer;
            link.Text = ((DataRowView)container.DataItem)[colname].ToString();
            link.NavigateUrl = "HinoPartsDashBoardTransactions.aspx?TransType=V&type=Vendor&SalesType=T&from=" + _fromDate + "&to=" + _toDate+"&VendorID="+((DataRowView)container.DataItem)["VendorID"].ToString();
        }
    }
    #endregion
Balkar
Top achievements
Rank 1
 answered on 20 May 2013
1 answer
271 views
Hi,
I noticed that one of my dropdownlists always posts back instead of doing an asynchronous refresh of the updatepanel.When I remove ClientIDMode="Static", everything works fine.

Thanks

Madani
Danail Vasilev
Telerik team
 answered on 20 May 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?