Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
190 views

I have created a RadGrid.  Here is the steps I used to create it and then remove all the rows (I just want the header - details why below)

I clear the rows in the datatable that I bind to the grid

I set the RadGrid datasource = to that blank datatable

I then bind

I also set the NoDetailRecordsText = "" and NoMasterRecordsText = ""

I have column headers that are dates (1/12 for example) and each day they change.  Those are in the middle of the columns.  All the other columns have named headers I know about (except the dates)

Column layout

Hardware Model 1/2  1/3  1/4 Col1 Col2 etc.

I need to set all the columns to a value (only way i know to set those date ones but code I have tried does not work) in ItemCreated event

For Each col As GridColumn In grdHeader.MasterTableView.Columns                 

     col.HeaderStyle.Width = "60"             'Never gets to this

Next

then go and set the rest of the column widths (this seems to work)

Dim gridCol As GridColumn             

gridCol = grdHeader.MasterTableView.GetColumn("Model")        

gridCol.HeaderStyle.Width = "140"

The reason I need to do this is we have scrolling RadGrids per group and I want to keep the header above the scrolling section as when it scrolls each header for each grid goes away and you have no clue what cols go with what data.

I hope this give enough to hopefully point me in the right direction.

I appreciate any help

Mark
Top achievements
Rank 1
 answered on 27 Feb 2017
0 answers
100 views

Hello,

How add style for first item in RadComboBox on the side server?How get first element RadComboBox, element type input ?

protected void ValidationSections()
{

     if (RadComboBox.Text == "")
     {
         RadComboBox.Style.Add("background", "#F7FAA5 !important;"); //not working
         RadComboBoxItem item = RadComboBox.DataValueField(""); // error Non-invocable member '.../DataValueField' cannot be used like a method
         MainContent_RadComboBox_Input.Style.Add("background", "#F7FAA5 !important;"); //  MainContent_RadComboBox_Input.Style not exist in the current context
     }
}

Please help me.

Grzegorz
Top achievements
Rank 1
 asked on 27 Feb 2017
0 answers
126 views

Hello,

This is my code:

 

<telerik:RadTileList ID="elmHomeTileList" CssClass="responsiveWidth" runat="server" Skin="Telerik" EnableDragAndDrop="true" OnTileClick="elmHomeTileList_TileClick" AutoPostBack="true"
        SelectionMode="None" ScrollingMode="Accelerated" TileRows="1">
        <Groups>
            <telerik:TileGroup>

  <telerik:RadContentTemplateTile ID="tileService" runat="server" Shape="Wide" CssClass="tile-services" OnClick="tileService_Click" Selected="false">
                    <ContentTemplate>
                        <div class="pull-left">
                            <%--<a href='javascript:void(0)' onclick="doSomeWork(1)">
                                <span class="glyphicon glyphicon-plus tile-plus noTileDrag" aria-hidden="true"></span>
                            </a>--%>
                            <button >Hello</button>
                           <asp:LinkButton ID="LinkButton1" runat="server" OnClick="Unnamed_Click" Text="Click Me" />
                           
                         <asp:Button ID="Button1" runat="server" OnClick="Unnamed_Click" Text="Click Me2" />
                            <a href="<%=ResolveUrl("~/Admin/AddService/")%>">
                                <span class="glyphicon glyphicon-plus tile-plus" aria-hidden="true"></span>
                            </a>
                        </div>

                        <img src="Images/Icons/Toolbars/alert.png" class="tile-image pull-left tile-image-plus" />
                        <div class="right-border"></div>

                        <div class="right-number">
                            43
                        </div>

                        <div class="right-text">
                            services
                        </div>
                    </ContentTemplate>                    
                </telerik:RadContentTemplateTile>

 </telerik:TileGroup>
        </Groups>
    </telerik:RadTileList>

 

This is my backend code super simple:

 

 protected void Unnamed_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/AddService/");
        }

        protected void tileService_Click(object sender, EventArgs e)
        {

        }

        protected void elmHomeTileList_TileClick(object sender, TileListEventArgs e)
        {

        }

 

The problem here is when I click either LinkButton or Button it never hits the break point in Unnamed_Click. It only goes to tileService_Click and elmHomeTileList_TileClick. Is there anyway I could stop this control from doing this since I want that the tile click should go a URL but I also want that clicking a specific link button should go to that desired URL.

This is server side but I tried posting simple HTML anchor tag as well like

<telerik:RadContentTemplateTile ID="tileService" runat="server" Shape="Wide" CssClass="tile-services" NavigateUrl="/Admin/ListServices" Selected="false">
                    <ContentTemplate>
                        <div class="pull-left">
                            <%--<a href='javascript:void(0)' onclick="doSomeWork(1)">
                                <span class="glyphicon glyphicon-plus tile-plus noTileDrag" aria-hidden="true"></span>
                            </a>--%>

                            <a href="<%=ResolveUrl("~/Admin/AddService/")%>">
                                <span class="glyphicon glyphicon-plus tile-plus" aria-hidden="true"></span>
                            </a>
                        </div>

                        <img src="Images/Icons/Toolbars/alert.png" class="tile-image pull-left tile-image-plus" />
                        <div class="right-border"></div>

                        <div class="right-number">
                            43
                        </div>

                        <div class="right-text">
                            services
                        </div>
                    </ContentTemplate>

                </telerik:RadContentTemplateTile>

But nothing works. It always go to the URL set in NavigateUrl. The anchors don't work at all.

Is there a fix for this?

 

Thank you.

TC
Top achievements
Rank 1
 asked on 27 Feb 2017
0 answers
115 views

Hey,

im trying to have the same style to show the user that an input is invalid. Im using a RadTextBox, a RadNumericTextBox and a DateTimePicker with asp:CustomValidator each. For the two text boxes i can set

textbox.Invalid = true

but there is no such property in the DateTimePicker. I like the red border with the red exclamation mark in the text boxes and would like to use them for the DateTimePicker, too, but the only thing that works for me right now is to set an ErrorMessage for the Validator.

Do I fail to see how this works? Because there are forum threads asking for a way to not mark the field like I want to.

Greetings

Felix

Felix
Top achievements
Rank 1
 asked on 27 Feb 2017
1 answer
393 views

I have the following grid (as a sample)

<telerik:RadGrid runat="server" ID="RadGrid1" AllowSorting="true" AllowPaging="true" PageSize="15" AutoGenerateColumns="false" ShowDesignTimeSmartTagMessage="false" Width="9700px" AllowFilteringByColumn="true" GroupingSettings-CaseSensitive="false" >
   <MasterTableView GroupLoadMode="Client" DataKeyNames="Id" NoMasterRecordsText="No records." >
      <ColumnGroups>
         <telerik:GridColumnGroup HeaderText="[Group1]" Name="grp1" />
         <telerik:GridColumnGroup HeaderText="[Group2]" Name="grp2" />
      </ColumnGroups>
      <Columns>
         <telerik:GridBoundColumn UniqueName="Item1a" DataField="Item1a" HeaderText="[Item 1a]"  ColumnGroupName="grp1" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains" FilterControlWidth="100px">
          <HeaderStyle HorizontalAlign="Left" Width="120px" Wrap="false" />
          <ItemStyle HorizontalAlign="Left" Width="120px" />
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn UniqueName="Item1b" DataField="Item1b" HeaderText="[Item 1b]"  ColumnGroupName="grp1" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains" FilterControlWidth="100px">
          <HeaderStyle HorizontalAlign="Left" Width="120px" Wrap="false" />
          <ItemStyle HorizontalAlign="Left" Width="120px" />
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn UniqueName="Standalone" DataField="Standalone" HeaderText="[Stand Alone]"  AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains" FilterControlWidth="100px">
          <HeaderStyle HorizontalAlign="Left" Width="120px" Wrap="false" />
          <ItemStyle HorizontalAlign="Left" Width="120px" />
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn UniqueName="Item2a" DataField="Item2a" HeaderText="[Item 2a]"  ColumnGroupName="grp2" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains" FilterControlWidth="100px">
          <HeaderStyle HorizontalAlign="Left" Width="120px" Wrap="false" />
          <ItemStyle HorizontalAlign="Left" Width="120px" />
         </telerik:GridBoundColumn>
         <telerik:GridBoundColumn UniqueName="Item2b" DataField="Item2b" HeaderText="[Item 2b]"  ColumnGroupName="grp2" AutoPostBackOnFilter="true" FilterListOptions="VaryByDataType" CurrentFilterFunction="Contains" FilterControlWidth="100px">
          <HeaderStyle HorizontalAlign="Left" Width="120px" Wrap="false" />
          <ItemStyle HorizontalAlign="Left" Width="120px" />
         </telerik:GridBoundColumn>
      </Columns>
   </MasterTableView>
</telerik:RadGrid>

 

I am trying to alter the text on both the ColumnGroup items and the GridHeader items.

I can change the ColumnGroup text like this (in ItemDataBound):

RadGrid1.MasterTableView.ColumnGroups.FindGroupByName("grp1").HeaderText = "First Group"

 

But when I try to rename the GridHeader (as I have done numerous times before), there is no change

Private Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
   If (TypeOf e.Item Is GridHeaderItem) Then
      Dim header As GridHeaderItem = e.Item
      CType(header("Item1a").Controls(0), LinkButton).Text = "Group 1 - Item 1"
      CType(header("Item1b").Controls(0), LinkButton).Text = "Group 1 - Item 2"
      CType(header("Item2a").Controls(0), LinkButton).Text = "Group 2 - Item 1"
      CType(header("Item2b").Controls(0), LinkButton).Text = "Group 2 - Item 2"
   End if

 

What am I doing wrong?

Eyup
Telerik team
 answered on 27 Feb 2017
1 answer
442 views
I have a grid with a combo box edit template column. I have to save the Text and Value of the selected combo box item on BatchEditCommand. Can you please provide sample code to accomplish this?
Eyup
Telerik team
 answered on 27 Feb 2017
1 answer
236 views

Hi,

in my web application I data bind a list of simple POCO objects into the grid. In the ItemDataBound event handler I add some additional columns with generated values.

E.g.:

protected void radGridResult_ItemDataBound(object sender, GridItemEventArgs e)
{
  GridDataItem lGridDataItem = e.Item as GridDataItem;
 
  if ( lGridDataItem != null )
  {       
    lGridDataItem["Address"].Text = "Foobar";
  }
}

 

This works fine unless I try to group the "Address" column inside the web application. Then I get an exception that the "Address" property cannot be found inside the data object. 

Is there a way to solve this problem or is it better to create a new POCO data object containing all neccessary properties instead.

 

Best regards

Martin Horst

Eyup
Telerik team
 answered on 27 Feb 2017
0 answers
117 views

Hello I have two nested radlistbox with itemtemplates
the problem is when I select an item of sub Radlistbox how I can access the value of Parent item
Please Help Or if anybody has a better way please tell me
this my Asp.net code

 

<telerik:RadListBox ID="Chk_ProjectList" CssClass="Chk_Filters" runat="server" RenderMode="Classic" AutoPostBack="true"  OnItemCheck="Chk_ProjectList_ItemCheck"
                                        Width="100%" RepeatDirection="Horizontal" Font-Size="13px" 
                                        DataValueField="ProjectId" >
                                        <%--OnItemCheck="Chk_ProjectList_ItemCheck" AutoPostBack="true"  OnClientItemChecking="Chk_ProjectList_OnClientItemChecking"--%>

                                        <ItemTemplate>


                                            <table style="width: 100%; border: none;">
                                                <tr style="width: 100%;" runat="server" id="tds">
                                                    
                                                    <td style="width: 18%; display: inline;">
                                                        <%--<input class="rlbCheck" type="checkbox"/>--%>
                                                        <div class="PrjClassTitle">
                                                            

                                                            <%# DataBinder.Eval(Container.DataItem, "ProjectName") %>   ( <%# DataBinder.Eval(Container.DataItem, "Count") %> )
                                                
                                                        </div>
                                                    </td>



                                                </tr>
                                                <tr style="width: 100%;">
                                                    <td id="Td1" style="width: 18%; display: inline;" runat="server">
                                                        <div runat="server" id="ActionTypeStatus" class="GPart">
                                                            <%--style="display: none"--%>
                                                            <%--<div class="divFilterTitle">وضعیت واگن </div>--%> 
                                                            <telerik:RadListBox ID="Chk_ActionTypeStatusList" runat="server" RenderMode="Lightweight" AutoPostBack="true" 
                                                                Width="100%" RepeatDirection="Horizontal" RepeatColumns="1" Font-Size="13px"
                                                                DataValueField="ActionTypeId"><%--OnSelectedIndexChanged="Chk_ActionTypeStatusList_SelectedIndexChanged" OnClientSelectedIndexChanging="Chk_ActionTypeStatusList_SelectedIndexChanging" --%>

                                                                <ItemTemplate>



                                                                    <table style="width: 100%;">
                                                                        <tr style="width: 100%;">

                                                                            <td style="width: 18%; display: inline;">
                                                                                
                                                                                <%# DataBinder.Eval(Container.DataItem, "ActionTypeName") %> ( <%# DataBinder.Eval(Container.DataItem, "Count") %> )
                                                
                                                                            </td>

                                                                        </tr>
                                                                    </table>

                                                                </ItemTemplate>
                                                                <EmptyMessageTemplate>
                                                                   NO RECORDES
                                                                </EmptyMessageTemplate>

                                                            </telerik:RadListBox>


                                                            <%--<div class="GPartLn"></div>--%>
                                                        </div>
                                                    </td>
                                                </tr>


                                            </table>


                                        </ItemTemplate>



                                        <EmptyMessageTemplate>
                                            NO RECORDES
                                        </EmptyMessageTemplate>
                                    </telerik:RadListBox>

Maryam
Top achievements
Rank 1
 asked on 27 Feb 2017
0 answers
166 views

For some reason, on both iOS Safari and Android Chrome, when I or a user scrolls vertically in a listbox, it is "selecting" the item under their finger when they lift it off the screen and have finished scrolling.

I would normally expect a user to be able to scroll vertically in the list and then "tap" an item to select it.

I've seen older threads claiming this was fixed in ~2013 builds, but I'm on a 2016 build and I'm still experiencing the issue.

Also on a side note, scrolling down in listboxes on Android Chrome also seems to occasionally trigger chrome's "pull-to-refresh" functionality, which I'm trying to avoid.

Alex
Top achievements
Rank 1
 asked on 25 Feb 2017
0 answers
178 views

The following code works and updates the literal control perfectly.  When I add the ajax manager, it doesn't update the control at all . Its still Showing Chart...

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlFromDay">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="litTargetSales" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
     <telerik:RadFormDecorator RenderMode="Lightweight" ID="FormDecorator1" runat="server" DecoratedControls="Buttons"></telerik:RadFormDecorator>
 
      <fieldset>
                            <telerik:RadPageLayout ID="rplTargetAcheived" runat="server" GridType="Fluid">
                                <Rows>
                                    <telerik:LayoutRow>
                                        <Columns>
                                            <telerik:LayoutColumn Span="6" CssClass="tdmakeright">
                                                <telerik:RadLabel ID="lblFromDay" runat="server" Text="From Day" Skin="MetroTouch" RenderMode="Lightweight"></telerik:RadLabel>
 
                                                <telerik:RadComboBox ID="ddlFromDay" runat="server" Filter="StartsWith" Skin="MetroTouch" RenderMode="Lightweight" Width="59px" AutoPostBack="true" OnSelectedIndexChanged="ddlFromDay_SelectedIndexChanged"></telerik:RadComboBox>
 
                                                <telerik:RadLabel ID="lblToDay" runat="server" Text="To Day" Skin="MetroTouch" RenderMode="Lightweight"></telerik:RadLabel>
 
                                                <telerik:RadComboBox ID="ddlToDay" runat="server" Filter="StartsWith" Skin="MetroTouch" RenderMode="Lightweight" Width="59px" AutoPostBack="true" OnSelectedIndexChanged="ddlToDay_SelectedIndexChanged"></telerik:RadComboBox>
                                            </telerik:LayoutColumn>
                                            <telerik:LayoutColumn Span="6" CssClass="tdmakeleft">
                                                <telerik:RadLabel ID="lblof" runat="server" Text="of" Skin="MetroTouch" RenderMode="Lightweight"></telerik:RadLabel>
                                                <telerik:RadComboBox ID="ddlMonth" runat="server" Filter="StartsWith" Skin="MetroTouch" RenderMode="Lightweight" Width="100px" AutoPostBack="true" OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged"></telerik:RadComboBox>
                                                <telerik:RadComboBox ID="ddlYear" runat="server" Filter="StartsWith" Skin="MetroTouch" RenderMode="Lightweight" Width="100px" AutoPostBack="true" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged"></telerik:RadComboBox>
                                            </telerik:LayoutColumn>
                                        </Columns>
                                    </telerik:LayoutRow>
                                </Rows>
                                <Rows>
                                    <telerik:LayoutRow>
                                        <Columns>
                                            <telerik:LayoutColumn Span="12" CssClass="tdmakeright">
                                                <asp:Literal ID="litTargetSales" runat="server"></asp:Literal>
                                            </telerik:LayoutColumn>
                                        </Columns>
                                    </telerik:LayoutRow>
                                </Rows>
                            </telerik:RadPageLayout>
                        </fieldset>
nithinraj
Top achievements
Rank 1
 asked on 25 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?