Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
119 views
hi,

I have a radmenu with sqldatasource.When the user log in the site,the menu will load according to the user rights.I check the user rights from the database.The code below doesn't work for me.How can I achieve this?

private void CreateMenuByUser()
       {
           RadMenu1.Visible = true;
           DataTable table = GetDataTable("SELECT * FROM UserRights INNER JOIN Users ON UserRights.UserID = Users.UserID WHERE Users.UserID = '" + Session["UserID"] + "'");
 
           //RadMenuItemCollection menuItems = RadMenu1.Items;
           RadMenuItem disabledItems = new RadMenuItem();
 
           foreach (DataRow item in table.Rows)
           {
               if (bool.Parse(item["rRead"].ToString()) == false)
               {
                   foreach (RadMenuItem menuItem in RadMenu1.Items)-->>>this line cause the error Index was out of the range error
                   {
                       if (menuItem.Value == item["MenuID"].ToString()) disabledItems = menuItem;
                       if (menuItem.Items.Count > 0) GetAllChildItems(menuItem, item["MenuID"].ToString());
 
                   }
 
                   RadMenu1.Items.Remove(disabledItems);
               }
           }
       }

     private void GetAllChildItems(RadMenuItem itemsList, string MenuId)
      {
           RadMenuItemCollection menuItems = itemsList.Items;
           RadMenuItem disabledItems = new RadMenuItem();
 
           foreach (RadMenuItem menuItem in itemsList.Items)
           {
               if (menuItem.Value == MenuId) disabledItems = menuItem;
           }
 
           menuItems.Remove(disabledItems);
       }
Emre
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
100 views
I have several columns in my radGrid that are set to visible = false. Is there a way to export those columns also? Right now they don't show in the export. I'm trying to export to Excel.

Thanks!
Justin
Top achievements
Rank 1
 answered on 20 Dec 2011
5 answers
133 views
Adding the groupfooter and calculating a total for a column was pretty easy, but how can I format the output so that it shows something besides "Sum: 9999"?
Shawn Clabough
Top achievements
Rank 1
 answered on 20 Dec 2011
6 answers
192 views
I have a radmenu that I generate by examing sharepoint document library folders and building out a submenu structure based on the folder.
When I put many of the control on the page, the root menu from other controls shows up over the sub menu of the control.
Does anyone know how to prevent it, by altering programatically assigning the style for the z index to the sub menus?
See the attached file for a better understanding of the problem. The text was sanitized for public consumption.


Edit:
Additional Information: When rolling over the menu and the subitems menu shows it does properly cover the other menus and they do not show through. However when rolling over it a 2nd time it definitely shows through, as though its z index is larger.

These controls are each in their own webparts, does that matter? Maybe they're inheriting z-index?

Edit: more info: the effect only occurs in IE, didn't occur in chrome or mozilla firefox

My ascx: (customItem is the submenu), these classes are applied programmatically in code
<style type="text/css">
    .CustomItem
    {
         z-index:99999;
    }
     
    .rootItem
    {
        text-align:center !important;
        text-decoration:none !important;
        z-index:-1;
    }
    .CustomItem:hover
    {
     text-decoration:none !important;  
     
    }
</style>
<div id="section" runat="server" >
<telerik:RadMenu ID="FolderMenu" runat="server">
</telerik:RadMenu>

Ivan Zhekov
Telerik team
 answered on 20 Dec 2011
3 answers
113 views
  <MasterTableView DataKeyNames="ID" CommandItemDisplay="TopAndBottom"  EditMode="PopUp" DataSourceID="DS1">


Hi,

I was using the above code for editing data with a pop-up.
My edit is working fine...but the add button...which appears when I Give Commanditemdisplay is not l working..It says the specific cast is Invalid...once I remove the date fields then i get the add button working...


My data field:

   <telerik:GridBoundColumn UniqueName="TechnicalDateofEntry" HeaderText="TechnicalDateofEntry" DataField="TechnicalDateofEntry" DataFormatString="{0:d}">


Edit template:
                            <td>
                               DateofEntry  
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="TextBox17" runat="server"  SelectedDate='<%# Bind( "TechnicalDateofEntry") %>'>
                                </telerik:RadDatePicker>
                            </td>
                 
 <InsertParameters>
                  
                    <asp:Parameter Name="TechnicalDateofEntry" Type="DateTime" />
                   
                                       
                </InsertParameters>


.I have the attached error...plz let me know wats causing this issue..Am i missing casting anywhere...all I declared is date time..


Thanks a lot..
S
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
136 views
Hi,


Can some please help me in getting date from database table column..ASAP..

 <MasterTableView DataKeyNames="ID" CommandItemDisplay="TopAndBottom"  EditMode="PopUp" DataSourceID="DS1">

I was using the above code for editing data with a pop-up.
My edit is working fine...but the add button... is not l working..It says the specific cast is Invalid...once I remove the date fields then i get the add button working...

My field:
   <telerik:GridBoundColumn UniqueName="TechnicalDateofEntry" HeaderText="TechnicalDateofEntry" DataField="TechnicalDateofEntry" DataFormatString="{0:d}">

Edit template:
                            <td>
                               DateofEntry  
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="TextBox17" runat="server"  SelectedDate='<%# Bind( "TechnicalDateofEntry") %>'>
                                </telerik:RadDatePicker>
                            </td>
                 
 <InsertParameters>
                  
                    <asp:Parameter Name="TechnicalDateofEntry" Type="DateTime" />
                   
                                       
                </InsertParameters>


.I have the attached error...plz let me know wats causing this issue..Am i missing casting anywhere...all I declared is date time..

I was update the records with out any casting...Why is it asking cast for inserting the data...????


followed the below article:


http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx  

please advise
Thanks a lot..  


            
S
Top achievements
Rank 1
 answered on 20 Dec 2011
3 answers
102 views
Hi
I have grid control on my page

<

 

 

Rad:RadGrid Width="100%" Height="100%" EnableAJAX="true" ID="grdDispatchedStaff" style="border:0;" runat="server" AllowPaging="False" AllowSorting="True"

 

 

 

AllowMultiRowSelection="false" AutoGenerateColumns="false"

 

 

 

OnNeedDataSource ="GridDispatchedStaffNeedDataSource" >

 

 

 

<MasterTableView DataKeyNames="DispatchAssignmentGUID" ClientDataKeyNames="DispatchAssignmentGUID" AllowNaturalSort="false" TableLayout="Fixed" >

 

 

 

<HeaderStyle Height="18px" Font-Names="Tahoma" Font-Size="7pt" Font-Bold="true"/>

 

 

 

<ItemStyle CssClass="RowModified" />

 

 

 

<AlternatingItemStyle CssClass="RowModified" />

 

 

 

<Columns>

 

 

 

<Rad:GridBoundColumn UniqueName="DispatchAssignmentGUID" SortExpression="DispatchAssignmentGUID" HeaderText="DispatchAssignmentGUID" DataField="DispatchAssignmentGUID" Visible="false" />

 

 

 

<Rad:GridBoundColumn UniqueName="FullName" SortExpression="FullName" HeaderStyle-Width="8%" HeaderText="Name" DataField="FullName" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="RadioID" SortExpression="RadioID" HeaderStyle-Width="8%" HeaderText="Radio ID" DataField="RadioID" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="CallSign" SortExpression="CallSign" HeaderStyle-Width="8%" HeaderText="Call Sign" DataField="CallSign" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ReferenceID" SortExpression="ReferenceID" HeaderStyle-Width="8%" HeaderText="Ref. ID" DataField="ReferenceID" DataFormatString="{0:d}"/>

 

 

 

<Rad:GridBoundColumn UniqueName="DispatchRole" SortExpression="DispatchRole" HeaderStyle-Width="7%" HeaderText="Role" DataField="DispatchRole" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="DispatchTime" SortExpression="DispatchTime" HeaderStyle-Width="11%" HeaderText="Dispatch Time" DataField="DispatchTime" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ETA" SortExpression="ETA" HeaderStyle-Width="11%" HeaderText="ETA" DataField="ETA" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ArrivalTime" SortExpression="ArrivalTime" HeaderStyle-Width="11%" HeaderText="Arrival Time" DataField="ArrivalTime" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ArrivalCode" SortExpression="ArrivalCode" HeaderStyle-Width="9%" HeaderText="Arrival Code" DataField="ArrivalCode" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ClearTime" SortExpression="ClearTime" HeaderStyle-Width="11%" HeaderText="Clear Time" DataField="ClearTime" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

<Rad:GridBoundColumn UniqueName="ClearCode" SortExpression="ClearCode" HeaderStyle-Width="8%" HeaderText="Clear Code" DataField="ClearCode" DataFormatString="<nobr>{0}&nbsp;</nobr>"/>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowDragToGroup="False">

 

 

 

<Resizing AllowColumnResize="True" EnableRealTimeResize="true" AllowResizeToFit="true"></Resizing>

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="100%"></Scrolling>

 

 

 

<ClientEvents OnRowContextMenu="RowContextMenu" OnRowDblClick="GridDblClick" OnRowClick="GridRowClick"></ClientEvents>

 

 

 

</ClientSettings>

 

</

 

 

Rad:RadGrid>

 


and event handler in code behind

 

 

protected void GridDispatchedStaffNeedDataSource(object sender, GridNeedDataSourceEventArgs e)

 

{

 

 

this.LoadGrid();

 

}


where

 

 

private void LoadGrid()

 

{

 

 

this.grdDispatchedStaff.DataSource = this.DataSource.DispatchAssignment;

 

}


this.DataSource is using DataSet from Session.

I have updated DataSet by adding another row and want to Rebuind Grid. The doc says I can't user bind or rebind with OnNeedDataSource. How can I refresh Grid on the page if data sourcer was changed.
Thanks.
Vladimir



Vladimir
Top achievements
Rank 1
 answered on 20 Dec 2011
4 answers
128 views
Hi,

on my web part there are some comboboxes. The comboboxes are defined in code behind (google like filtering for RadGrid).
_filterbox.EnableLoadOnDemand = true;
_filterbox.AutoPostBack = true;

When I'm clicking into a combobox and leave it without doing a selection or entering text, a postback will be rised. Why?
How can I prevent this?

I'm using the newest Telerik verion.

regards,
Ralf


Ralf
Top achievements
Rank 1
 answered on 20 Dec 2011
7 answers
242 views

Having a little trouble trying to create a dynamic button - if I add an image URL I simply get my image...

tbBtn = New RadToolBarButton
tbBtn.ImageUrl = "trans.gif"
rfeMediaManager.ToolBar.Items.Add(tbBtn)
 

As soon as I add a text value a default telerik refresh image appears...?

tbBtn = New RadToolBarButton
tbBtn.ImageUrl = "trans.gif"   
tbBtn.Text = "Standard Mode"
rfeMediaManager.ToolBar.Items.Add(tbBtn)

How can I have only my own image and text?

Ashok
Top achievements
Rank 1
 answered on 20 Dec 2011
2 answers
93 views
I have the following problem, I have this code:

<telerik:RadSplitter ID="Radsplitter5" runat="server" Height="655px" Width="100%"
            Skin="Office2010Black">
        <telerik:RadPane ID="Radpane9" runat="server" Width="215px" Scrolling="None">
           <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="FullExpandedItem"
           Skin="Office2010Black" Height="655px" Width="100%">
            <Items>
                <telerik:RadPanelItem Text="Moviles" Expanded="true" >
                    <Items>
                        <telerik:RadPanelItem Value="Moviles">
                            <ItemTemplate>
                            <asp:Panel ID="Panel1" runat="server" Height="445px" ScrollBars="Vertical">
                               <telerik:RadTreeView ID="TreeView1" CheckBoxes="true" Runat="server" TriStateCheckBoxes="true" CheckChildNodes="true" OnLoad="OnTreeLoad" OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
                OnClientContextMenuShowing="onClientContextMenuShowing" OnClientNodeClicking="onNodeClicking" OnClientNodeChecked="ClientNodeChecked" Font-Size="Smaller">
                                <ContextMenus>
                    <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server">
                        <Items>
                            <telerik:RadMenuItem Value="UltimasPosiciones" Text="Ultimas Posiciones">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Value="LimpiarPosiciones" Text="Limpiar Posiciones" Visible="false">
                            </telerik:RadMenuItem>
                        </Items>
                        <CollapseAnimation Type="none" />
                    </telerik:RadTreeViewContextMenu>
                </ContextMenus>
    </telerik:RadTreeView></asp:Panel>


I need to know how to access the treeview using javascript.
Use this, and nothing:

var tree = $find('<%=RadPanelBar1.Items[0].FindControl("Treeview1").ClientID %>');

I do not know how, thank you very much beforehand.

Greetings.
mauricio
Top achievements
Rank 1
 answered on 20 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?