Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
66 views
Hi,
I have problem here. I was trying to fill the tree structure with the DataTable contents. The data i'm going to fill the tree view is a collection of special characters.
As you can see below the node.text which is a RadTreeNode has the value "\WW\<a"



But when it is displayed on the screen it comes as
This looks like when biinding the "<a" is getting truncated.

Is there any way around it???

Plz help me with this as I'm stuck with this
regards
Swa
Plamen
Telerik team
 answered on 12 Aug 2011
3 answers
184 views
Hi,

I have radbutton and icon , like this:

<telerik:RadButton ID="myRadButton" runat="server" Text="" 
        CssClass="RadBtn" onclick="some_function">
         <Icon SecondaryIconCssClass="rbAdd" SecondaryIconRight="4" SecondaryIconTop="4"/>
</telerik:RadButton>

when I click on my radbutton "some_function" is fire, but when I click on the icon which is on  this button my function doesn't work.
Any ideas ?
thanks .
Slav
Telerik team
 answered on 12 Aug 2011
3 answers
157 views
Hello!

I'm having a problem while trying to get the selected Item from a RadListBox...

When i use the RadListBox1.SelectedItem.Value the value is allways null when i use a dictionary as my datasource, but the RadList has 26 rows....However i have other 2 listboxs whose datasource is an entity..i d'ont have any problem....
Here is my code:
public partial class AssignInvoices : Microsoft.Practices.CompositeWeb.Web.UI.Page, IAssignInvoicesView
    {
        private AssignInvoicesPresenter _presenter;
  
        //implemantaçao da propriedade
        public System.Collections.Generic.IList<Data.Users> Users
        {
            get;
            set;
        }
  
  
        public System.Collections.Generic.IList<Data.Priorities> Priorities
        {
            get;
            set;
        }
  
        public System.Collections.Generic.IList<Data.Staging> Staging
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
            }
            this._presenter.OnViewLoaded();
  
              
              
            Info x = new Info("xx", "xx", "xx,DC=xx,DC=xx");
  
  
            Dictionary<string, string> networkUser = new Dictionary<string, string>();
            networkUser = x.GetHierarchyTree("xx");
  
            Dictionary<string, string> aux = new Dictionary<string, string>();
  
            foreach (KeyValuePair<string, string> kvp in networkUser)
  
            {
                //kvp.Key = user de rede
                string userCompName = x.GetUserInfo("cn", kvp.Key);
  
                aux.Add(kvp.Key, userCompName);//Dictionary com key = user de rede e Value = nomeCompleto Utilizador
                  
            }
  
            RadListBox1.DataTextField = "Key";
            RadListBox1.DataValueField = "Value"; 
            RadListBox1.DataSource = aux;
            RadListBox1.DataBind();
  
              
            //Page.User.Identity.Name para ir buscar o login user
  
  
            //Popular dados na listbox users
            //RadListBox1.DataSource = this.Users;
            //RadListBox1.DataTextField = "UserName";
            //RadListBox1.DataValueField = "UserSap";
            //RadListBox1.DataBind();
  
          
  
            //Popular dados na listbox grupos
            RadListBox2.DataSource = this.Priorities;
            RadListBox2.DataTextField = "Priority";
            RadListBox2.DataValueField = "Priority";
            RadListBox2.DataBind();
  
  
            //Popular dados na listbox stagins
            RadListBox3.DataSource = this.Staging;
            RadListBox3.DataTextField = "Process";
            RadListBox3.DataValueField = "Process";
            RadListBox3.DataBind();
  
  
        }
  
        [CreateNew]
        public AssignInvoicesPresenter Presenter
        {
            get
            {
                return this._presenter;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");
  
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
        // TODO: Forward events to the presenter and show state to the user.
        // For examples of this, see the View-Presenter (with Application Controller) QuickStart:
        //  
  
        protected void RadButton1_Click(object sender, EventArgs e)
        {
            string _UserValue = RadListBox1.SelectedItem.Value; //Gets the value of item in Users.
                          
            //string _text = RadListBox1.SelectedItem.Text;  //Gets the Text of items in the list. 
            List<string> _groups = new List<string>(); //create a list to store selected groups
            string _stg = RadListBox3.SelectedItem.Value; // create a list to store selected stagings
  
  
            if (RadListBox1.SelectedIndex > -1 && RadListBox2.SelectedIndex > -1 && RadListBox3.SelectedIndex > -1)
            {
  
                iConnect.InvoicesScaling.Data.UsersAssignDAO usrAssgnDAO = new iConnect.InvoicesScaling.Data.UsersAssignDAO(new EscalonamentoFacturasEntities());
                UsersAssign user = new UsersAssign();
  
  
                foreach (var grp in RadListBox2.SelectedItems)
                {
                    _groups.Add(grp.Value);  //store the selectItems on RadListBox2 to list groups   
  
                    //efectuar aqui o insert
  
                    user.InserDate = DateTime.Now;
                    int j;
                    Int32.TryParse(grp.Value, out j);
                    user.UserName = _UserValue;
                    user.Priority = j;
                    user.Staging = _stg;
  
                    //passar o objecto a inserir na tabela da bd
                    usrAssgnDAO.Add(user);
  
                    usrAssgnDAO.SaveChanges();
  
                }
  
                  
  
            }
            //else if(RadListBox2.SelectedIndex < -1  )
            //reportar erro
  
  
  
        }
    }
}
Peter Filipov
Telerik team
 answered on 12 Aug 2011
1 answer
69 views
Hi Telerik Team,

I use this link and found that this is a very good example of showing something into my product.
http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/draganddrop/defaultcs.aspx

I open the code and implement the things as discussed in this particular page and found the things proper.

Now the problem is this that I bind the ListBox with the database and try to drag the listbox item from there into the textbox. but now it is giving me that in the function RadListBox_Dropped, e.SourceDragItems.Count become 0 every time.

I am writing my code here.

protected void RadListBox_Dropped(object sender, RadListBoxDroppedEventArgs e)
    {
        if (txtNoteArea.ClientID == e.HtmlElementID)
        {
            txtNoteArea.Text = String.Empty;
            foreach (RadListBoxItem item in e.SourceDragItems)
            {
                txtNoteArea.Text += item.Text + ", \n";
            }
            if (txtNoteArea.Text.Length > 0)
                txtNoteArea.Text = txtNoteArea.Text.TrimEnd(new char[] { ',', ' ', '\n' });
        }
    }
    public void BindStandardNotes()
    {
        DataSet dsMC = new DataSet();
        SqlConnection con = new SqlConnection(System.Web.Configuration.WebConfigurationManager.AppSettings["con"]);
        SqlDataAdapter adp = new SqlDataAdapter("SPNAME", con);
        adp.SelectCommand.CommandType = CommandType.StoredProcedure;
        adp.Fill(dsMC);
        lstStandardNotes.DataSource = dsMC;
        lstStandardNotes.DataValueField = "ID";
        lstStandardNotes.DataTextField = "TEXT";
        lstStandardNotes.DataBind();
    }

<telerik:RadListBox ID="lstStandardNotes" runat="server" Width="90%" Height="200px" SelectionMode="Multiple"
                                                                        AutoPostBackOnReorder="false" EnableDragAndDrop="true" OnDropped="RadListBox_Dropped" />
<asp:TextBox ID="txtNoteArea" runat="server" Wrap="true" Rows="8" TextMode="MultiLine" Width="90%" Height="200px" ValidationGroup="QAN" />

This code is working fine if I put some static items into the ListBox, but when I bind with the Database, the SourceDragItem count become 0.

Please assist me ASAP.

Regards,
Steve Austin
Peter Filipov
Telerik team
 answered on 12 Aug 2011
1 answer
229 views
Hello people...

I'm having a problem with my RadGrid...Can you show me how can i on my asp.cs file(code behind) set the column value of my grid with a navigation property field?
RadGrid1.DataSource = this.SapDocuments;
            RadGrid1.
            RadGrid1.UniqueID.Equals("Process") =
public List<SapDocuments> GetSapDocumentsByUser(string userName)
        {
var documentsQuery = from sd in spDocs.SapDocuments
                                     join ua in spDocs.UsersAssign
                                     on new { sd.Staging.Process, sd.Priorities.Priority }
                                     equals
                                     new { ua.Process, ua.Priority }
                                     where ua.UserName == userName
  
                                     //ALterar User
  
                                     select sd;
  
  
            return documentsQuery.ToList();
        }
  
    }
  
    }

I'm using Entity, and I have the a table SapDocuments with a foreign Key of the field Process to another Table "Staging",

At this moment my grid comes with Priority and Stagin values at null and the others are fine...

<MasterTableView GridLines="None" Width="100%" ViewStateMode="Disabled" CommandItemSettings-ShowExportToCsvButton="True"
                CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top">
                <Columns>
                    <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber"
                        UniqueName="SequencialNumber" SortExpression="SequencialNumber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="Priority" HeaderText="Priority" UniqueName="Priority"
                        FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Process" HeaderText="Staging" UniqueName="Process"
                        SortExpression="Process" FilterControlAltText="Filter Process column">
                    </telerik:GridBoundColumn>


I need to set those two column values with the value of my navigation property....I can access to it like that:

SapDocuments.Staging.Process;
SapDocuments.Priorities.Priority;

I needed to change my datamodel and know i have the exception for Priority and Process :

 {"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."}

I have already set LazyLoad enabled...

Tsvetina
Telerik team
 answered on 12 Aug 2011
2 answers
280 views
Hi,

I have below code structure. and also note that all my parent elements including body has 100% height defined as you mentioned in http://demos.telerik.com/aspnet-ajax/splitter/examples/resizewithwindow/defaultcs.aspx.

But RadPageView doesn't take the 100% height it only takes fixed heights.

<RadSplitter height="100%" width="100%" orientation="vertical">
<RadPane width="22%" height="100%">
Some contents goes here
</RadPane>
<RadPane width="76%" height="100%">
<telerik:RadMultiPage height="100%">
<telerik:RadPageView height="100%">
Some contents goes here
</telerik:RadPageView>
</telerik:RadMultiPage>
</RadPane>
</RadSplitter>

any special ways that I should use height attribute for the RadPageView ?

Thanks
Malinda
Kate
Telerik team
 answered on 12 Aug 2011
2 answers
388 views
Hi,

Am using a RadGrid in my application. When I enter data  without any space in between(ex: HI_How_Are_You_?) in one of the columns, the data does not wrap. Kindly help me in fixing this issue as early as possible.

Thanks,
Sudha.
Sebastian
Telerik team
 answered on 12 Aug 2011
1 answer
91 views
I found GridClientSelectColumn very limited if grid has pages. There are several problems with it.

1. Keeping selected checkboxes while paging. This doesn't work out of the box and I know there are workarounds posted. By the way, I believe Telerik documentation http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html should be updated, since the code simply doesn't work since the array of selected keys needs to be stored in a hidden field.
2. Selecting all checkboxes doesn't affect checkbox at the header. Again the workaround is posted, but I am wondering why isn't it part of the control? Having hundred lines of JavaScript in order to circumvent the limitations of the control, defeats the purpose of even using one.
3. And finaly the biggest roadblock is that checking the box at the header does not check items on all pages and I don't see a way around it since I couldn't find events for the header checkbox.

Maybe it is all by design since the name of the control is GridClientSelectColumn, but it sounds that if grid has pages, I will better off by doing checkboxes manually...

-Stan
Veli
Telerik team
 answered on 12 Aug 2011
1 answer
101 views
Hi.
I have a problem where the input element gets the style below when text is entered into it.
style="background-image: none; background-position: 100% 50%; "

I need the background-image to be visible and stay in its current position. Why is the input elements style changed?
Shinu
Top achievements
Rank 2
 answered on 12 Aug 2011
1 answer
126 views
Hi,

We are getting javascript error while working with asp.net dropdown inside the telerik . OnselectIndex change of dropdown getting javascript error "Sys.WebForms.PageRequestManagerParserErrorException".
 

Please verify the below sample code and provide the resolution.

Thanks InAdvance.

aspx code :

<

 

 

form id="form1" runat="server">

 

 

 

<telerik:RadScriptManager ID="ScriptManager" runat="server" />

 

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

 

 

 

<telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="SingleExpandedItem" Width="740px">

 

 

 

<Items>

 

 

 

<telerik:RadPanelItem Expanded="True" Text="Step 1: Account Information" runat="server" Selected="true">

 

 

 

<Items>

 

 

 

<telerik:RadPanelItem Value="AccountInformation" runat="server">

 

 

 

<ItemTemplate>

 

 

 

 

<asp:DropDownList ID="ddTest" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddTest_OnSelectedIndexChanged">

 

 

 

<asp:ListItem>First</asp:ListItem>

 

 

 

<asp:ListItem>Second</asp:ListItem>

 

 

 

<asp:ListItem>Third</asp:ListItem>

 

 

 

 

</asp:DropDownList>

 

 

 

</ItemTemplate>

 

 

 

</telerik:RadPanelItem>

 

 

 

</Items>

 

 

 

</telerik:RadPanelItem>

 

 

 

</Items>

 

 

 

 

</telerik:RadPanelBar>

 

 

 

</telerik:RadAjaxPanel>

 

 

 

 

</form>

 


C# Code :

protected void ddTest_OnSelectedIndexChanged(object sender , Eventargs e)
{
   Response.write("test");
}

Even after removing response.write in the  code part. getting same javascript issue.
Princy
Top achievements
Rank 2
 answered on 12 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?