Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
199 views
I've created an asp.net user control that contains a HTML img tag and a RadContextMenu (see code below).  The user control is placed on a master page containing a number of content place holders.  Each place holder has a the user control contained within it.  Essentially, I have four instances of the user control sitting on a master page each with a RadContextMenu named titleBarContextMenu.  The img HTML element implements the OnClick event.  The Javascript is designed to show the context menu attached to the img HTML element the user just clicked.  The problem I'm having is the $find javascript command is finding the wrong RadContextMenu.  I used the Telerik samples as a guide on to make the context menu work.  Any ideas how I can find the correct RadContextMenu on the master page when the img HTML element is clicked?  Thanks in advance.

function

 

showMenu(e) {

 

 

var contextMenu = $find("<%= titleBarContextMenu.ClientID %>");

 

 

debugger;

 

 

if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {

 

contextMenu.show(e);

}

$telerik.cancelRawEvent(e);

}


<

 

table border="0" cellpadding="0" cellspacing="0" width="100%" style="height:24px; background-color:Transparent; white-space:nowrap; overflow:hidden; " >

 

 

<tr>

 

 

<td align="left" width="100%">

 

 

<asp:Label ID="paneTitleLabel" Font-Names="Arial" Font-Size="8pt" ForeColor="White" runat="server"></asp:Label>

 

 

</td>

 

 

<td>

 

 

<img src="/Images/Options_Idol.png" onmouseover="this.src='/Images/Options_hover.png'" onclick="showMenu(event)" onmouseout="this.src='/Images/Options_Idol.png'" alt="Web Part Menu" width="25px" />

 

 

 

</td>

 

 

<td align="right" valign="top">

 

 

<telerik:RadToolBar ID="radToolBarTitle" Runat="server" EnableEmbeddedSkins="false"

 

 

Font-Names="Arial" Font-Size="8pt" ForeColor="White" BorderWidth="0px" AutoPostBack="true">

 

 

<ExpandAnimation Duration="600" Type="InOutCubic"></ExpandAnimation>

 

 

<CollapseAnimation Duration="900" Type="InElastic"></CollapseAnimation>

 

 

 

</telerik:RadToolBar>

 

 

<telerik:RadContextMenu ID="titleBarContextMenu" runat="server" Skin="Vista" OnItemClick="titleBarContextMenu_ItemClick">

 

 

<Targets>

 

 

<telerik:ContextMenuControlTarget ControlID="radToolBarTitle" />

 

 

</Targets>

 

 

<Items>

 

 

</Items>

 

 

</telerik:RadContextMenu>

 

 

</td>

 

 

</tr>

 

</

 

table>

 


Telerik sample code:
http://www.telerik.com/help/aspnet-ajax/menu_contextmenus.html
Kurt Boeckman
Top achievements
Rank 1
 answered on 28 Jul 2009
0 answers
167 views
Hi, we are getting an error on file upload to certain folders. We have 10 folders we are setting up right now as follows -

           Dim folderstring1 As String = "~/images"
                Dim folderstring2 As String = "~/pdf"
                Dim folderstring3 As String = "~/MOC"
                Dim folderstring4 As String = "~/Fellows"
                Dim folderstring5 As String = "~/AnnualMeeting"
                Dim folderstring6 As String = "~/banners"
                Dim folderstring7 As String = "~/C3Summit"
                Dim folderstring8 As String = "~/crest"
                Dim folderstring9 As String = "~/Uploads"
                Dim folderstring10 As String = "~/Admin/WordTemplates"

                RadFileExplorer1.Configuration.ViewPaths = New String() {folderstring1, folderstring2, folderstring3, folderstring4, folderstring5, folderstring6, folderstring7, folderstring8, folderstring9, folderstring10}
                RadFileExplorer1.Configuration.DeletePaths = New String() {folderstring1, folderstring2, folderstring3, folderstring4, folderstring5, folderstring6, folderstring7, folderstring8, folderstring9, folderstring10}
                RadFileExplorer1.Configuration.UploadPaths = New String() {folderstring1, folderstring2, folderstring3, folderstring4, folderstring5, folderstring6, folderstring7, folderstring8, folderstring9, folderstring10}

                RadFileExplorer1.DataBind()

When we try to upload to folderstring4, we get a 'cannot write to the target folder' error. On the server, that folder has accounts ASPNET, NETWORK, and NETWORK SERVICE all set with FULL CONTROL - so this should work fine. For some reason, the other folders work OK. Any thoughts out there?


Karl Wilkens
Top achievements
Rank 1
 asked on 28 Jul 2009
2 answers
164 views
Hi,
I have a RadGrid which displays all records in 'InPlace' edit mode.  One of the columns in the grid is a GridDropDown column. Since I cannot add a FooterTemplate to this column directly, I do the following in the ItemDataBound event:

if (e.Item is GridFooterItem)
{
   GridFooterItem footer = (GridFooterItem)e.Item;
   RadComboBox radComboStatus = new RadComboBox();
   radComboStatus.ID = comboId;
   .
   .

   footer["DisplayStatus"].Controls.Add(radComboStatus);
            
}


This allows me to display the combo box in the footer. However, I am not able to access this control on the serverside during a postback (caused by a button in the footer of some other column). I am able to access other controls in the footer that were added during design time using the footertemplate.

Thanks in advance for you help

TJ
Tushar Jain
Top achievements
Rank 1
 answered on 28 Jul 2009
4 answers
99 views
public class Details 
        public Int64 ID 
        { 
            get; 
            set; 
        } 
 
        public Contact Contact 
        { 
            get; 
            set; 
        } 
 
public class Contact 
 
        public string Title 
        { 
            get; 
            set; 
        } 
 
        public string FirstName 
        { 
            get; 
            set; 
        } 

I am binding the List<Details> object to grid. And I am having the below code in Grid Edit Template(popup). While editing its working fine. But during "AddNew" it showing error for "Contact".

<asp:TextBox ID="txtFirstName" Text='<%#  Eval("Contact.FirstName") %>' CssClass="txtBox" 
                                        runat="server"></asp:TextBox> 


Kindly give me a solution.

Pavlina
Telerik team
 answered on 28 Jul 2009
1 answer
111 views

As documented:

"There is no universal mechanism for grouping when custom paging is allowed. The reason for this is that with the custom paging mechanism you fetch only a part of the whole information from the grid data source. Thus, when the grouping event is triggered, the grid is restricted in operating with a limited subset of the entire available data and is not able to group the items accurately. Furthermore, the aggregate functions as Count, Sum, etc. (covering operations with the whole set of grid items) may return incorrect results.

Grouping with custom paging is still possible, but it has several limitations:

  • The data that the grid binds to has to be sorted. If it is not, you may see different members of a group "grouped" to different pages when they appear at different locations in the data source.
  • The aggregate functions will not work correctly for groups that span several pages. There is no way to calculate aggregate values for the entire group when we only work with a single page of data. It is best not to use aggregate functions at all when using grouping together with custom paging. If aggregates are important to you, reduce the data source size and disable custom paging."

Hint:
It would be possible if there were an event (like the NeedDataSource) which is called "NeedGroupTotals" or similiar which provides the needed EventArgs to perform an extra call to the database.

Pavlina
Telerik team
 answered on 28 Jul 2009
1 answer
92 views
In my application the resource style mappings are quite dynamic, and I figured out how to add them dynamically, it works.
However, is there a way to "inject" these mappings into the ViewState of the Scheduler when I generate them?
As of now, on some of the postbacks, not all the data gets re-bound and thus the mappings don't get added.  Is there a way to tell the mapping to be injected into the viewState of the control, so it is available on postbacks?
The code which creates the mappings does check to make sure the mapping doesn't already exist.
T. Tsonev
Telerik team
 answered on 28 Jul 2009
1 answer
112 views
Hi, 

I have a RadGrid1 with the following TemplateField in it:

 

<telerik:GridTemplateColumn HeaderText="Number of units" UniqueName = "FldNumberOfUnits">

 

 

<ItemTemplate>

 

 

<asp:Label runat= "server" ID= "FldNumberOfUnits" Text='<%# Eval("FldNumberOfUnits") %>'>

 

 

</asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadNumericTextBox runat="server" ID="FldNumberOfUnits" skin= "Office2007" Type = "Number" Text='<%# Eval("FldNumberOfUnits") %>'>

 

 

</telerik:RadNumericTextBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

on editing, in the RadGrid1_ItemCommand eventhandler (e.CommandName = "Update"), i try accessing it like this:

 

"CType

 

(e.Item.FindControl("FldNumberOfUnits"), RadNumericTextBox).Text"

The control gets actually found, but the value I've entered does not. The text property is always an empty string. When I use an asp:TextBox in my EditItemTemplate the newly entered value gets picked.

Any help will be highly appreciated.
Thanks in advance!

 

Martin
Telerik team
 answered on 28 Jul 2009
1 answer
103 views
I am having a problem and I do not understand why it is happening.  I have created a simple interface that will allow an admin to post News Articles to a site and see all the Articles in a list.  The list has the insert ability and a edit ability in it.  When I am  editing the Article the RadTextBoxs that I have are not passing back the proper data.  If I change the data in the text box it is passing the data that was there initially instead of what I changed it too.  Any reason why this is happening?


Thanks,

Kyle
Kyle Jones
Top achievements
Rank 1
 answered on 28 Jul 2009
6 answers
177 views
I have an datalist on my page that bind with datset which showing  records in 4 columns and 2 rows .It means total 8 records are showing currently on the page..
The image and text showing  inside Item template of datalist. ok

Now,
i have a new requirement to use radrotator

there are < previous and next > button on top of the page.

when i click on next buton ,,next records of datalist are shown on the same page. means 9th onwards records shown on dalalist.

rough Idea:
<rotator>
<frame>
     <datalist>
      <item template>
        bind with dataset
      </item template>
      </datalist>
</frame>
</rotator>

<img id="next">
<img id="previous">

How to do that??

Please Help???????


Fiko
Telerik team
 answered on 28 Jul 2009
1 answer
133 views
Hello.

Could you help me to fix problem finding items in grid?
I use RadGrid with pagination to display table information.
A simple binding approach is used. So I have to rebing grid every time after the grids operations are called: paging/sorting/grouping.
I have a list of selected items(DataKeyNames) were selected by user. The restoring performs on Item_Bound event.
Step to reproduce incorrect situation:
1. Select one item in 1 page.
2. Move to second page. The Item_Bound event is fired.
The grid finds item which was selected on first page.  After that selects founded item.
But this item was on the first page. Why does grid find it?
3. Grid displays the second page.There is no exist selected item. 
4. Move to third page. The grid does not find item which was selected on first page.

I think the grid shouldn't find item if this item does not exist on the curent page. Am I right?
Why does grid find item when page is first time post back, and does not find when page is second time postback?

Thanks.
Alex.






Sebastian
Telerik team
 answered on 28 Jul 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?