Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
I have two seperate RadGrids, I want the user to click on item in RadGrid1
+ if post count is zero then will popup via link a radwindow to add, this works
+ if post count is greater than zero then have a link that will simply pass the TopicID to RadGrid2 which will then display all posts
for that topic in seperate grid.  Would be  nice to have RadGrid2 visible = false UNTIL user clicks on this link

<

 

telerik:GridTemplateColumn UniqueName="Item" HeaderText="Item" ReadOnly="true" SortExpression="ITEM">

 

 

<ItemTemplate>

 

<%

# setPosts(Convert.ToInt32(Eval("Posts")))%>   -- this code sets a variabe in code behind so can be determined in next line

 

 

<%

if (Posts > 0)

 

{ %>

 

-- this is where I need the help
<
a href="#" runat="server" onserverclick='<%# withPosts(Convert.ToInt32(Eval("ID"))) %>'><%# DataBinder.Eval(Container.DataItem, "Item")%> (<%# DataBinder.Eval(Container.DataItem, "Posts")%>)

 

 

</a>

 

<%} %>

<%

else

 

{ %>

 

<a href="#" onclick="openAddTopicWindow('<%# DataBinder.Eval(Container.DataItem, "ID") %>'); return false;"><%# DataBinder.Eval(Container.DataItem, "Item")%> (<%# DataBinder.Eval(Container.DataItem, "Posts")%>)

 

 

</a>

 

<%} %>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

Martin
Telerik team
 answered on 18 Aug 2009
6 answers
310 views
Why is it that the editor does not encode quotes?  Is there a feature I can turn on for this?  It encodes line breaks and the like, but does nothing with double quotes.

When applying something like: Server.HtmlEncode(RadEditor1.Content), you end up encoding the <br/> tags along with the quotes.  What good is having an editor format html if it only partially does it, and what is the rectification for this issue?  I understand a string.Replace could be used, but the methodology of this tool's encoding (in my mind) defies logical behavior?  It seems to me that I did not have this issue prior to Q2, but I could be wrong on that...
Schlurk
Top achievements
Rank 2
 answered on 18 Aug 2009
2 answers
185 views

I have tried the built-in RadEditorStatistics module, but I want to customize the character count. It needs to be smaller and flush right, and I don't need a word count (does anyone?) Plus, I want the character count to freshen dynamically on every keystroke.

Anyway, has anyone done a custom character counter that dynamically shows the remaining characters?

Thanks.

Terry Hoiness
Top achievements
Rank 1
 answered on 18 Aug 2009
1 answer
150 views
Hi

I have a tree view with check boxes and I want to use client side script to

1. If I un-check a box then I want to un-check all children
2. If I check a box then I want to check all the parent items all the way up the hierarchy of the tree

The code I have to do this is

  
 function updateAllChildren(nodes) 
                    { 
                       var i; 
                       for (i=0; i<nodes.get_count(); i++) 
                       { 
                           nodes.getNode(i).set_checked(false); 
                            
                           if (nodes.getNode(i).get_nodes().get_count()> 0) 
                           { 
                               updateAllChildren(nodes.getNode(i).get_nodes()); 
                           } 
                       } 
                    } 
                     
                    function clientNodeChecked(sender, eventArgs) 
                    { 
                        var selectedNode = eventArgs.get_node(); 
                        var isSelected = selectedNode.get_checked(); 
                        var currentNode = selectedNode.get_parent(); 
                        var childNodes = selectedNode.get_nodes(); 
                     
                        // toggle node 
                        selectedNode.set_checked(!isSelected); 
                     
                        if (isSelected) // If seleceted then push changes up hierarchy 
                        { 
                            while (currentNode.get_attributes().getAttribute("ParentID") != "0") 
                            { 
                                currentNode.set_checked(true); 
                                currentNodecurrentNode = currentNode.get_parent(); 
                            } 
                        } 
                         
                        if (!isSelected)// force uncheck for all children 
                        { 
                            updateAllChildren(childNodes); 
                        } 
                         
                     
                    
                } 

The code appears to be working to a degree in that

1. If I check a child item then it correctly sets all the parent items up the tree to checked
2. If I un-check an item it correctly un-checks all the children entries

The problem I am having is that if I

1. When I try to check an item that has children then nothing happens - The variable isSelected is set to false, when it should be true.
2. When I try to un-select an item that has no children then nothing happens - The variable isSelected is set to true when it should be false.

I can get it working fine with server side code, but client side would be much neater

Many thanks in advance

Huw Lloyd
Top achievements
Rank 1
 answered on 18 Aug 2009
1 answer
155 views

Hi

I am having a RadGrid . Inside that I placed two RadTimePickers FromTime and ToTime.
Right now I am using Compare Validator for validating To Time and From Time .(from time should be less than to Time)

But I want to show an  alert instead of the message 
How to achieve it.
My code was given below. Please suggest


      <rad:RadGrid ID="gvWorkingHours_New" runat="server" Skin="SkeltaGrid" AutoGenerateColumns="false"
              >
                <MasterTableView>
                    <Columns>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:TextBox runat="server" ID="txtSlotName" CssClass="inputsNoExpression" Text='<%# Eval("SlotName") %>'></asp:TextBox>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <radCln:RadTimePicker ID="rtpFromTime" Width="31%" runat="server" TabIndex="2" EnableTyping="true"
                                    TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm" DateInput-DisplayDateFormat="HH:mm"
                                    DateInput-EmptyMessage="From Time" DBSelectedDate='<%# Eval("FromTime") %>'>
                                    <TimeView ID="tvFrom" runat="server" ShowHeader="False" Interval="00:30" Columns="3">
                                    </TimeView>
                                </radCln:RadTimePicker>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <radCln:RadTimePicker ID="rtpToTime" Width="31%" runat="server" TabIndex="2" EnableTyping="true"
                                    TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm" DateInput-DisplayDateFormat="HH:mm"
                                    DateInput-EmptyMessage="To Time" DBSelectedDate='<%# Eval("ToTime") %>'>
                                    <TimeView ID="tvTo" runat="server" ShowHeader="False" Interval="00:30" Columns="3"
                                         OnClientTimeSelected="TestHandler">
                                    </TimeView>
                                </radCln:RadTimePicker>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                        <rad:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="rtpToTime"
                                    ControlToCompare="rtpFromTime" Operator="GreaterThan" Type="String" ErrorMessage="To Date must be greater than From Date">
                                </asp:CompareValidator>
                            </ItemTemplate>
                        </rad:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </rad:RadGrid>
            <asp:LinkButton ID="LinkButton1" runat="server" OnClick="lnkbtnAddSlot_New_Click"
                Width="97px" CssClass="sf-inputsLinkButton" OnClientClick="return AddSlot_New()">Add Slot_New</asp:LinkButton>
       ---
code behind 

protected

 

void Page_Load(object sender, EventArgs e)

 

{

 

if (!IsPostBack)

 

{

SetInitialRowForSlots_New();

}

}

 

private void SetInitialRowForSlots_New()

 

{

 

DataTable dtSlots = new DataTable();

 

dtSlots.Columns.Add(

new DataColumn("SlotName", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("FromTime", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("ToTime", typeof(string)));

 

 

DataRow drSlot = dtSlots.NewRow();

 

drSlot[

"SlotName"] = string.Empty;

 

drSlot[

"FromTime"] = new TimeSpan(0, 0, 0);

 

drSlot[

"ToTime"] = new TimeSpan(0, 0, 0);

 

dtSlots.Rows.Add(drSlot);

gvWorkingHours_New.DataSource = dtSlots;

gvWorkingHours_New.DataBind();

}

 

protected void lnkbtnAddSlot_New_Click(object sender, EventArgs e)

 

{

 

DataTable dtSlots = new DataTable();

 

dtSlots.Columns.Add(

new DataColumn("SlotName", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("FromTime", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("ToTime", typeof(string)));

 

 

foreach (GridDataItem pkgItem in gvWorkingHours_New.MasterTableView.Items)

 

{

 

TextBox SlotName = pkgItem.FindControl("txtSlotName") as TextBox;

 

 

RadTimePicker FrTime = pkgItem.FindControl("rtpFromTime") as RadTimePicker;

 

 

RadTimePicker ToTime = pkgItem.FindControl("rtpToTime") as RadTimePicker;

 

 

DataRow dr = dtSlots.NewRow();

 

dr[

"SlotName"] = SlotName.Text;

 

dr[

"FromTime"] = new TimeSpan(((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Minutes, 0);

 

dr[

"ToTime"] = new TimeSpan(((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Minutes, 0);

 

dtSlots.Rows.Add(dr);

}

 

DataRow drEmpty = dtSlots.NewRow();

 

drEmpty[

"SlotName"] = string.Empty;

 

drEmpty[

"FromTime"] = new TimeSpan(0, 0, 0);

 

drEmpty[

"ToTime"] = new TimeSpan(0, 0, 0);

 

dtSlots.Rows.Add(drEmpty);

gvWorkingHours_New.DataSource = dtSlots;

gvWorkingHours_New.DataBind();

}


Regards
Sreedhar Ambati
Schlurk
Top achievements
Rank 2
 answered on 18 Aug 2009
4 answers
197 views
I have the following RadAjaxLoadingPanel that I am using to show a loading image when doing a search.

 

<asp:Panel ID="PanelUpdateProgress" runat="server">

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="2000" >

 

 

<div class="divloadingbackground" id="divTitle2" runat="server">

 

 

<div class="divloading">

 

 

<div id="Img1" class="imageloading" />

 

 

<asp:Label ID="LabelLoadingText" CssClass="labelloading" runat="server" Text="Loading Data..."></asp:Label>

 

 

</div>

 

 

</div>

 

 

 

</telerik:RadAjaxLoadingPanel>

 

 

 

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="buttonSearch">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="divTitle2" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManagerProxy>

 

 

 

</asp:Panel>


When I first come into the page and click the search button(buttonSearch), which is included in a separate div not shown here with other code, the loading image comes up covering the whole page just as I would like.  However, when I do additional searches without leaving the page, the search itself executes, but the loading image does not come back up.  Am I missing a property that must be set in order to have the loading image come up again.

Thanks for any help that anyone may have.

Aaron


 

Aaron
Top achievements
Rank 1
 answered on 18 Aug 2009
7 answers
170 views
In a website I'm developing, I'm mapping URL paths to specific files with query strings. This was working great with the non-Ajax controls (both Q1 and Q2) but when I put in the AJAX Manager, or Panel, it breaks. Each time a page starts the request, an error will pop up saying the following:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404

If I replace <telerik:RadAjaxPanel></telerik:RadAjaxPanel> with <radA:RadAjaxPanel></radA:RadAjaxPanel> everything goes back to working as expected.

Is there a way to get the AJAX version to work with URL mapping like the non-AJAX version? I can use the standard <radA:RadAjaxPanel> but I'd like to swap it out if at all possible.

Thanks!
leah solomon
Top achievements
Rank 1
 answered on 18 Aug 2009
0 answers
94 views
I have two RadComboBox & one of them has a treeview in it.  Same as cascading dropdowns When I select some item in my first radcombobox I need to load different items to my treeview (which is inside another radcombobox). But which event I can raise from the javascirpt for it ?
I tried combo.requestItems(node.get_text(),false);  I got error when I tried this.

Please help I am stuck.

 

venm
Top achievements
Rank 1
 asked on 18 Aug 2009
1 answer
113 views
I am sorting radgrid .
in itemdataboud i am using datasource of radgrid which is List<T>
when i click on column name to sort grid
in item databound i am not getting sorted datasource
that i know but how do i get sorted datasource in itemdata bound or dataview from radgrid
Vlad
Telerik team
 answered on 18 Aug 2009
3 answers
186 views
Dear Telerik-team,

When we installed the latest hotfix (2009.2_817), it seems that the HeaderDateFormat became broken.

They look like this in the TimeLineView: http://bart.nimio.info/images/fora/scheduler3.JPG, while we have the HeaderDateFormat set to "H:mm" (also notice the alignment of the two appointments. One is always standing a little lower than the other one. Would it be possible to keep all the appointments on the same level, except for the ones that overlap eachother?)

The same problem for the WeekView: http://bart.nimio.info/images/fora/scheduler4.JPG (HeaderDateFormat="dd/MM/yyyy").

T. Tsonev
Telerik team
 answered on 18 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?