Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
79 views
Hi!

I have a Subscription Object with the field Name that is displayed in the grid.
Inside that  Subscription Object is a list of Beneficiaries Objects with the field Name.

What i'm trying to do is, when filtering by the Subscription name, i'm also going to search in the  Beneficiaries list (in the field name).

I Hope that i was explicit enough.

Best Regards,
Fernando Moreira

Andrey
Telerik team
 answered on 17 May 2013
13 answers
608 views
Hi, i have problem with center window after aotusize. I use window for show images. How can center window after resize?

My javascript code:
var previewWinInDemo;
        var imgHolder;
        function pageLoad() {
            //get references to the 2 RadWindows
            previewWinInDemo = $find("<%= PreviewWindowDetail.ClientID %>");
            //get a reference to the image tag in the preview window
            imgHolder = document.getElementById('<%= imageHolder.ClientID %>');
            //add onload event for the image in the preview window
            $addHandler(imgHolder, "load", sizePreviewWindow);
        }
        function sizePreviewWindow() {
            previewWinInDemo.autoSize(true);
             
            
        }
        function openWin(imageurl, img) {
            //previewWinInDemo.autoSize(true);
            imgHolder.src = img.src;
            imgHolder.focus();
            //show the window
            previewWinInDemo.show();
            previewWinInDemo.center();
        }

My aspx code:
<telerik:RadWindow ID="PreviewWindowDetail" Skin="Web20" runat="server" VisibleStatusbar="false"
    VisibleTitlebar="true" OffsetElementID="offsetElement" AutoSizeBehaviors="Width, Height"
    AutoSize="true" Behaviors="Close" KeepInScreenBounds="false" Title="Click to close"
    Modal="true" OnClientShow="CloseWidnowAfterModalClick" >
    <ContentTemplate>
        <div onclick="HideWindow();" style="background-color: silver;">
            <asp:Image runat="server" ID="imageHolder" alt="Image holder" Style="cursor: pointer;
                margin: 0px;" ToolTip="Click to close." AlternateText="" />
        </div>
    </ContentTemplate>
</telerik:RadWindow>
Marian
Top achievements
Rank 2
 answered on 17 May 2013
3 answers
130 views
Hello, I need assistance in getting my top pager and my bottom pager to remain in sync when the page is changed.  I am using a asp:DataList, so I've had to set the pager up so that it calls the "PageIndexChanged" event and the TotalRowCountRequest event. 

Is there a way to have the other pager respond as well when the events are triggered on the first pager?

Edit:  I would like to emphasize that I'm using the asp:DataList, not the ListView.  Thanks!

Thanks!

Here is the code:

<telerik:RadDataPager ID="RadDataPager1" runat="server" OnPageIndexChanged="RadDataPager_PageIndexChanged" OnTotalRowCountRequest="RadDataPager_TotalRowCountRequest" OnPreRender="RadDataPager_PreRender" >
 <Fields>
    <telerik:RadDataPagerTemplatePageField HorizontalPosition="LeftFloat">
        <PagerTemplate>
            <div style="float: right;color:#666666;">
                Displaying items
                    <asp:Label runat="server" ID="PageItemFromLabel"  />
                    to
                    <asp:Label runat="server" ID="PageItemToLabel"  />
                    of
                    <asp:Label runat="server" ID="TotalItemsLabel"  />
                    
            </div>
        </PagerTemplate>
    </telerik:RadDataPagerTemplatePageField>
     <telerik:RadDataPagerButtonField FieldType="NextLast" HorizontalPosition="RightFloat" />
      <telerik:RadDataPagerButtonField FieldType="Numeric" HorizontalPosition="RightFloat" />
    <telerik:RadDataPagerButtonField FieldType="FirstPrev" HorizontalPosition="RightFloat" />
     
    </Fields>        
</telerik:RadDataPager>
 
 
 
<asp:DataList ID="lvUserImages" runat="server" OnNeedDataSource="lvUserImages_NeedDataSource" RepeatColumns=3 CellPadding=10 ItemStyle-VerticalAlign="Bottom" RepeatDirection="Horizontal" OnItemDataBound="lvUserImages_ItemDataBound"    >
        <ItemTemplate>
        <asp:HyperLink ID="hlPost" runat="server">
        <div class="imgWrapper" >
        <asp:Image ID="img" runat="server" style="max-width:300px"  />
        <div class="imgTextOverlay">
                <%# Eval("subject") %><br />
                Posted: <%# ((DateTime)Eval("postdate")).ToString("MM/dd/yyyy") %> | <%#Eval("replycount") %> replies
            </div>
            </div>
        </asp:HyperLink>
         </ItemTemplate>
    </asp:DataList>
 
 
 
    <telerik:RadDataPager ID="RadDataPager2" runat="server" OnPageIndexChanged="RadDataPager_PageIndexChanged" OnTotalRowCountRequest="RadDataPager_TotalRowCountRequest" OnPreRender="RadDataPager_PreRender" >
 <Fields>
    <telerik:RadDataPagerTemplatePageField HorizontalPosition="LeftFloat">
        <PagerTemplate>
            <div style="float: right;color:#666666;">
                Displaying items
                    <asp:Label runat="server" ID="PageItemFromLabel"  />
                    to
                    <asp:Label runat="server" ID="PageItemToLabel"  />
                    of
                    <asp:Label runat="server" ID="TotalItemsLabel"  />
                    
            </div>
        </PagerTemplate>
    </telerik:RadDataPagerTemplatePageField>
     <telerik:RadDataPagerButtonField FieldType="NextLast" HorizontalPosition="RightFloat" />
      <telerik:RadDataPagerButtonField FieldType="Numeric" HorizontalPosition="RightFloat" />
    <telerik:RadDataPagerButtonField FieldType="FirstPrev" HorizontalPosition="RightFloat" />
     
    </Fields>        
</telerik:RadDataPager>
Marin
Telerik team
 answered on 17 May 2013
3 answers
169 views
Hi Telerik Team,
         
             Recently we have moved <asp:scriptmanager ......./> to master page of our web application and along with scriptmanager master page contains timer and update panel with asp:timer as below.
<asp:ScriptManager ID="Aspx_ScriptManager" runat="server" />
    <asp:Timer ID="Test" OnTick="Test_Tick" Interval="6000" runat="server" />
                <asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
                     <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Test"/>
                     </Triggers>
                    <ContentTemplate>
                        <asp:HiddenField ID="Test_Reminder" runat="server" />
                        <asp:HiddenField ID="Test_Reminder_Count" runat="server" />                       
                    </ContentTemplate>
                </asp:UpdatePanel>

 Most of the pages which are using radgrids are working fine.

But in some page it is showing the exception (please refer the attachment).

- I have already try the solution like <telerik:RadCodeBlock... > </telerik:RadCodeBlock> for scripts in my page. But no use.
- Another solution also i have used like move scripts to body from head.(Got while web search)

But i didn't resolved attached exception. Please help me.


Pavlina
Telerik team
 answered on 17 May 2013
12 answers
280 views
Hi.
I have a grid with a detailtable contain two combobox. The comboBox works find for insert but not editing. It seems like the combobox values is not filled up before reaching the html code where i have SelectedValue='<%#Bind("Route1")%>'. The comboboxies are filled up by RadGridSamband_ItemDataBound. If i remove SelecetedValue the errror disappear but than the value from the combobox is not saved. (I used LinqDataSource with automaticUpdates.) I have tried some solution in the forum without luck.  How can i solved this problem?

The code i am using is:
 
protected void RadGridSamband_ItemDataBound(object sender, GridItemEventArgs e)
      {           
          if (e.Item is GridDataInsertItem)
          {
              SetSambandAndDistancColumnWidth(e);               
              if (e.Item.OwnerTableView.Name == "GridDistance")
              {
                  SetFocusOnField(e, "Distancenumber");
                  FillComboboxWithRoutes(e, "Route1ComboBox", false);
                  FillComboboxWithRoutes(e, "Route2ComboBox", false);
              }
              else
              {
                  SetFocusOnField(e, "Sambandnumber");
              }
          }        
          else if (e.Item.IsInEditMode)
          {
              SetSambandAndDistancColumnWidth(e);               
              if (e.Item.OwnerTableView.Name == "GridDistance")
              {               
                  SetFocusOnField(e, "Distancenumber");
                  FillComboboxWithRoutes(e, "Route1ComboBox", true);
                  FillComboboxWithRoutes(e, "Route2ComboBox", true);
              }
              else
              {
                  SetFocusOnField(e, "Sambandnumber");
              }
          }          
      }

<telerik:RadGrid ID="RadGridSamband" runat="server" AllowSorting="True"
                   AutoGenerateColumns="False" DataSourceID="SambandDataSource" GridLines="None"
                   Culture="Norwegian, BokmÃ¥l (Norway)" ShowStatusBar="True"                     
                   onitemdeleted="RadGridSamband_ItemDeleted"
                   oniteminserted="RadGridSamband_ItemInserted"
                   onitemupdated="RadGridSamband_ItemUpdated"
                   onitemdatabound="RadGridSamband_ItemDataBound"
                   onitemcommand="RadGridSamband_ItemCommand" AllowAutomaticDeletes="True"
                   AllowAutomaticInserts="True" AllowAutomaticUpdates="True">       
           <MasterTableView DataKeyNames="Id" DataSourceID="SambandDataSource" CommandItemDisplay="Top" EditMode="InPlace" Name="Samband">
               <DetailTables>
                   <telerik:GridTableView runat="server" CommandItemDisplay="Top" DataSourceID="DistanceDataSource" EditMode="InPlace" HierarchyDefaultExpanded="True" Name="GridDistance" DataKeyNames="Id">
                       <ParentTableRelation><telerik:GridRelationFields DetailKeyField="SambandId" MasterKeyField="Id" /></ParentTableRelation>
                   <CommandItemSettings ExportToPdfText="Export to Pdf" />
                   <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px" /></RowIndicatorColumn>
                   <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px" /></ExpandCollapseColumn>
                       <Columns>
                           <telerik:GridBoundColumn  UniqueName="SambandId" DataField="SambandId" HeaderText="SId" ReadOnly="true" AllowFiltering="false"><HeaderStyle Width="20px"></HeaderStyle></telerik:GridBoundColumn>  
                           <telerik:GridNumericColumn  UniqueName="Distancenumber"  DataType="System.Int32" HeaderText="Strekningsnr." DataField="Distancenumber" SortExpression="Distancenumber"><HeaderStyle Width="70px"></HeaderStyle><ItemStyle HorizontalAlign="Right" /></telerik:GridNumericColumn>            
                           <telerik:GridNumericColumn  UniqueName="Distancelength" DataType="System.Int32" HeaderText="Strekningslengde" DataField="Distancelength" SortExpression="Distancelength"><HeaderStyle Width="70px"></HeaderStyle><ItemStyle HorizontalAlign="Right"/></telerik:GridNumericColumn>                                                            
                           <telerik:GridTemplateColumn DataField="Route1" DataType="System.String" SortExpression="Route1" UniqueName="Route1" HeaderText="Rute">                    
                               <ItemTemplate><%#DataBinder.Eval(Container.DataItem, "Route1") %></ItemTemplate>
                               <EditItemTemplate>
                                   <telerik:RadComboBox runat="server" id="Route1ComboBox" DataValueField="Route1" HighlightTemplatedItems="true" EmptyMessage="Velg et element"  AutoPostBack="true" Height="100px" Width="180px" AppendDataBoundItems="true"  OnSelectedIndexChanged="Route1ComboBox_SelectedIndexChanged" AllowCustomText="true"  SelectedValue='<%#Bind("Route1")%>'>
                                       <Items><telerik:RadComboBoxItem runat="server" Text="" Value=""/></Items>
                                   </telerik:RadComboBox>
                                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Text="*" ForeColor="Red" ControlToValidate="Route1ComboBox" runat="server"/>
                               </EditItemTemplate>
                           </telerik:GridTemplateColumn>
                           <telerik:GridTemplateColumn DataField="Route2" DataType="System.String" SortExpression="Route2" UniqueName="Route2" HeaderText="Rute">                    
                               <ItemTemplate><%#DataBinder.Eval(Container.DataItem, "Route2") %></ItemTemplate>
                               <EditItemTemplate>
                                   <telerik:RadComboBox runat="server" id="Route2ComboBox" DataValueField="Route2" HighlightTemplatedItems="true" EmptyMessage="Velg et element" AllowCustomText="true" AutoPostBack="true" Height="100px" Width="180px" AppendDataBoundItems="true" OnSelectedIndexChanged="Route2ComboBox_SelectedIndexChanged"  SelectedValue='<%#Bind("Route2")%>'>
                                       <Items><telerik:RadComboBoxItem runat="server" Text="" Value=""/></Items>
                                   </telerik:RadComboBox>                           
                               </EditItemTemplate>
                           </telerik:GridTemplateColumn>     
                           <telerik:GridEditCommandColumn CancelText="Avbryt" EditText="Endre" InsertText="Sett inn" UpdateText="Oppdater"><HeaderStyle Width="105px"></HeaderStyle><ItemStyle HorizontalAlign="Right" /></telerik:GridEditCommandColumn>      
                           <telerik:GridButtonColumn HeaderStyle-Width="40px" CommandName="Delete" Text="Slett" UniqueName="column2" ConfirmDialogType="RadWindow" ConfirmText="Er du sikker pÃ¥ at du vil slette elementet?" ConfirmTitle="Bekreft sletting"><HeaderStyle Width="40px"></HeaderStyle></telerik:GridButtonColumn>                              
                       </Columns>
                   <EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings>
               </telerik:GridTableView>
               </DetailTables>
               <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
               <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn>
               <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn>
               <Columns>
                   <telerik:GridTemplateColumn DefaultInsertValue="false" UniqueName="IsSelected" HeaderStyle-Width="40px" HeaderText="Velg" AllowFiltering="false">
                       <ItemTemplate>
                           <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Eval("IsSelected")%>' Tooltip="Brukes for Ã¥ merke av hvilken samband som skal være med ved generering av ferjedatabankfil(er)."/>                                    
                       </ItemTemplate>
                       <EditItemTemplate></EditItemTemplate>
                   <HeaderStyle HorizontalAlign="Center" /><ItemStyle HorizontalAlign="center"/></telerik:GridTemplateColumn>
                   <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" ReadOnly="True" SortExpression="Id" UniqueName="Id"></telerik:GridBoundColumn>             
                   <telerik:GridNumericColumn DataField="Sambandnumber" DataType="System.Int32" HeaderText="Sambandnr." SortExpression="Sambandnumber" UniqueName="Sambandnumber"><HeaderStyle Width="100px"></HeaderStyle></telerik:GridNumericColumn>
                   <telerik:GridBoundColumn DataField="SambandFrom" HeaderText="Fra navn pÃ¥ sambandet" SortExpression="SambandFrom" UniqueName="SambandFrom"><HeaderStyle Width="180px"></HeaderStyle></telerik:GridBoundColumn>
                   <telerik:GridBoundColumn DataField="SambandTo" HeaderText="Til navn pÃ¥ sambandet" SortExpression="SambandTo" UniqueName="SambandTo"><HeaderStyle Width="180px"></HeaderStyle></telerik:GridBoundColumn>                   
                   <telerik:GridCheckBoxColumn DataField="HasFerryAttached" DataType="System.Boolean" HeaderText="Har ferje" SortExpression="HasFerryAttached" UniqueName="HasFerryAttached"><HeaderStyle Width="80px"></HeaderStyle></telerik:GridCheckBoxColumn>
                    <telerik:GridEditCommandColumn CancelText="Avbryt" EditText="Endre" InsertText="Sett inn" UpdateText="Oppdater"><HeaderStyle Width="105px"></HeaderStyle><ItemStyle HorizontalAlign="Right" /></telerik:GridEditCommandColumn>      
                   <telerik:GridButtonColumn HeaderStyle-Width="40px" CommandName="Delete" Text="Slett" UniqueName="column1" ConfirmDialogType="RadWindow" ConfirmText="Er du sikker pÃ¥ at du vil slette elementet?" ConfirmTitle="Bekreft sletting"><HeaderStyle Width="40px"></HeaderStyle></telerik:GridButtonColumn>                                    
               </Columns>
               <EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings>
           </MasterTableView>
           <FilterMenu EnableImageSprites="False"></FilterMenu>
           </telerik:RadGrid>

Tim
Top achievements
Rank 1
 answered on 17 May 2013
1 answer
98 views
Hello,

I noticed that the pie chart has only 5 different colors for the different pie slices. Meaning if I have more than 5 items showing in my chart, colors will get repeated (I tried a few skins, but didn't try them all).

I can of course try to make code that will add the items individually and set the color myself, but I would rather have this just work straight out of the box. Is there a simple way to have more than 5 colors? Did i miss anything?

Thanks.
Stamo Gochev
Telerik team
 answered on 17 May 2013
4 answers
284 views
Hello dear community and Telerik!! We have deployed the Lite version of Rad Controls now, published it aswell.
Am i under the wrong immpression that the Lite controls do not enable the possibilety of pasting in images from the clipboard directly into wiki`s ?

Christian
Top achievements
Rank 1
 answered on 17 May 2013
1 answer
103 views
Hi. I use a TreeList with autogenerated columns and I create my TreeList control programmatically in Page_init event.
I need to show the "selected" Items stored in DB and for this I write my code in Pre_render event.
I have two critical questions:
1) is there a way to find an item by his PrimaryKey, without looping all items?
2) How to ensure visible my selectedItems? I try this but it fail (ie. my parent node remain close ... in my sample code I suppose to have only 2 level)
void MyCustomTreeList_PreRender(object sender, EventArgs e)    {
...
foreach (var item in this.Items) {
          string pkey = item.GetDataKeyValue(this.DataKeyNames[0]).ToString();
          if (SelectedKey.Contains(pkey))
          {
            item.Selected = true;
// How to ensure visible????
//            if (item.ParentItem != null)
//                item.ParentItem.Expanded = true;  
          }
...
        }

In my case I have no paging and I avoid the "Load on demand" scenario.
Some suggestion?
Thanks
Michela
Angel Petrov
Telerik team
 answered on 17 May 2013
1 answer
345 views
<style type="text/css">
            .RadWindow .rwWindowContent .radalert
            {
                background-image: url("images/InfoImg.png");
            }
        </style>

.aspc.cs
  radWindowManager1.RadAlert("Tax setup added successfully.", 300, 60, "Authority Tax Setup ", "0");


The above code, I am used for Successful message but ,I Want to display  some other image icon or  "predefined  warning"  of rad alert in place of successful message Icon,when message is failure.
Marin Bratanov
Telerik team
 answered on 17 May 2013
2 answers
183 views
I have an image and when I click on it a rad window appears.  Inside the rad window I have a button and a radgrid.  I click the button to populate the radgrid and then the rad window disappears (while populating the the radgrid??).  I have to click on the image again to reshow the rad window and now the grid appears with all its data.  How can I make the rad window stay visible while populating the radgrid?  I have the HideEvent set to ManualClose but it does not seem to matter.  The rad window still disappears while populating the grid.  Can I reshow the rad window after the grid loads maybe?

Thanks
Marin Bratanov
Telerik team
 answered on 17 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?