Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
609 views
I've configured a RadListBox such that it displays different RadListBoxItems with different background colors depending on various criteria.  That all works fine.

When a RadListBoxItem is single-clicked upon then it currently changes to a blue background color; this is accomplished with the ".rlbSelected" CSS property.  However, users are finding this confusing and would prefer that the original color be preserved.  So instead I would like to change the Border of the SelectedItem to a thicker one.  This is easy to accomplish but unfortunately the background color changes to the default grey.

Keeping in mind that I need to preserve the original background color, how would I accomplish this thickening of the border?

Robert
Kate
Telerik team
 answered on 13 Feb 2013
2 answers
60 views
Hi,

onFileSelected
  • get_row returns the row containing the file input field for the file that was just selected (<LI> element)

<LI></LI> contain selected file info.
How to obtain ID of a LI element containing a selected file info on IE9.
Code below works on FireFox but it doesn't work on IE9.

       function RadAsyncUpload1_FileSelected(sender, args) {
            var row = args.get_row();             var el = $(pRow);             var rowId = el.attr('id'); }

Thank you in advance.
Denius Valiant
Top achievements
Rank 1
 answered on 13 Feb 2013
1 answer
102 views
Hi
     I have set allow filteringbycolumn to true in my radgrid. I also have a gridcheckboxcolumn in my radgrid alongwith some boundcolumns. But I dont want to filter the checkboxcolumn. How can I avoid the specific column filter.
thanks 4 your help

Allen
Princy
Top achievements
Rank 2
 answered on 13 Feb 2013
2 answers
61 views
Hi
how do i get  the value of a column in Edit linkbutton click.


<telerik:GridTemplateColumn DataField="Edit" UniqueName="Edit" SortExpression="Edit"
                                                    HeaderText="Edit">
                                                    <HeaderTemplate>
                                                        Edit</HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbEdit" runat="server" Font-Underline="True" ForeColor="Black"
                                                            Text="Edit" OnClick="OpenPopup"></asp:LinkButton></ItemTemplate>
                                                </telerik:GridTemplateColumn>


OpenPopup() - this is function i have written in code behind and here i wanted to get the  cell text of first cell(Name column)

Thanks
San
                   
San
Top achievements
Rank 1
 answered on 13 Feb 2013
3 answers
809 views
Hi telerik,

I am experiencing strange behavior from  RadComboBox located inside Radgrid's edit form template.
My dropdown is populated with the list of countries.  I defined autopostback="true" and OnSelectedIndexChanged server side event for this dropdown.  
Also, I defined client side onChange event for the same dropdown throught code behind. My client side (javascript) function looks for another dropdown
inside the same edit form template and selects its value based on some logic:  

    function ddlShipToCountry_OnChange(ddlShipToLocationsClientID) {
            setLocationToOTHER(ddlShipToLocationsClientID);
        }

    function setLocationToOTHER(ddlShipToLocationsClientID) {
            var ddlShipToLocations = $find(ddlShipToLocationsClientID);
            if (ddlShipToLocations) {
                var item = ddlShipToLocations.findItemByValue("OTAD|");
                if (item) { item.select(); }
            }
        }

The issue manifests itself, whenever user presses a letter while dropdown list of values is expanded,
the expected behavior is that focus shifts to the first value that starts with such a letter,
however my dropdown instead, does a postback (I guess because client side function has item.select() statement,
and hence resets itself, which I think is not expected behavior.  I expected postback to happen when the value is actually selected from the dropdown,
and I thought that client side function should fire when the selected value actually was changed not when user presses a letter to get to the values that
start with this letter.

Can you please help me and provide any ideas what could be changed in order to make this control work as I expect.
Bellow is the code snapshots:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddlSpecLIShipping.ascx.cs" 
    Inherits="AddlSpecLIShipping" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy42" runat="server"> 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
        <telerik:AjaxSetting AjaxControlID="chkShippFullQty"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="chkShippFullQty"/> 
                <telerik:AjaxUpdatedControl ControlID="pnlLIShippingDetails"/> 
            </UpdatedControls> 
        </telerik:AjaxSetting>         
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" EnableEmbeddedSkins="false" 
    Skin="AsiSkin" DecoratedControls="CheckBoxes" /> 
     
<telerik:RadScriptBlock ID="rdScriptLIShipping" runat="server"> 
    <script language="javascript" type="text/javascript"> 
         function ddlShipToCountry_OnChange(ddlShipToLocationsClientID) { 
            setLocationToOTHER(ddlShipToLocationsClientID); 
        } 
         
         function setLocationToOTHER(ddlShipToLocationsClientID) { 
            var ddlShipToLocations = $find(ddlShipToLocationsClientID); 
            if (ddlShipToLocations) { 
                var item = ddlShipToLocations.findItemByValue("OTAD|"); 
                if (item) { item.select(); } 
            } 
        } 
     </script> 
</telerik:RadScriptBlock>    
 
 <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" Width="100%" AllowAutomaticUpdates="false" 
    AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AutoGenerateColumns="False" 
    AllowPaging="true" AllowMultiRowEdit="false" Skin="AsiSkin" CssClass="AsiGreenCommandBar" 
    EnableEmbeddedSkins="False" ShowFooter="true" OnPreRender="RadGrid1_PreRender" 
    PageSize="6" 
    OnNeedDataSource="RadGrid1_OnNeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound" 
    OnInsertCommand="RadGrid1_OnInsertCommand" OnDeleteCommand="RadGrid1_OnDeleteCommand"  
    OnUpdateCommand="RadGrid1_OnUpdateCommand"> 
    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" /> 
     
    <MasterTableView Width="100%" ShowHeadersWhenNoRecords="true" CommandItemDisplay="bottom" 
                EditMode="EditForms" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                DataKeyNames="DestinationID"> 
                 
                <Columns> 
                 ......... 
                 ........ 
                 </Columns> 
                  <EditFormSettings EditFormType="Template"> 
                    <FormTemplate> 
                     ......... 
                     ......... 
                    <telerik:RadComboBox ID="ddlShipToCountry" runat="server" Skin="AsiSkin" CssClass="AsiRounded" 
                                        EnableEmbeddedSkins="false" AutoPostBack="true" DataTextField="CountryDisplayName" 
                                        DataValueField="Country_CD" OnSelectedIndexChanged="ddlShipToCountry_SelectedIndexChanged" 
                                        Width="220px" Height="100px"> 
                    </telerik:RadComboBox>  
                    </FormTemplate> 
                </EditFormSettings> 
            <CommandItemSettings AddNewRecordText="Add Another Destination" /> 
    </MasterTableView> 
 </telerik:RadGrid> 
  

And CS code:
    private void SetGridChildControlsClientEvents(GridEditableItem item) 
    { 
         .......... 
         .......... 
         RadComboBox cntrlShipToLocations = base.GetControlFromRadGridEditFormTemplate(item, "ddlShipToLocations") as RadComboBox; 
         RadComboBox cntrlShipToCountry =  base.GetControlFromRadGridEditFormTemplate(item, "ddlShipToCountry") as RadComboBox; 
 
         cntrlShipToCountry.Attributes.Add("OnChange", "return ddlShipToCountry_OnChange('" + cntrlShipToLocations.ClientID + "');"); 
} 



Princy
Top achievements
Rank 2
 answered on 13 Feb 2013
1 answer
184 views
Hi
I have looked for a while now but have not come accross the same situation.
I have a grid with one Static Column and then other columns are generated when laoding the Datasource.

I would like to create a Custom Edit Template  acording to the data returned for each column as the number of columns can change.

Here is my RadGrid
<telerik:RadGrid ID="rgTVMTimes" runat="server" GridLines="None" OnItemCreated="rgCoinBox_ItemCreated"
              AllowMultiRowEdit="True" OnPreRender="rgTVMTimes_PreRender" OnColumnCreated="rgTVMTimes_ColumnCreated"
              OnItemDataBound="rgCoinBox_ItemDataBound" OnItemCommand="rgCoinBox_ItemCommand">
              <MasterTableView EditMode="InPlace" CommandItemDisplay="None" CommandItemStyle-HorizontalAlign="Right">
                <Columns>
                  <telerik:GridBoundColumn DataField="Heading" HeaderText="" ItemStyle-BackColor="LightGray"
                    SortExpression="Heading" UniqueName="Heading1" ReadOnly="true">
                      <filtertemplate>
                          <RadTimePiker ID="TVMTime"></RadTimePiker>
                      </filtertemplate>
                      <ItemStyle BackColor="LightGray" />
                  </telerik:GridBoundColumn>
                </Columns>
                <RowIndicatorColumn>
                  <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                  <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <NoRecordsTemplate>
                  <p>
                    No TVM Machines found.
                  </p>
                  <p>
                    Choose new Location and try again.
                  </p>
                </NoRecordsTemplate>
                  <commanditemstyle horizontalalign="Right" />
              </MasterTableView>
            </telerik:RadGrid>
I have 2 of these grids.
I have defined The dataSource as a Select Query from the database to simplify the Data Transfer to the table.
rgTVMTimes.DataSource = new TVMCashUp().GetTvmMachineTimesGrid(_userInfo.StationID,"TVM Time");
 rgTVMTimes.DataBind();
rgTVMTimes.Rebind();
 
 
rgLogCash.DataSource = new TVMCashUp().GetTvmMachineTimesGrid(_userInfo.StationID, "Log Cash Review");
           rgLogCash.DataBind();
           rgLogCash.Rebind();
public DataTable GetTvmMachineTimesGrid(int inLocationid,string grid)
        {
            return DataMethods.ReturnMultipleRowResultSet("[HO].[GetTvmMachineTimesGrid]", inLocationid,grid);
        }
The one grid's Data is DBType.Bit valueTypes and the other a DBType.Time ValueType.
Here are the data returned by the query
Heading     TVM1        TVM2        TVM3        TVM4        TVM5        TVM6        TVM7
TVM Time    16:10:10    16:10:10    16:10:10    16:10:10    16:10:10    16:10:10    16:10:10

Heading            TVM1    TVM2    TVM3   TVM4   TVM5   TVM6    TVM7
Log Cash Review    0       0       0      0      0      0       0

I Would like to create a Yes No Radio Selection for the DBType.Bit grid and RadTimePiker for the DBType.Time Data.
I have found that when the data is in: 
    - a DBType.Date a datepicker is autogenerated. 
    - a DBType.Decimal a RadNumericTextbox is autogenerated.
    - a DBType.varchar a RadTextbox is autogenerated.

But I need these custom controls.

Is there a way I can create these templates. I edit the items inline.

Thanks in advance

Shinu
Top achievements
Rank 2
 answered on 13 Feb 2013
1 answer
146 views
How do i add one more text box to "New Folder" dialog?
Dobromir
Telerik team
 answered on 13 Feb 2013
4 answers
125 views
For some reason the grouping text is not aligned properly and I can't figure out why. The text is shifting up. I attached an image of what is happening, and here is the grid definition for the first grid. Can someone please advise on what I can do? Thanks!

<telerik:RadGrid ID="rgSelections" runat="server" AllowPaging="False" AllowSorting="False"
                        AllowMultiRowSelection="false" AutoGenerateColumns="False"
                        HorizontalAlign="NotSet" AllowAutomaticDeletes="False" AllowAutomaticInserts="False"
                        AllowAutomaticUpdates="false" AllowFilteringByColumn="false" ShowGroupPanel="False"
                        Skin="Metro" Height="800">
                        <ClientSettings ReorderColumnsOnClient="false" AllowDragToGroup="false" AllowColumnsReorder="false"
                            AllowRowsDragDrop="false">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="800px">
                            </Scrolling>
                            <Selecting AllowRowSelect="true"></Selecting>
                            <Resizing AllowRowResize="False" AllowColumnResize="False" EnableRealTimeResize="False">
                            </Resizing>
                            <ClientEvents OnRowMouseOver="onRowMouseOver" />
                        </ClientSettings>
                        <MasterTableView DataKeyNames="SlotCode" GridLines="None" AllowMultiColumnSorting="True"
                            AutoGenerateColumns="False" HorizontalAlign="NotSet" CommandItemDisplay="Top"
                            GroupLoadMode="Client">
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="ClassDate" FieldName="ClassDate" FormatString="{0:dddd MMMM d}"
                                            HeaderText="Date"></telerik:GridGroupByField>
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldName="ClassDate" SortOrder="Ascending"></telerik:GridGroupByField>
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="ClassDate" SortExpression="ClassDate" HeaderText="Date"
                                    DataField="ClassDate" DataFormatString="{0:M/dd}" Display="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="StartTime" SortExpression="StartTime" HeaderText="Start"
                                    DataField="StartTime" DataFormatString="{0:hh:mm tt}" ItemStyle-Width="60px"
                                    HeaderStyle-Width="60px" ItemStyle-Wrap="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="ClassTitleFull" SortExpression="ClassTitleFull"
                                    HeaderText="Class" DataField="ClassTitleFull" ItemStyle-Width="100%" HeaderStyle-Width="100%">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="Seg" SortExpression="Seg" HeaderText="Segment"
                                    DataField="Seg" ItemStyle-Width="60px" HeaderStyle-Width="60px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="ClassSchedulingID" DataField="ClassSchedulingID"
                                    SortExpression="ClassSchedulingID" UniqueName="ClassSchedulingID" Display="False">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="SlotCode" SortExpression="SlotCode" HeaderText="SlotCode"
                                    DataField="SlotCode" Display="False">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn UniqueName="Remove" CommandName="Remove" ButtonType="ImageButton"
                                    ImageUrl="images/delete.gif" ItemStyle-Width="30px" HeaderStyle-Width="30px">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <ExpandCollapseColumn Resizable="False" Visible="False">
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <RowIndicatorColumn ItemStyle-Width="0px" HeaderStyle-Width="0px" />
                            <CommandItemTemplate>
                            </CommandItemTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
Kostadin
Telerik team
 answered on 13 Feb 2013
1 answer
142 views
How do I customize File Explorer's  AsyncFileUpload to show only one Add button?
Also how do i add checkbox and combobox to it?
I am customizing it for giving permissions.
Dobromir
Telerik team
 answered on 13 Feb 2013
4 answers
289 views
I've got a problem with refers back to:  "Chart is Disappearing"  http://www.telerik.com/community/forums/aspnet-ajax/htmlchart/chart-is-disappearing.aspx

I'm no longer utilizing an UpdatePanel for the ajax.  Instead, I'm utilizing the ajax manager on separate zones and radajaxpanels within the content templates of each dock.

Oddly, the RadHTMLChart vanishes (and can not be found through javascript) when it moves to the other of two zones.  In the first zone it loads fine, but in the second it will not.  If moved back to the first, it loads properly again.

Could this be a dom hierarchy issue?
Marin Bratanov
Telerik team
 answered on 13 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?