Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hello,

I have a problem with displaying the items in the radlistview control in RTL mode. In order to understand the problem plaese view the attached images (Cuurent.jpg and Required.jpg).

Here is the control code::
<asp:Panel ID="RadListView1Panel" style="margin-left:10px;" runat="server">
                 <telerik:RadListView runat="server" ID="RadListView1" AllowPaging="True" EnableEmbeddedSkins="false" Width="915px"
                    DataKeyNames="ItemID" DataSourceID="ObjItems" OnPageIndexChanged="RadListView1_PageIndexChanged" onitemdatabound="RadListView1_ItemDataBound">
                    <ItemTemplate>
                        <div class="rlvI" style="margin-left:1px; border:0; border-color:transparent; height:220px; width:305px;">
                            <center>
                                <asp:Panel ID="ItmPanel" Width="300px" BackImageUrl="~/Common/Img/BackGrounds/g4.gif" style="margin:-1px; padding:-1px;" Height="210px" runat="server">
                                        <asp:Table ID="Table1" Width="300px" HorizontalAlign="Center" BorderColor="Black" BorderWidth="0" runat="server">
                                            <asp:TableRow ID="TableRow2" Height="20px" runat="server">
                                              <asp:TableCell ColumnSpan="2">
                                                   
                                              </asp:TableCell>
                                            </asp:TableRow>
                                            <asp:TableRow ID="TableRow1" Height="190px" runat="server">
                                                <asp:TableCell VerticalAlign="Top" HorizontalAlign="Right" ID="TableCell1" Width="200px" runat="server">
                                                  <div style="margin-right:5px;">
                                                    <asp:Label ID="ItmNameLabel" SkinID="ItemHeaderText" runat="server" Text='<%# Eval("ItmName") %>'></asp:Label><br /><br />
                                                    <asp:Label ID="ItmDescLabel" runat="server" Text='<%# Eval("ItmDesc") %>'></asp:Label>
                                                  </div>
                                                </asp:TableCell>
                                                <asp:TableCell ID="TableCell5" VerticalAlign="Top" Width="100px" runat="server">
                                                    <asp:Image ID="ItmImage" ImageUrl='<%# Eval("FileUrl") %>' Width="90px" Height="90px" runat="server" />
                                                    <br /><br /><br />
                                                    <asp:LinkButton ID="MoreDetailsLinkButton" Font-Underline="false" ForeColor="Black" Font-Bold="true" Text="<%$ Resources:Resource, PagesItemsMoreDetailsLinkButtonText %>" OnClick="MoreDetailsLinkButton_Click" runat="server"></asp:LinkButton>
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                             
                                </asp:Panel>
                            </center>
                        </div>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div class="RadListView RadListView_<%# Container.Skin %>">
                            <div class="rlvEmpty">
                                There are no items to be displayed.</div>
                        </div>
                    </EmptyDataTemplate>
                    <LayoutTemplate>
                        <div class="RadListView RadListViewFloated RadListView_<%# Container.Skin %>" style="background-color:transparent;">
                            <div class="rlvFloated rlvAutoScroll">
                                <div id="itemPlaceholder" runat="server">
                                </div>
                            </div>
                            <table cellpadding="0" cellspacing="0" width="100%" style="clear: both;">
                                <tr>
                                    <td align="center">
                                        <telerik:RadDataPager ID="RadDataPager2" runat="server" Width="280px" PagedControlID="RadListView1"
                                            PageSize="21" >
                                            <Fields >
                                                <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                                <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                                                        TextBoxWidth="15" />
                                                <telerik:RadDataPagerButtonField FieldType="NextLast" />
                                            </Fields>
                                        </telerik:RadDataPager>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </LayoutTemplate>
                </telerik:RadListView>
            </asp:Panel>

Please, I need to display the items as it is shown in Required.jpg image.
It is appreciated to send me the modified code.

Regards,
Bader
Daniel
Telerik team
 answered on 03 Feb 2011
1 answer
92 views
I am currently evaluating the Telerik suite of tools and trying to write a sample program to provide my management with justification for the purchase of the suite.  In doing so I am trying to use the Ajax based suite of products for the first time.

Currently I have a master page with three content panels. 

My Tree View is defined with:
------------------------------------------
    <telerik:RadTreeView runat="Server" ID="HDQueuesTreeView" OnNodeClick="HDQueuesTreeView_NodeClick"
        EnableViewState="False" DataFieldID="NODE_ID" OnClientNodeClicked="onNodeClicking_HDQueuesTreeView"
        DataTextField="DISPLAY_TEXT" DataFieldParentID="PARENT_NODE"
        OnNodeDataBound="HDQueuesTreeView_NodeDataBound"
         DataValueField="OBJECT_AS_XML" >
        <DataBindings>
            <telerik:RadTreeNodeBinding ToolTipField="TOOL_TIP_TEXT" TextField="DISPLAY_TEXT" ValueField="OBJECT_AS_XML" />
        </DataBindings>
    </telerik:RadTreeView>
------------------------------------------

My Grid is defined in another content panel with:

------------------------------------------
<telerik:RadGrid ID="HDQueueGrid" runat="server" AutoGenerateColumns="False"
                Height="100%" BorderWidth="0px" AllowSorting="True" Style="outline: none" ShowGroupPanel="True"
                GridLines="None"
                onneeddatasource="HDQueueGrid_NeedDataSource">
                <MasterTableView>
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
(I snipped out all the columns)
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" AllowDragToGroup="True">
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
           </telerik:RadGrid>
------------------------------------------

The tree view control populates and the click events fire the required Ajax request to the server.  The server side onnodebound events fire.  The server side OnClick events never fire.  The server side Ajax manager request does fire and it seems to work.  My current Ajax event is as follows:
------------------------------------------
protected void MyQueuesAjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {
            //Use the Deserialize method to create a RadTreeNode object from the JSON string representing the node
            RadTreeNode clickedNode = new JavaScriptSerializer().Deserialize<RadTreeNode>(e.Argument);
            if (clickedNode != null)
            {
                if (u != null)
                {
                    QB_LAST_CLICKED = XMLSerial.DeserializeObject<QUEUE_BUTTONS>(u, clickedNode.Value);
                    if (QB_LAST_CLICKED != null)
                    {
                        this.Session["LAST_CLICKED_QUEUE"] = QB_LAST_CLICKED;
                        HDQueueGrid.Rebind();
                    }
                }
            }
        }
------------------------------------------
My Grids "NeedsDataSource" event is as follows:
------------------------------------------
protected void HDQueueGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            List<QUEUE_CONTENTS> QC_LIST = null;

            if ((u != null) &&
                (this.IsPostBack == true))
            {
                if ((QB_LAST_CLICKED != null) &&
                    (e.IsFromDetailTable == false))
                {
                    QC_LIST = QUEUE_CONTENTS.READDB(u, QB_LAST_CLICKED);
                }
            }
            HDQueueGrid.DataSource = QC_LIST;
        }
------------------------------------------
I have confirmed that the datasource does in fact get populated. I just cannot seem to visually show the data.  The display content area which "hosts" the grid control is blank.

In case you wish to see my Ajax Manager code:

   <telerik:RadAjaxManager runat="server" ID="MyQueuesAjaxManager"
         OnAjaxRequest="MyQueuesAjaxManager_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="HDQueuesTreeView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="HDQueueGrid"
                        LoadingPanelID="HDAjaxLoadingPanel"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
I do not know if it is relevant but this snipped of code is located in the content panel with the TreeView control.

So what am I doing incorrectly?  I would revert the project to using a data source on the grid except that I cannot seem to derive the selectedvalue from the treeview control.  Those values are always an empty string.  (The treeview control is bound to a List<QUEUE_BUTTON> objects)

The treeview is populated using in the page load event using:

if (u != null)
            {
                if (this.IsPostBack == false)
                {
                    HDQueuesTreeView.DataSource = QUEUE_BUTTONS.READDB(u);
                    HDQueuesTreeView.DataBind();
                }
            }
------------------------------------------

Thank you for any pointers you can send my way.

Nikolay Tsenkov
Telerik team
 answered on 03 Feb 2011
1 answer
127 views
I have two listboxes that I am transferring items between.  I have set the sort propert to asceding and the datasortfield to "plantname" ( the same as the datatextfield) When an item is xfered to the other list it is not being ordered. Is there other code that I must add to make this happen?
Thank you
Judith
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
1 answer
165 views
Hello ,
 I have a RadGrid that I am populating via Drag and Drop From another RadGrid , I would like to sort in the Grid that is being populated by drag and drop but upon clicking a column to sort the items in the grid are removed.

how can sorting be accomplished in this grid?
Martin
Telerik team
 answered on 03 Feb 2011
3 answers
229 views
Hi, please I need help with ths scenario:
I have a radgrid with AutoGenerateColumns=true, the Filters are enabled, also allow resize columns. At the beginning the grid fits the screen width, but after I do some resize in the columns (causing overflow in the screen and scroll appears) all the columns that appears after the scroll begins lost all functionality (drag n drop, the filters appears in wrong positions in the screen), this is weird, and makes the grid a complete disaster, please how can I fix this issue!. You can find screenshots.

Using Q1 2010

Thanks in advance.
Tsvetina
Telerik team
 answered on 03 Feb 2011
4 answers
91 views
Hi,

I have the following radgrid integrated to my application.

<telerik:RadGrid ID="grdCompanyList"
                runat="server" GridLines="None"
                AutoGenerateColumns="False"
                AllowSorting="True"
                AllowFilteringByColumn = "True"
                AllowPaging="True"
                EnableLinqExpressions="False"
                PageSize="10"
                OnNeedDataSource="grdCompanyList_NeedDataSource"
                OnItemCreated="grdCompanyList_ItemCreated">
                 
                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>                               
                <MasterTableView DataKeyNames="watchlist_id" CommandItemDisplay="Top" EditMode="PopUp">
                <CommandItemSettings ShowAddNewRecordButton="false"/>
                <Columns>
 
                    <telerik:GridBoundColumn DataField="watchlist_id" DataType="System.Int32"
                        HeaderText="watchlist_id" ReadOnly="True" SortExpression="watchlist_id"
                        UniqueName="watchlist_id" Visible="false" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn DataField="company_id" DataType="System.Int32"
                        HeaderText="company_id" ReadOnly="True" SortExpression="company_id"
                        UniqueName="company_id" Visible="false" >
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="180px">
                    <ItemTemplate>
                        <asp:Image width="142" height="58" ID="CompLogos" ImageUrl="<%# showCompLogo(Container.DataItem) %>"
                         runat="server" AlternateText="Logo" />
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>
                     
                    <telerik:GridBoundColumn DataField="company_name"
                        HeaderText="Company name" SortExpression="company_name" ItemStyle-Width="450"
                        UniqueName="company_name" ReadOnly="true">
                        <ItemStyle Width="450px" />
                    </telerik:GridBoundColumn>                  
                   
                    <telerik:GridTemplateColumn AllowFiltering="false" ItemStyle-Width="50px">
                    <ItemTemplate>
                        <asp:HyperLink ID="CoLink"  runat="server" Text="Edit" ImageUrl="~/images/viewicon_big.png" ToolTip="View Details"></asp:HyperLink>
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>                  
 
                </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true"></ClientSettings>
                </telerik:RadGrid>
 
I need to extract the company ids which is in the second column in the grid and use that to redirect to a different page.
I have used the following code:

protected void grdCompanyList_ItemCreated(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridDataItem)
       {
           HyperLink CoLink = (HyperLink)e.Item.FindControl("CoLink");
           GridDataItem item = (GridDataItem)e.Item;
           string Cid = item["company_id"].Text;
           CoLink.Attributes["href"] = "CompanyDetails.aspx?Id=" + Cid;
       }
   }

However the above doesn't work.

Please suggest I can i extract the data from the seconds column.

Thanks,

Debashis

Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
2 answers
516 views
I have a grid which I'm populating via pivot table in the code behind...therefore the columns are set to auto-generate.

I'd like to modify the header template so that the values are displayed as hyperlinks...I'll need to be able to programmatically create the hyperlink for each column using the header template text as a value.

Can you show me how to do this? I've gotten access to the header columns using the following Grid_PreRender event

protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid grid = ((RadGrid)sender);
 
    foreach (GridItem header in grid.MasterTableView.GetItems(GridItemType.Header))
    {
 
    }
}

I just don't know what I need to do in the foreach loop to change the header text to make it a hyperlink of the value.

Thanks for the help =)
Philip Senechal
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
203 views

If user changes the name in the textbox user is shown with confirm box  ok , cancel
if user clicks on ok edited name need to be changed
if user clicks on cancel old name need to be repopulated 
Here i am facing problem in
1. repopulating the textbox with oldvalue
2.these textbox is placed in textbox when ever page is getting loaded it is showing confirm box
 

function
TextChanged(Sender,EventArgs)
   {
 
       var sSave;
                   
                   var Nametext = $find('<%= radtxtName.ClientID  %>');
 
                   sSave = confirm("Name is changed");
                   alert(sSave);
          if (sSave == true)
          {
              
              var NewValue = EventArgs.get_newValue();
              Nametext .set_value(NewValue);
               
          }
          else   {
 
              var oldValue = EventArgs.get_oldValue();
              Nametext .set_value(oldValue);
             
          }
          
       
  }
<telerik:RadTextBox ID="radtxtName" runat="server" >
   <ClientEvents OnValueChanged="TextChanged" />
    </telerik:RadTextBox>
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
1 answer
48 views
I need to hide edit link after clicking update for a row in grid.
Can this be done?

 

if (e.CommandName == "Update")

 

{

GridEditableItem editedItem = (e.Item as GridEditableItem);
/* do something here*/

 

editedItem.Visible =

false; //not working

 

editedItem.Edit =

false; // not working

 

 

}


Thanks
Princy
Top achievements
Rank 2
 answered on 03 Feb 2011
3 answers
141 views
Hi Guys,
                            I have another issue. Please help me....
Here is my issue. i have RadGrid which has Edit Pop up . And I have RadUPload in the RadGrid on Form Template. When i was trying to save this pdf files on server on click update event. ITs not getting or finding those files.............


Please any help.....
Thanks,Jaru
Shinu
Top achievements
Rank 2
 answered on 03 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?