Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
125 views
Hi,

I'm trying to get the reference of the label object inside NoRecordsTemplate using client side.
Is it possible? How?


Thanks.
Dexter
Tsvetoslav
Telerik team
 answered on 14 Feb 2012
4 answers
113 views
Hi

I need a requirement like ,I need to show a particular duration having appointment in a particular color.I mean I dont want to show the appointment name or I dont want to see it like a projected section.I just want to show a light green color to indicate that an appointment has beed scheduled in the particular duration.

For eg : If an appointment is given for 9 to 9.20 I dont want to show it as a projection.I just need the section as such empty ,but with a different colour.Just to indicate that the particular timing has an appointment scheduled.

I searched a lot .But all search ends with giving cssclass/colour to the appointment given.I dont want that type.I just want to show the given appointment duration with different colour.I dont want to show a projected appointment block.Just need a colour change in the whole duration or time slot.This must be shown whether the user selects day,week or month type view.

Any help is appreciated..
Regards
Chinnu :)
Ivana
Telerik team
 answered on 14 Feb 2012
4 answers
205 views
Hi
My app has ViewState disabled.
I have a panel bar with multiple items. Depending on some server side logic, I may hide some panel items.
The PanelBar loads fine.
However, on postback the wrong panel item opens.
Let's say I have 5 panel items and the server side logic hides the first one.
If I click Edit on the 4th item, on postback the 3rd item would open.

In the example below, no panel would be open on postback.
How can I fix it?

Thanks
Chen

<telerik:RadPanelBar ID="RadPanelBar1" Runat="server">
            <Items>
                <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2" Selected="True">
                </telerik:RadPanelItem>
                <telerik:RadPanelItem runat="server" Text="Root RadPanelItem3">
                    <ContentTemplate>
                        <asp:FormView ID="FormView1" runat="server" DataSourceID="LinqDataSourcePayee"
                            DataKeyNames="id">
                            <EditItemTemplate>
                                firstName:
                                <asp:TextBox ID="firstNameTextBox" runat="server"
                                    Text='<%# Bind("firstName") %>' />
                                <br />
                                lastName:
                                <asp:TextBox ID="lastNameTextBox" runat="server"
                                    Text='<%# Bind("lastName") %>' />
                                <br />
                                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
                                    CommandName="Update" Text="Update" />
                                 <asp:LinkButton ID="UpdateCancelButton" runat="server"
                                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                            </EditItemTemplate>
                             
                            <ItemTemplate>
                                firstName:
                                <asp:Label ID="firstNameLabel" runat="server" Text='<%# Bind("firstName") %>' />
                                <br />
                                lastName:
                                <asp:Label ID="lastNameLabel" runat="server" Text='<%# Bind("lastName") %>' />
                                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
                                    CommandName="Edit" Text="Edit" />
                            </ItemTemplate>
                        </asp:FormView>
                    </ContentTemplate>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>

Code behind:
protected void Page_Load(object sender, EventArgs e)
{
       RadPanelBar1.Items[0].Visible = RadPanelBar1.Items[0].Enabled =false;
}


Kate
Telerik team
 answered on 14 Feb 2012
1 answer
122 views
Server-side validation finds an error in some other user's entries when they attempt to upload a file they've selected.

After the PostBack, the Upload file list is empty again. How do I preserve the list so the user need not enter it again? Do I have to programmatically save and restore it myself?
Bozhidar
Telerik team
 answered on 14 Feb 2012
1 answer
59 views
Good Morning;

I have been very interest on the telerik asp.net components where it will be very useful in our system development. i have ask our manager to buy telerik for our development as we facing some problem on have update panel to be triggered using a component inside the grid.

I appreciate if somebody help me on getting this requirement implemented. also i have question for admin, is there training for telerik components which can be arranged by telerik team.

Hussian.
Tsvetoslav
Telerik team
 answered on 14 Feb 2012
2 answers
156 views
i Want RadButton looks like rectangle box , i don't want the rounded corners
Bozhidar
Telerik team
 answered on 14 Feb 2012
3 answers
89 views
hi

How do i change the color using css on the header? I have attached a picture on the area i want to change. Thanks
Princy
Top achievements
Rank 2
 answered on 14 Feb 2012
1 answer
67 views
Hi,

I have an web user control having a radwindow and a radgrid within it. I want to invoke this user control from multiple pages which means I want to show the popup(radwindow) from multiple pages. Could you please guide me how i cn achieve this. Now I am creating an instance of the user control in the calling form and finding the radwindow from the user control.But it is not finding the radwindow from the user control.It is giving null when I am trying to find the radwindow from the user control.

Thanks.
Princy
Top achievements
Rank 2
 answered on 14 Feb 2012
3 answers
512 views

The data binding event in this code isn't working any longer.  I was testing a custom node template and using the code from this page (add and edit templates Runtime), but then removed all the code specific to the custom node template.  At that point, the data stopped binding.  I have added the code back, moved all of it to another page, but the data binding event doesn't seem to fire.  Even with all the test code from the linked page above in my page, if I set a breakpoint in the DataBinding function it never gets hit.  If I manually place a RadTreeView on the .aspx page it will display, but anything set on the server side will not.

I have checked to make sure List used to populate the tree has data, and this line (radTree.DataSource = treeNodes) works correctly.  But the databind is still failing.

Any suggestions?

Thanks,
Peter

namespace FQRSurvey.Controls  
{  
   public partial class TreeViewControl : System.Web.UI.UserControl  
   {  
      protected void Page_Load(object sender, EventArgs e)  
      {  
         if (!this.Page.IsPostBack)  
         {  
            //load tree view  
            Survey survey = SurveyController.GetSurveyByID(new Guid("6C685FBA-1380-47B7-A911-DC89AF9479CF"));  
            CreateRadTree(survey, questionTree);  
         }  
      }  
      protected override void OnInit(EventArgs e)  
      {  
         questionTree.NodeTemplate = new SectionTemplate();  
         //questionTree.NodeTemplate = new QuestionTemplate();  
         //questionTree.NodeTemplate = new AnswerTemplate();  
         base.OnInit(e);  
      }  
 
      protected void RadTreeView1_HandleDrop(object sender, RadTreeNodeDragDropEventArgs e)  
      {  
         RadTreeNode sourceNode = e.SourceDragNode;  
         RadTreeNode destNode = e.DestDragNode;  
         RadTreeViewDropPosition dropPosition = e.DropPosition;  
 
         if (destNode != null)  
         {  
            if (sourceNode.TreeView.SelectedNodes.Count <= 1)  
            {  
               if (!sourceNode.IsAncestorOf(destNode))  
               {  
                  sourceNode.Owner.Nodes.Remove(sourceNode);  
                  destNode.Nodes.Add(sourceNode);  
               }  
            }  
 
            destNode.Expanded = true;  
            sourceNode.TreeView.ClearSelectedNodes();  
         }  
      }  
 
      private void CreateRadTree(Survey survey, RadTreeView radTree)  
      {  
         radTree.NodeTemplate = new SectionTemplate();  
 
         if (!survey.Sections.Count.Equals(0))  
         {  
            List<TreeNode1> treeNodes = new List<TreeNode1>();  
            Sections sections = survey.Sections;  
 
            //Loop through Sections  
            for (int i = 0; i < sections.Count; i++)  
            {  
               Section section = sections[i];  
               //Create Section Node  
               TreeNode1 sNode = new TreeNode1(section.SectionID.ToString(), String.Empty, section.SectionTitle, section.SectionStatus);  
               treeNodes.Add(sNode);  
 
               //Get Questions  
               if (section.FirstQuestion != null)  
               {  
                  Question q = section.FirstQuestion;  
                  string prevNode = String.Empty;  
 
                  if (q.PrevAnswer == null) prevNode = sNode.ID;  
                  else prevNode = q.PrevAnswer.AnswerID.ToString();  
 
                  //Create Question Node  
                  TreeNode1 qNode = new TreeNode1("q" + q.FriendlyID, prevNode, q.QuestionText, SurveyStatus.Active);  
                  //Create Answer Group  
                  treeNodes.Add(qNode);  
               }  
            }  
 
            radTree.DataTextField = "Text";  
            radTree.DataFieldID = "ID";  
            radTree.DataFieldParentID = "ParentID";  
            radTree.DataSource = treeNodes;  
            radTree.DataBind();  
         }  
      }  
   }  
 
 
   internal class TreeNode1  
   {  
      private string _id;  
      private string _text;  
      private SurveyStatus _status;  
      private string _parentID;  
 
      public string ID  
      {  
         get { return _id; }  
         set { _id = value; }  
      }  
 
      public string ParentID  
      {  
         get { return _parentID; }  
         set { _parentID = value; }  
      }  
 
      public string Text  
      {  
         get { return _text; }  
         set { _text = value; }  
      }  
 
      public SurveyStatus Status  
      {  
         get { return _status; }  
         set { _status = value; }  
      }  
 
      public TreeNode1(string id, string parentID, string text, SurveyStatus status)  
      {  
         _id = id;  
         _text = text;  
         _status = status;  
         _parentID = parentID;  
      }  
   }  
 
   class SectionTemplate : ITemplate  
   {  
      public void InstantiateIn(Control container)  
      {  
         Label label1 = new Label();  
         label1.Font.Size = 15;  
         label1.DataBinding += new EventHandler(label1_DataBinding);  
         container.Controls.Add(label1);  
      }  
 
      private void label1_DataBinding(object sender, EventArgs e)  
      {  
         Label target = (Label)sender;  
         RadTreeNode node = (RadTreeNode)target.BindingContainer;  
         string nodeText = (string)DataBinder.Eval(node, "Text");  
         target.Text = nodeText;  
      }  
   }  
 


Update:
From additional digging and messing around, the problem relates to converting a Guid to a string to be used as the ID field.  I'm not sure why it won't accept the Guid as a string, but using an int instead of string fixes the problem.  Any reason convertinting a Guid to a string would cause the data to fail to bind without any errors?
Robin
Top achievements
Rank 1
 answered on 14 Feb 2012
1 answer
74 views
How to change the text of first item "Check all which is generated automatically?
Princy
Top achievements
Rank 2
 answered on 14 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?