Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi,
I have watched a lot of question regarding my question on Telerik forum, but it wasn't clear for me .
I have implemented filtering and sorting in Radgrid and works perfect.
Now the question  is , Is there a way to get that filtered dataset of the RadGrid?

for eg: 
Starting Datasource : {1,2,3,4,5,6.. 100}

Filtering Contain "0"
Filtered Datasource:{10,20,30,40,50,60,70,80.90,100}   

There reason I need this is because I have to bind the Filtered DataSource to a radComboBox..
I didn't see any thing in RadGrid that give me this result?

thanks,
DIP
Yavor
Telerik team
 answered on 30 Jul 2009
1 answer
225 views
Hi -

I am loading the editor content from an HTML file with the following code:

Private Sub LoadEditor(ByVal File As String)

 

 

Dim sr As System.IO.StreamReader

 

 

Dim fi As New System.IO.FileInfo(File)

 

 

Dim strContents As String = ""

 

 

If System.IO.File.Exists(File) Then

 

sr = System.IO.File.OpenText(File)

strContents += sr.ReadToEnd()

Editor.Content = strContents

sr.Close()

 

Else

 

 

End If

 

 

End Sub



I seem to get a few errors that I can't figure out:

1. In the HTML there is a link with a query string. e.g. 
<A href="http://www.abc.com/Default.aspx?id=118&cost=WR1841" target=_blank>
The Editor converts it to:
<A href="http://www.abc.com/Default.aspx?id=118&amp;cost=WR1841" target=_blank>

2. There are special characters like Â®
The editor just displays a ï¿½

Any help will be appreciated


 



 

 

Rumen
Telerik team
 answered on 30 Jul 2009
3 answers
204 views
Hi,
I have a grid on my web design and set the grid's DataSource during NeedDataSource event by using following syntax:

RadGrid1.MasterTableView.DataSource = myDataSet.Tables(

"a").DefaultView

 


I tried to hide the column after the grid's DataSource is set but having code break by using following syntax:

RadGrid1.Columns(0).Visible =

False

 


After that, I tried to debug it during runtime and found out that the grid having no column even though i have set its DataSource.

Anyway to solve this out?

Thanks in advance and apprciate for the answer.

Regards,
Lim

Lim
Top achievements
Rank 1
 answered on 30 Jul 2009
1 answer
248 views
I have a project that I am in the process of replacing the drop down lists with comboboxes.

In this scenario, the drop down list will show / hide a panel (using an ajax CollapsiblePanelExtender) when a certain value is selected. This is working well (before the replacement of the ddl with the combo box).

I have added and databound the combobox, which shows the required data values.

However, when I attempt to find the combobox, the combobox is not found. The combobox is inside the insert item template of the form view and I am using master / child pages.

Here is my server side code:

 

protected void FormViewSkillDetails_DataBound(object sender, EventArgs e)

 {
    

if (FormViewSkillDetails.CurrentMode == FormViewMode.Insert)
    {
        FormViewSkillDetails.Focus();
//place the cursor on the 1st available field of the form view.
        
        
//DropDownList ddl = (DropDownList)FormViewSkillDetails.FindControl("DropDownListSkillTypeInsertDisplay"); 
        
RadComboBox ddl = (RadComboBox)FormViewSkillDetails.FindControl("RadComboBoxSkillTypeInsertDisplay");
        
Panel p = (Panel)FormViewSkillDetails.FindControl("PanelSkillOwnHeadingInsertItem");
        
RequiredFieldValidator rfv = (RequiredFieldValidator)FormViewSkillDetails.FindControl("RequiredFieldValidatorClientSideSkillOwnHeadingInsert");
        
CustomValidator cvss = (CustomValidator)FormViewSkillDetails.FindControl("CustomValidatorServerSideSkillOwnHeadingInsertItemBlank");
        ddl.Attributes.Add(
"onchange", "JavaScript:selectInputInsertChange('" + ddl.ClientID + "', '" + p.ClientID + "', '" + rfv.ClientID + "', '" + cvss.ClientID + "');");
    }
}

Any suggestions?

 

 

 

 

 

Shinu
Top achievements
Rank 2
 answered on 30 Jul 2009
1 answer
248 views
Hi,
I have a radGrid, 
in RadGrid1_ItemDataBound, i am attaching clientside event  
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem && e.Item.IsInEditMode)
{
GridDataItem item = (GridDataItem)e.Item;
TextBox textBox = item["CompanyName"].Controls[0] as TextBox;    // Get the textbox for column CompanyName      
textBox.Attributes.Add("onFocusout", "OnRadGridCellFocusOut("+ parameters +")");
}

This client event makes an AjaxRequest when the column loose focues

function OnRadGridCellFocusOut(RowIndex, ColumnIndex)
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(RowIndex + ":" + ColumnIndex);
}

In AjaxRequest Handler
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
//do some processing to update the next column
}

after the processing, i want to update the value of next column.

for example
if Col1 is updated to IBM i will make Col2 as 'Partener'.

i was thinking if AjaxRequest can return a value to clientside caller, i could update it from there.

What is the best way to do it?

thanks
virendra


Princy
Top achievements
Rank 2
 answered on 30 Jul 2009
1 answer
115 views
Hi,
We are using clientside databinding to populate our grids. To avoid "flickering" on load, the grid is bound to an empty datatable on serverside page load. However; when the grid gets databound&repainted on clientside, the rows don't get edit&delete buttons. There is just an empty whitespace where the buttons should be.
Nikolay Rusev
Telerik team
 answered on 30 Jul 2009
6 answers
226 views
Hi,

I'm implementing my own custom RadTreeNode via inheritance. It looks something like this

public class TaggedTreeNode : RadTreeNode
{
    
    public string[] Tags
    {
        get { return (string[])ViewState["tags"] ?? new string[] { }; }
        set { ViewState["tags"] = value; }
    }

}

While I can still utilize this new property on a server side during the rendering, when I place control inside RadAjaxPanel the first ajax postback empties the contents of the property. The thing is that nodes are expanded normally via OnNodeExpand, but when some other control on the RadAjaxPanel fires a postback the information from this property is lost.

How can I create a custom property which will be persistent? It seems that no other property but described in RadTreeNode can be persisted at all during ajax postbacks.



Thank you,
Mark
Mark Kingsley
Top achievements
Rank 1
 answered on 30 Jul 2009
1 answer
105 views
I get a JS error (this._resizeType is null) on attempt to drag the RadWindow, when following conditions are met:
1. It's the Firefox browser (3.0 on my machine)
2. There is a Microsoft map script on the page

The error is somewhere in getCurrentStyle(_a0,"cursor"); call, more specifically - _2a=_27.currentStyle[_28].
I've attached the very simple example to illustrate the problem.

Would you come up with some sort of workaround?
Thanks!!!

<%@ Page Language="C#" AutoEventWireup="true" %> 
 
<%@ Import Namespace="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
  <script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script> 
</head> 
<body> 
  <form id="form1" runat="server"> 
  <telerik:RadScriptManager ID="ScriptManager" runat="server" EnablePageMethods="true" 
    LoadScriptsBeforeUI="false" ScriptMode="Release" EnableHandlerDetection="false" 
    OutputCompression="Disabled" EnableScriptCombine="true"> 
  </telerik:RadScriptManager> 
  <telerik:RadWindowManager ID="WindowManager" runat="server" Skin="Black"> 
    <Windows> 
      <telerik:RadWindow ID="FW" runat="server" Top="100px" Left="600px" Title="Test window" 
        Width="256px" Height="720px" Visible="true" NavigateUrl="http://www.google.com/" 
        VisibleOnPageLoad="true"> 
      </telerik:RadWindow> 
    </Windows> 
  </telerik:RadWindowManager> 
  </form> 
</body> 
</html> 

Georgi Tunev
Telerik team
 answered on 30 Jul 2009
1 answer
65 views

http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radeditor-cssfiles.html
"Gets or sets the list of external CSS files that should be made available in the editor's content area."




The description is wrong since the CssFiles property is readonly.

Lini
Telerik team
 answered on 30 Jul 2009
1 answer
176 views
Hi,

I have a radgrid to which I am trying to create custom filter by using http://www.telerik.com/help/aspnet-ajax/grdcustomfilteroptionswithhandling.html article. I am not able to see onClick event on GridFilterMenu class. When I add onItemClick event, I am getting the following error;

System.ArgumentException: Requested value 'null' was not found.

code:

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

                <asp:ScriptManager ID="scrp" runat="server"></asp:ScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
        <img id="imgid" src="images/loading.gif" alt="Loading" />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        <AjaxSettings>
           
             <telerik:AjaxSetting AjaxControlID="radioYes">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
              <telerik:AjaxSetting AjaxControlID="radioNo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
          
               
    
            <telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="true" AllowPaging="true"
                 PageSize="5" EnableAjaxSkinRendering="true" AllowFilteringByColumn="true"
                Skin="Office2007">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
            </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


Default.aspx.cs

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadRadGrid();
        }

    }

    protected void Page_Init(object sender, EventArgs e)
    {
        AddCustomGridFilters();
    }

    public void AddCustomGridFilters()
    {
        radGrid.FilterMenu.Items.Clear();
        RadMenuItem[] radMenuItems = new RadMenuItem[7];
        for (int index = 0; index < radMenuItems.Length; index++)
        {
            radMenuItems[index] = new RadMenuItem();
            radGrid.FilterMenu.Items.Add(radMenuItems[index]);
        }
        radMenuItems[0].Text = Constants.EqualTo;
        radMenuItems[1].Text = Constants.StartsWith;
        radMenuItems[2].Text = Constants.EndsWith;
        radMenuItems[3].Text = Constants.LessThan;
        radMenuItems[4].Text = Constants.GreaterThan;
        radMenuItems[5].Text = Constants.Contains;
        radMenuItems[6].Text = Constants.NoFilter;

        (radGrid.FilterMenu as GridFilterMenu).ItemClick += new RadMenuEventHandler(_Default_ItemClick);

    }

    void _Default_ItemClick(object sender, RadMenuEventArgs e)
    {
        //Do something.
    }

   

    private void LoadRadGrid()
    {
        

        this.radGrid.DataSource = GetDataTable();
        this.radGrid.DataBind();
    }

    private DataTable GetDataTable()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("ID"));
        dt.Columns.Add(new DataColumn("Name"));
        dt.Columns.Add(new DataColumn("Marks"));

        DataRow dr = dt.NewRow();
        dr["ID"] = 1;
        dr["Name"] = "Mahesh";
        dr["Marks"] = 100;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 2;
        dr["Name"] = "Rajesh";
        dr["Marks"] = 55;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 3;
        dr["Name"] = "Kishore";
        dr["Marks"] = 89;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 4;
        dr["Name"] = "Sasi";
        dr["Marks"] = 44;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 5;
        dr["Name"] = "Kamesh";
        dr["Marks"] = 78;
        dt.Rows.Add(dr);

        return dt;
    }

    //This class contains all the constants
    public class Constants
    {
        public const string CrtSegment = "crt";
        public const string FleetSegment = "fleet";

        // Numeric And String Constants
        public const string EqualTo = "EqualTo";
        public const string NotEqualTo = "NotEqualTo";
        public const string GreaterThan = "More than";
        public const string LessThan = "Less than";
        public const string GreaterThanOrEqualTo = "GreaterThanOrEqualTo";
        public const string LessThanOrEqualTo = "LessThanOrEqualTo";
        public const string Between = "Between";
        public const string NotBetween = "NotBetween";
        public const string ISNull = "IsNull";
        public const string ISNotNull = "NotIsNull";
        public const string NoFilter = "No filter";

        // String Constants
        public const string Contains = "Contains...";
        public const string DoesNotContain = "DoesNotContain";
        public const string StartsWith = "Starts with...";
        public const string EndsWith = "Ends with...";
        public const string IsEmpty = "IsEmpty";
        public const string IsNotEmpty = "IsNotEmpty";

        //RadContextMenu Constants
        public const string ShowColumn = "Show column";
        public const string HideColumn = "Hide column";
        public const string RestoreAll = "Restore All";

    }

}


Thanks,
Mahesh











Yavor
Telerik team
 answered on 30 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?