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

We have a RadComboBox with an ItemTemplate. If we specify it like this:

            <ItemTemplate>
                <asp:Panel ID="panelMyPanel" runat="server" Height="55px" 
                    Width="100%">
                    <table align="left" cellpadding="2" cellspacing="2" class="style1">
                        <tr>
                            <td width="50%" bgcolor="#990099">
                                <asp:Label ID="Label370" runat="server"   Text="My text></asp:Label>
                            </td>
                            <td width="50%" bgcolor="#9933FF">
                                <asp:Label ID="Label370" runat="server"   Text="My text></asp:Label>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </ItemTemplate>

It will "drift" for each row (no vertical alignment) despite no text being close to long enough to fill the 50% for each column. If we change to:

            <ItemTemplate>
                <asp:Panel ID="panelMyPanel" runat="server" Height="55px" 
                    Width="600px">
                    <table align="left" cellpadding="2" cellspacing="2" class="style1">
                        <tr>
                            <td width="300px" bgcolor="#990099">
                                <asp:Label ID="Label370" runat="server"   Text="My text></asp:Label>
                            </td>
                            <td width="300px" bgcolor="#9933FF">
                                <asp:Label ID="Label370" runat="server"   Text="My text></asp:Label>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </ItemTemplate> 

It will render correctly.

Shouldn't both work and produce the same result? We prefer to specify width in % instead of PX as that will work even if page skin or similar is changed in the future. 
Ivana
Telerik team
 answered on 04 Apr 2012
8 answers
226 views
Hello,

I've successfully converted an asp:ListView with a custom Pager to the RadListView with the RadDataPager.
I've set AllowSEOPaging="true" and SEOPagingQueryPageKey="Page"

My original custom pager created a URL using UrlRewriter to something like this..:

http://www.sitename.com?DepartmentId=1&CategoryId=1&Page=2  to: 
http://www.sitename.com/Dept-Name-d1/Cat-Name-c1/Page-1/

In order to do this, I pass the querystring params to a method and it does the rewriting, in this case a method like:

currentLink.NavigateUrl = UrlClass.LinkToCategory(DepartmentId, CategoryId, PageNumber);

Unfortunately, when using the RadDataPager, it converts the intial Url that is UrlRewriten back to a dynamic one.
I have created the following in the PreRender event of the RadDataPager and tested it with static values and it works.
protected void RadDataPager1_PreRender(object sender, EventArgs e) 
{ 
   RadDataPager dataPager = (RadDataPager)lvwProducts.FindControl("RadDataPager1"); 
 
   foreach (Control control in dataPager.Controls) 
   { 
      foreach (Control c in control.Controls) 
      { 
         if (c is HyperLink) 
         { 
            HyperLink currentLink = (HyperLink)c; 
            currentLink.NavigateUrl = UrlClass.LinkToCategory("1", "1", "2"); // <--- This rewrites properly.
            // TODO: Put Page Command Value into PageNumber parameter.
            currentLink.NavigateUrl = UrlClass.LinkToCategory(DepartmentId, CategoryId, PageNumber); 
         } 
      } 
   } 
} 

My question is how can I access the DataPager commands (First, Last, Previous, Next, etc..) to pass as a parameter for the PageNumber in the above method?

Thank you,
Ronnie
Tsvetina
Telerik team
 answered on 04 Apr 2012
1 answer
112 views
Hi,
I have some problem with MDI windows.
In IE9 a opened window appears above a div (restricion zone, with red border - see screen please).
In IE8 everything is ok.
My code to open window:
...
var wnd = manager.open(url, name);
      
var browserWin = wnd.BrowserWindow;
 var fResize = new browserWin.Function("sender", "args", "OnClientResize(sender,args);");
 wnd.add_resize(fResize);
 var fEndDrag = new browserWin.Function("sender", "args", "OnClientDragEnd(sender,args);");
 wnd.add_dragEnd(fEndDrag);     
 if (cookie_max == 1 || cookie_max == "1") wnd.Maximize();
I'm using Telerik 2010.1.415.20.
My div (restricion zone) doesn't have width and height.
Where is a problem?
Thanks.

UPDATE: When div has width and height - window shows in proper way. But I don't want to specify size of restrict zone.
Marin Bratanov
Telerik team
 answered on 04 Apr 2012
3 answers
291 views
Hello Telerik Team,
I have a little problem with highlighting the selected day in the month view. I know there is a kb article which describes how to highlight the selected day in the month view.
My problem is, when I use a handler for the TimeSlotCreated event, like

void OTRadScheduler_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{
   if (e.TimeSlot.Start.Date == OTRadScheduler.SelectedDate)
   {
        e.TimeSlot.CssClass = "rsSelectedSlot";
   }
   else
   {
        // if the actuale date of the time slot is not the selected date, check if the rsSelectedSlot css class is set, if so delete it
        if (string.Compare(e.TimeSlot.CssClass, "rsSelectedSlot") == 0)
        {
            e.TimeSlot.CssClass = "";
        }
    }
}

and the RadScheduler control starts with the month view, the selected date will be displayed correctly (for example with a green background for the Web2.0 skin.

But if I change now to the day view and use the navigation controls in the header to go forward one day and afterwards change back to the month view, at first glance the new selected day will be displayed with the css class above. But if I select now a new day in the month view, then the new day will be displayed with the above css class (which is correct) BUT THE FORMER day which was set to this class after the view change still is displayed with the new css class. So I get two highlighted days, as long as I do not select the former selected day.

As I understand it, if in the month view a day is selected with a single click (inserting of new days only with double clicks), the java script methods of the scheduler control take care of unselecting all days and selecting the new one, i.e. these methods change the css class of the former selected day (tested it with the firefox web debugger). But if the css class of a time slot item is set in the code behind using the handler, this day is not unselected by the java script methods when a new day is selected.

I hope you have some ideas,
Richard.
Richard
Top achievements
Rank 1
 answered on 04 Apr 2012
1 answer
97 views
Hi,

I create a new skin with stylebuilder.telerik.com, the new dropdown button is wider then others telerik buttons, the stylebuider don´t make the normal button wider I need include the width, height and padding-left at div.RadComboBox_BN table td.rcbArrowCell  and .RadComboBox_BN td.rcbArrowCell with the same value using at style builder arrow box.

Now the button is wider, but is a "leak" event at the begin button, for exemple if I click between first pixel until the middle the drop down not fired. The dropdow fired only at the middle to end.

The .aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default1.aspx.vb" Inherits="Default3" %><br><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head runat="server"><br>    <title></title><br>    <link href="Skin/BN/ComboBox.BN.css" rel="stylesheet" type="text/css" /><br></head><br><body><br>    <form id="form1" runat="server"><br>    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"><br>        <Scripts><br>            <asp:ScriptReference Assembly="Telerik.Web.UI" <br>                Name="Telerik.Web.UI.Common.Core.js"><br>            </asp:ScriptReference><br>            <asp:ScriptReference Assembly="Telerik.Web.UI" <br>                Name="Telerik.Web.UI.Common.jQuery.js"><br>            </asp:ScriptReference><br>            <asp:ScriptReference Assembly="Telerik.Web.UI" <br>                Name="Telerik.Web.UI.Common.jQueryInclude.js"><br>            </asp:ScriptReference><br>        </Scripts><br>    </telerik:RadScriptManager><br>    <div><br>        <telerik:RadComboBox ID="RadComboBoxPeriodo1" Runat="server" EnableEmbeddedSkins="False" skin="BN" ShowDropDownOnTextboxClick ="true">                    <br>        </telerik:RadComboBox><br>    </div><br>    </form><br></body><br></html><br>

The .css
/* RadComboBox Simple skin */<br><br>/*global*/<br><br>.RadComboBox_BN,<br>.RadComboBox_BN .rcbInput,<br>.RadComboBoxDropDown_BN<br>{<br>    font: 12px "Segoe UI", Arial, sans-serif;<br>    color: #333;<br>}<br><br>/* combobox */<br><br>div.RadComboBox_BN table td.rcbInputCell<br>{<br>    height: 18px;<br>    line-height: 18px;<br>    border: solid #616161;<br>    background: #fff;<br>}<br><br>* html div.RadComboBox_BN table td.rcbInputCell<br>{<br>    height /**/: 20px;<br>    line-height /**/: 20px;<br>}<br><br>div.RadComboBox_BN table td.rcbInputCellLeft { border-width: 1px 0 1px 1px; }<br>div.RadComboBox_BN table td.rcbInputCellRight { border-width: 1px 1px 1px 0; }<br><br>* html div.RadComboBox_BN .rcbInputCell .rcbInput<br>{<br>    height /**/: 16px;<br>    padding /**/: 2px 0; /* This should fix the ajax introduced height in IE7 and not break IE6 */<br>}<br><br>.RadComboBox_BN .rcbInputCell .rcbEmptyMessage<br>{<br>    color: #666;<br>}<br><br>.RadComboBox_BN .rcbHovered .rcbInputCell .rcbInput,<br>.RadComboBox_BN .rcbFocused .rcbInputCell .rcbInput { color: #882501; }<br><br>div.RadComboBox_BN .rcbReadOnly .rcbArrowCellLeft,<br>div.RadComboBox_BN .rcbArrowCellHidden.rcbArrowCellLeft { border-width: 1px 0 1px 1px; }<br>div.RadComboBox_BN .rcbReadOnly .rcbArrowCellRight,<br>div.RadComboBox_BN .rcbArrowCellHidden.rcbArrowCellRight { border-width: 1px 1px 1px 0; }<br><br>div.RadComboBox_BN table td.rcbArrowCell<br>{<br>    border: 1px solid #616161;<br>    background: #fff url('ComboBox/rcbSprite.png') no-repeat -1px 50%;<br>    width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>}<br><br>.RadComboBox_BN td.rcbArrowCell { <br>    background-position: -1px 50%; <br>    width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>    }<br><br>.RadComboBox_BN .rcbHovered .rcbArrowCell { background-position: -35px 50%; }<br>.RadComboBox_BN .rcbFocused .rcbArrowCell { background-position: -69px 50%; }<br>.RadComboBox_BN .rcbDisabled .rcbArrowCell { background-position: -1px 50%; }<br><br>.RadComboBox_BN .rcbReadOnly td.rcbArrowCell { background-position: -2px 50%; }<br>.RadComboBox_BN .rcbHovered .rcbReadOnly .rcbArrowCell { background-position: -36px 50%; }<br>.RadComboBox_BN .rcbFocused .rcbReadOnly .rcbArrowCell { background-position: -70px 50%; }<br>.RadComboBox_BN .rcbDisabled .rcbReadOnly .rcbArrowCell { background-position: -2px 50%; }<br><br>.RadComboBox_BN td.rcbArrowCellHidden,<br>.RadComboBox_BN .rcbHovered td.rcbArrowCellHidden,<br>.RadComboBox_BN .rcbFocused td.rcbArrowCellHidden,<br>.RadComboBox_BN .rcbReadOnly td.rcbArrowCellHidden,<br>.RadComboBox_BN .rcbHovered .rcbReadOnly .rcbArrowCellHidden,<br>.RadComboBox_BN .rcbFocused .rcbReadOnly .rcbArrowCellHidden,<br>.RadComboBox_BN .rcbDisabled .rcbReadOnly .rcbArrowCellHidden,<br>.RadComboBox_BN table.rcbDisabled td.rcbArrowCellHidden { background: none; }<br><br><br>.RadComboBox_BN .rcbHovered .rcbArrowCell,<br>.RadComboBox_BN .rcbHovered .rcbReadOnly .rcbInputCell,<br>.RadComboBox_BN .rcbHovered .rcbReadOnly .rcbArrowCellHidden { background-color: #ffe79c; }<br>.RadComboBox_BN .rcbFocused .rcbArrowCell,<br>.RadComboBox_BN .rcbFocused .rcbReadOnly .rcbInputCell,<br>.RadComboBox_BN .rcbFocused .rcbReadOnly .rcbArrowCellHidden { background-color: #ffa517; }<br><br>div.RadComboBox_BN .rcbHovered .rcbArrowCell,<br>div.RadComboBox_BN .rcbHovered .rcbInputCell { border-color: #c98400; }<br>div.RadComboBox_BN .rcbFocused .rcbArrowCell,<br>div.RadComboBox_BN .rcbFocused .rcbInputCell { border-color: #ca4b0c; }<br>div.RadComboBox_BN .rcbDisabled .rcbArrowCell,<br>div.RadComboBox_BN .rcbDisabled .rcbInputCell { border-color: #b0b0b0; }<br><br>div.RadComboBox_BN .rcbArrowCell a<br>{<br>    height: 20px;<br>}<br><br>div.RadComboBox_BN td.rcbArrowCellHidden,<br>div.RadComboBox_BN .rcbArrowCellHidden a<br>{<br>    width: 1px;<br>}<br><br>div.RadComboBox_BN td.rcbArrowCellHidden.rcbArrowCellRight<br>{<br>    border-left: 0;<br>}<br><br>/* Read-only styles */<br><br>/* dropdown */<br><br>.RadComboBoxDropDown_BN<br>{<br>    background: #fff;<br>    border-color: #616161;<br>}<br><br>.RadComboBoxDropDown_BN .rcbHeader,<br>.RadComboBoxDropDown_BN .rcbFooter<br>{<br>    background: #e4e4e4;<br>    color: #000;<br>}<br><br>.RadComboBoxDropDown_BN .rcbHeader<br>{<br>    border-bottom-color: #7c7c7c;<br>}<br><br>.RadComboBoxDropDown_BN .rcbFooter<br>{<br>    border-top-color: #7c7c7c;<br>}<br><br>.RadComboBoxDropDown_BN .rcbItem em<br>{<br>    background: #e5e5e5;<br>}<br><br>div.RadComboBoxDropDown_BN .rcbHovered<br>{<br>    background: #ffe79c;<br>    color: #882501;<br>    border: 1px solid #c98400;<br>    padding: 1px 5px;<br>}<br><br>.RadComboBoxDropDown_BN .rcbCheckAllItems,<br>.RadComboBoxDropDown_BN .rcbCheckAllItemsHovered {<br>    color: #000000;<br>    background-color: #ffe79c;<br>}<br>.RadComboBoxDropDown_BN .rcbCheckAllItemsHovered {<br>    color: #000000;<br>}<br><br>.RadComboBoxDropDown_BN .rcbSeparator<br>{<br>    color: #fff;<br>    background: #8a8a8a;<br>}<br><br>.RadComboBox_BN .rcbDisabled .rcbInputCell .rcbInput,<br>.RadComboBoxDropDown_BN .rcbDisabled<br>{<br>    color: #787777;<br>}<br><br>.RadComboBoxDropDown_BN .rcbLoading<br>{<br>    background: #f0f0f0;<br>}<br><br>.RadComboBoxDropDown_BN .rcbMoreResults<br>{<br>    border-top-color: #c3c3c3;<br>    background: #e4e4e4;<br>    color: #8a8a8a;<br>}<br><br>.RadComboBoxDropDown_BN .rcbMoreResults a<br>{<br>    background: url('ComboBox/rcbSprite.png') no-repeat -1px -85px;<br>}<br><br> div.RadComboBox_BN .rcbArrowCell {<br>    background-position: -1px 50%;<br>    width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>}<br><br> div.RadComboBox_BN .rcbHovered .rcbArrowCell {<br>    width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>    background-position: -35px 50%;<br>}<br><br> div.RadComboBox_BN .rcbFocused .rcbArrowCell {<br>     width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>    background-position: -69px 50%;<br>}<br><br> div.RadComboBox_BN .rcbDisabled .rcbArrowCell {<br>     width: 30px;<br>    height: 33px;<br>    padding-left: 15px;<br>    background-position: -1px 50%;<br>}<br><br><br><br>
Dimitar Terziev
Telerik team
 answered on 04 Apr 2012
1 answer
161 views
Hi,

I am trying to use the radfilter as a rules engine, where the user can create expression and check whether the object properties matches whats been defined in the radfilter.

Is it possible to apply the radfilter expression against an collection or a single object.

Say I have a user class with the following properties.

Id
Name
DateOfBirth
Age ( Calculated from DateOfBirth)

I want to build the expression Age > 18 and apply it against the List<User> or even an User object.

Thanks

Tsvetina
Telerik team
 answered on 04 Apr 2012
1 answer
353 views
Hi,
I have
 a combobox with a treeview ( checkbox activated). My problem is when a user selects multiple items he has to click somewhere on the page to exit the combobox, which is not very practical.
can I have two buttons "OK" "Cancel" in the combox? Something like that :
http://www.hostingpics.net/viewer.php?id=326557ButtoninCombo.png  

Thank you very much. 


Princy
Top achievements
Rank 2
 answered on 04 Apr 2012
2 answers
114 views
Can we have 3d look of rad grid rows. 
and can we have two column view for rad grid rows. and have drag and drop feature with in grid columns. and rows.

Please find sample file attached.

Thanks and Regards
raman singla


Tsvetina
Telerik team
 answered on 04 Apr 2012
3 answers
300 views
Hi,
I want to dynamically insert a table in  the cells of a Grid Column.
Please tell me how can this be done on item_bound event ?

below is the designer code of the grid.

<

 

 

telerik:RadGrid AutoGenerateColumns="False" ID="RadGridAssignment" AllowFilteringByColumn="False"

 

 

 

AllowSorting="True" PageSize="50" ShowFooter="False" AllowPaging="True" runat="server"

 

 

 

EnableLinqExpressions="False" EnableHeaderContextMenu="False" EnableHeaderContextFilterMenu="False"

 

 

 

OnDeleteCommand="RadGridAssignment_DeleteCommand" OnNeedDataSource="RadGridAssignment_NeedDataSource"

 

 

 

OnItemDataBound="RadGridAssignment_ItemDataBound" OnItemCreated="RadGridAssignment_ItemCreated"

 

 

 

OnCancelCommand="RadGridAssignment_CancelCommand" ShowGroupPanel="True" OnItemCommand="RadGridAssignment_ItemCommand"

 

 

 

OnUpdateCommand="RadGridAssignment_UpdateCommand" OnPreRender="RadGridAssignment_PreRender"

 

 

 

EnableEmbeddedSkins="True" EnableTheming="True" Skin="Office2007" GridLines="None"

 

 

 

HeaderStyle-HorizontalAlign="Left" HorizontalAlign="Center">

 

 

 

<MasterTableView AllowFilteringByColumn="False" AllowSorting="True" AllowMultiColumnSorting="True"

 

 

 

AllowPaging="True" TableLayout="Auto" CommandItemDisplay="Top" InsertItemDisplay="Top"

 

 

 

Dir="LTR" EditMode="EditForms" DataKeyNames="ObjectId,ParentObjectId,AssignmentId"

 

 

 

GridLines="None" EnableTheming="True">

 

 

 

<HeaderStyle Font-Bold="true" />

 

 

 

<CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="false" AddNewRecordText=""

 

 

 

AddNewRecordImageUrl="~/client/Images/Edit.gif" />

 

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="ImageButton" EditImageUrl="~/client/Images/Edit.gif"

 

 

 

EditText="Edit" ItemStyle-Width="20" HeaderStyle-Width="35">

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

<telerik:GridButtonColumn CommandName="Delete" ImageUrl="~/client/Images/Delete.gif"

 

 

 

ButtonType="ImageButton" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

 

 

 

Text="Delete" UniqueName="Delete" ItemStyle-Width="20" HeaderStyle-Width="35">

 

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridBoundColumn DataField="ObjectName" HeaderText="ObjectName" SortExpression="ObjectName"

 

 

 

UniqueName="ObjectName">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="AssessorName" HeaderText="Assessor" SortExpression="AssessorName"

 

 

 

UniqueName="AssessorName">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Reviewer1" HeaderText="ReviewerLevel1" SortExpression="ReviewerLevel1"

 

 

 

UniqueName="Reviewer1">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Reviewer2" HeaderText="ReviewerLevel2" SortExpression="ReviewerLevel2"

 

 

 

UniqueName="Reviewer2">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Reviewer3" HeaderText="ReviewerLevel3" SortExpression="ReviewerLevel3"

 

 

 

UniqueName="Reviewer3">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Reviewer4" HeaderText="ReviewerLevel4" SortExpression="ReviewerLevel4"

 

 

 

UniqueName="Reviewer4">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Reviewer5" HeaderText="ReviewerLevel5" SortExpression="ReviewerLevel5"

 

 

 

UniqueName="Reviewer5">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn UniqueName="ParentObjectName" DataField="ParentObjectName"

 

 

 

GroupByExpression="ParentObjectName Group By ParentObjectName " Visible="false">

 

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="ParentObjectTypeId" UniqueName="ParentObjectTypeId"

 

 

 

Visible="false">

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

Tsvetina
Telerik team
 answered on 04 Apr 2012
0 answers
82 views
Hi,

I'm using javascript to dynamically bind data to data source on text change of a rad text box  to display search results. Every thing works find except for when I get to the data bind it throws the following error: "Microsoft JScript runtime error: Unable to get value of the property 'indexOf': object is null or undefined" Through debug mode I can see that I am getting the results I want from the database but binding is giving me a problem that I unable to solve so far. Here is the code:
function SearchValueChanged(sender, args) {
 
       InvoiceWebService.SearchInvoice(3, 36, updateGrid, OnFail);
       return false;
   }
   function OnFail(result) {
       alert(result);
   }
   function updateGrid(result) {
 
       var tableView = $find("<%= grdInvoices1.ClientID %>").get_masterTableView();
       tableView.set_dataSource(result);
       tableView.dataBind();
 
   }
Thanks,
Ron
Ron
Top achievements
Rank 1
 asked on 04 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?