Hi! We’re redesigning our web-site and replacing all our current menus and grids with your RadMenu and RadGrid. I’ve been running into a problem with the appearance of the menu, though. Even though the menu item text looks like it fits within the menu’s width, there’s usually what looks like some kind of padding at the right end of the longest menu item(s). We set the menu item color depending on the item type, but I noticed that the space is even there if I leave the skin with the default transparent settings and just hover over it. I tried setting the width settings, and, if I make them large enough, I can get it to not show that space, but, the problem with that is, we need to add the items dynamically so we don’t know how wide the menu needs to be, and we don’t want a whole lot of extra space with nothing in it.
We have the menu in a user control that we’ll add to each page. We currently have the RadMenu inside a RadSlidingPane inside a RadSlidingZone, and we add that user control to a RadPane within a RadSplitter in the pages they’re added to, but I tried doing it without the splitters, zones, and panes, and it still didn’t do it right.
I was wondering if the problem had to do with the items being adding from the code-behind page instead of from the ASPX page, but I found it did the same thing when I hard-coded them in. I’ve attached a sample image of what the menu item widths look like. If you have any suggestions on what could be changed to get the items to look right, they would be greatly appreciated! Thank you so much!
Holly
#<%= RadGrid
1
PanelClientID %>
{
margin
:
0
;
height
:
100%
;
}
Protected Sub myRadGridFin_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGridFin.ItemCreated
If TypeOf e.Item Is GridDataItem Then
Dim SendDDn As String
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim img As Image = DirectCast(item.FindControl("imgPrint"), Image)
Dim DDN As LinkButton = DirectCast(item.FindControl("lnkAdd"), LinkButton)
SendDDn = DDN.CommandArgument.ToString
"neither works"
SendDDn = DDN.Text.ToString
img.Attributes.Add("onclick", "javascript:window.open('??.aspx?DDN=" + SendDDn.ToString() & "'); return false;")
End If
End Sub
<
telerik:RadGrid
ID
=
"myRadGridFin"
runat
=
"server"
Width
=
"100%"
BorderWidth
=
"1px"
CellPadding
=
"6"
GridLines
=
"None"
BorderColor
=
"#404040"
Skin
=
"Web20"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
DataKeyNames
=
"intRecId"
Name
=
"MasterGrid"
BorderColor
=
"#404040"
Font-Size
=
"9"
Font-Names
=
"Veranda,arial,sans-serif"
HeaderStyle-HorizontalAlign
=
"Center"
GridLines
=
"Both"
BorderWidth
=
"1px"
><
AlternatingItemStyle
BackColor
=
"#B0C4DE"
HorizontalAlign
=
"Center"
/><
ItemStyle
HorizontalAlign
=
"Center"
/>
<
HeaderStyle
ForeColor
=
"White"
Font-Bold
=
"true"
BorderColor
=
"#404040"
BorderWidth
=
"1px"
/>
<
Columns
>
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
ConfirmText
=
"Are you sure you want to delete item from turn-in"
/>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:Image
ID
=
"imgPrint"
runat
=
"server"
ImageUrl
=
"~/Images/Printer.png"
style
=
"cursor:pointer"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"DDN"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkAdd"
runat
=
"server"
Text='<%# bind("strDDN") %>' ToolTip="Click to Add Equipment to Doc Number" CommandName="Add" CommandArgument='<%#Bind ("strDDN") %>'></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"CATEGORY"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblCategory"
runat
=
"server"
Text='<%# Bind("strCategory") %>'></
asp:Label
>
<
asp:Label
ID
=
"lblCatId"
runat
=
"server"
Text='<%#bind ("intCategoryId") %>' Visible="false"></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"strSN"
HeaderText
=
"SN"
/>
<
telerik:GridBoundColumn
DataField
=
"Equip"
HeaderText
=
"EQUIPMENT"
/>
<
telerik:GridBoundColumn
DataField
=
"Location"
HeaderText
=
"LOCATION"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected Sub myRadGridFin_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGridFin.ItemDataBound
If (TypeOf e.Item Is GridDataItem) Then
Dim img As Image = e.Item.FindControl("imgPrint")
Dim lnk As LinkButton = e.Item.FindControl("lnkAdd")
If lnk.Text = " " Then
img.Enabled = False
img.Visible = False
End If
End If
End Sub
radGridViewSearch = new RadGrid();
radGridViewSearch.AutoGenerateColumns = false;
radGridViewSearch.AllowPaging = true;
radGridViewSearch.PageSize = 25;
radGridViewSearch.NeedDataSource += new GridNeedDataSourceEventHandler(radGridViewSearch_NeedDataSource);
this.Controls.Add(radGridViewSearch);
GridBoundColumn colFacilityID = new GridBoundColumn();
colFacilityID.DataField = "Facility";
colFacilityID.HeaderText = "Facility";
radGridViewSearch.Columns.Add(colFacilityID);
void radGridViewSearch_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
lionRepository = new LionBCSRepository();
radGridViewSearch.DataSource = lionRepository.BuildMatterDataSet(txtMatterNameSearch.Text.Trim(), txtContractNameSearch.Text.Trim(), txtPhysicianNameSearch.Text.Trim());
}
<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="RadControlsWebApp3._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
>
press enter key when the textbox has focus with empty string.
<
telerik:RadTextBox
runat
=
"server"
ID
=
"TextBox1"
>
</
telerik:RadTextBox
>
<
telerik:RadButton
runat
=
"server"
ID
=
"Button1"
Text
=
"do not click"
UseSubmitBehavior
=
"true"
></
telerik:RadButton
>
<
asp:Label
runat
=
"server"
ID
=
"label1"
></
asp:Label
>
</
div
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidatorTextBox1"
runat
=
"server"
Display
=
"None"
SetFocusOnError
=
"true"
ErrorMessage
=
"please type anything."
ControlToValidate
=
"TextBox1"
ValidationGroup
=
"test1"
></
asp:RequiredFieldValidator
>
<
asp:ValidationSummary
ID
=
"ValidationSummarySave"
runat
=
"server"
ShowSummary
=
"false"
ShowMessageBox
=
"true"
ValidationGroup
=
"test1"
/>
</
form
>
</
body
>
</
html
>