Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
224 views
Hello,

I want to transfer an item in a listbox to another listbox like in this example : http://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/templates/defaultcs.aspx
My problem is when I transfered an item in the second lisbox the item is empty (see the attached file).

<telerik:RadListBox ID="RLB_References" runat="server" Width="360px" TransferToID="RLB_SelectedReference"
    AutoPostBackOnTransfer="True" AllowTransfer="True" OnTransferred="RLB_References_Transferred">
    <HeaderTemplate>
        <table>
            <tr>
                <td width="80px">Titre</td>
                <td width="80px">Référence</td>
                <td width="80px">Taille</td>
                <td width="80px">Coloris</td>
            </tr>
        </table
    </HeaderTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td width="90px">
                    <%# DataBinder.Eval(Container.DataItem, "Titre") %>
                </td>
                <td width="90px">
                    <%# DataBinder.Eval(Container.DataItem, "Reference") %>
                </td>
                <td width="90px">
                    <%# DataBinder.Eval(Container.DataItem, "Taille") %>
                </td>
                <td width="90px">
                    <%# DataBinder.Eval(Container.DataItem, "Coloris") %>
                </td>
            </tr>
        </table>  
    </ItemTemplate>
</telerik:RadListBox>
 
<telerik:RadListBox ID="RLB_SelectedReference" runat="server" Width="400px">
     <HeaderTemplate>
        <table>
            <tr>
                <td width="80px">Titre</td>
                <td width="80px">Référence</td>
                <td width="80px">Taille</td>
                <td width="80px">Coloris</td>
                <td width="80px">Quantité</td>
            </tr>
        </table
    </HeaderTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td width="80px">
                    <%# DataBinder.Eval(Container.DataItem, "Titre") %>
                </td>
                <td width="80px">
                    <%# DataBinder.Eval(Container.DataItem, "Reference") %>
                </td>
                <td width="80px">
                    <%# DataBinder.Eval(Container.DataItem, "Taille") %>
                </td>
                <td width="80px">
                    <%# DataBinder.Eval(Container.DataItem, "Coloris") %>
                </td>
                <td width="80px">
                    <telerik:RadNumericTextBox runat="server" ID="QuantityTextBox" Width="50px" MinValue="1"
                        ShowSpinButtons="true" Value="1" NumberFormat-DecimalDigits="0">
                    </telerik:RadNumericTextBox>
                </td>
            </tr>
        </table>  
    </ItemTemplate>
</telerik:RadListBox>

private string GetArticleTitle(int nodeId)
    {
        return "title";
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            List<tbl_references> references = null;
            using (ReferenceContainer context = new ReferenceContainer())
            {
                references = context.tbl_references.ToList();
            }
            var datasource = from r in references
                             let reference = r.Reference
                             let taille = r.Taille
                             let coloris = r.Coloris
                             let titre = GetArticleTitle(r.ArticleNodeId)
                             select new
                             {
                                 Reference = reference,
                                 Taille = taille,
                                 Coloris = coloris,
                                 Titre = titre
                             };
            RLB_References.DataSource = datasource;
            RLB_References.DataBind();
        }
    }
 
    protected void RLB_References_Transferred(object sender, Telerik.Web.UI.RadListBoxTransferredEventArgs e)
    {
        foreach (RadListBoxItem item in e.Items)
        {
            item.DataBind();
        }
    }

Have you a solution ?

Thanks.
Peter Milchev
Telerik team
 answered on 06 Sep 2019
1 answer
116 views

    I'd like to use the telerik radgrid control to generate an excel export of data, however, I don't want to display the grid on the web page.  Is there a way to do this?

 

Thanks in advance.

Attila Antal
Telerik team
 answered on 06 Sep 2019
7 answers
617 views
Hello all,

I just can't figure out how to add a checkbox to a second level (of a 3 level) grouping without loosing the data that is there.

for instance 

--Dept
----<check box here> Employee
--------Projects


I am able to add the check box like this:

 if (e.Item is GridGroupHeaderItem ) 
            { 
                 
                GridGroupHeaderItem item = e.Item as GridGroupHeaderItem; 
 
                if ( item.GroupIndex.LastIndexOf("_") == 1) 
                { 
                     
                    DataRowView groupDataRow = (DataRowView)e.Item.DataItem; 
                    CheckBox check = new CheckBox(); 
                    check.AutoPostBack = false
                    check.ID = "foo"
                    check.Text = this._headerTextForEmployeeName + " FirstName - LastName";     
                 
                    check.CheckedChanged += new EventHandler(check_CheckedChanged); 
                    item.DataCell.Controls.Add(check); 
                 
                    } 
 
                } 

But this REPLACES the header text and value that was there!!
Any ideas or suggestions?


Attila Antal
Telerik team
 answered on 06 Sep 2019
1 answer
1.8K+ views

Hello,

i want to use RadGrid in asp.net with dynamical columns with different widths. There is no autosizing like autofit. I tried it with javascript. It works but it isnt a good solution. I tried here with some functions, but nothing happens on sizing. Only text will be changed. Visible unvisible is also not working. I think telerik is in grid a very bad solution.

 

in page:

 

 <telerik:RadGrid ID="rgrdSuche" runat="server" Culture="de-DE" OnColumnCreated="rgrdSuche_ColumnCreated" OnSortCommand="rgrdSuche_SortCommand">
                <MasterTableView AutoGenerateColumns="true" AllowFilteringByColumn="false">
               
                </MasterTableView>               
            </telerik:RadGrid>

 

 

i tried with the event itemdatabound, but nothing happened:

 

 protected void rgrdSuche_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                if (e.Item is GridHeaderItem)
                {
                    GridHeaderItem headerItem = e.Item as GridHeaderItem;

                    for (int i = 0; i < headerItem.Cells.Count; i++)
                    {
                        switch (headerItem.Cells[i].Text.Replace(" ", ""))
                        {
                            case "Comment":
                                headerItem.Cells[i].Text = "Comment-Text";
                                headerItem.Cells[i].Width = Unit.Pixel(400);
                                break;
                            default:
                                break;
               ...

 

and event via ColumnCreated will not work also:

 

  protected void rgrdSuche_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            switch (e.Column.UniqueName)
            {
                case "Comment":
                    e.Column.Visible = false;
                    e.Column.HeaderText = "Comment-Text";
                    e.Column.HeaderStyle.Width = Unit.Pixel(400);
                    e.Column.FilterControlWidth = Unit.Pixel(400);
                 break;

 

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 05 Sep 2019
2 answers
317 views

Hi,

We are looking to include the month and year lines for the x-axis, could you please view the image and let me know if there is a way to do that.

Thank you,

-Sam

 

Sam
Top achievements
Rank 1
 answered on 05 Sep 2019
5 answers
559 views

 

Is there a way to clear a multi check rad combo box without postback or is there a clear button already built into the control? 

Alex

Rumen
Telerik team
 answered on 05 Sep 2019
1 answer
345 views

Dear users,

 

 

I need to know the last version of Telerik UI that i can use with .NET 3.5 , currently i'm using 2012.1.411.35.

 

Thank you in advance,

Cordially

Rumen
Telerik team
 answered on 05 Sep 2019
12 answers
2.4K+ views
(Q2 2009 version)
Hi, i'm triying to export to excel from my radgrid from buttons on <commandItemTemplate>  tags like this

<MasterTableView CommandItemDisplay="Top" CellSpacing="0" ShowGroupFooter="true" AllowMultiColumnSorting="true" ShowFooter="true" DataKeyNames="NombreTipoCuenta" >                                                                                     
                                        <CommandItemTemplate> 
                                            <asp:ImageButton runat="server" ID="btnExcelExport" ImageUrl="~/images/page_excel.png" OnClick="btnExcelExport_Click" AlternateText="Excel" ToolTip="Excel" />  
 
                                                                                                                                
                                        </CommandItemTemplate> 

but when i click on my button, commanditem hides, and doesn`t work , when i copy this outside the grid it works

<asp:ImageButton runat="server" ID="btnExcelExport" OnClick="btnExcel_Click" ImageUrl="~/images/page_excel.png"  AlternateText="Excel" />  
                                 <telerik:RadGrid   
                                            AutoGenerateColumns="False"  
                                            ID="tk_Grid"  
                                            AllowPaging="True"  
                                            PageSize="20"  
                                            runat="server"  
                                            GridLines="None" 
                                            ShowFooter="false"  
                                            ShowGroupPanel="false" 
                                            style="margin-top: 0px"  
                                            BorderStyle="None"                                              
                                            CssClass="Grid" onitemdatabound="tk_Grid_ItemDataBound" Skin="Default" 
                                            >                                                                      

this is the code behind for both mehods
 protected void btnExcelExport_Click(object sender, ImageClickEventArgs e) 
    { 
 
        tk_Grid.ExportSettings.ExportOnlyData = true
        tk_Grid.ExportSettings.IgnorePaging = true
        tk_Grid.ExportSettings.OpenInNewWindow = false
        tk_Grid.MasterTableView.ExportToExcel(); 
    } 

thanks, Gino.




Kalai
Top achievements
Rank 1
 answered on 05 Sep 2019
1 answer
128 views

Hi,

I have been trying to use programmatic binding based on the following demo https://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx but have been having a problem in getting the key value back into the asp.net code behind.

 

The code is (effectively) the same as the example except I am binding to an entity that has a Guid as a key rather than the EmployeeId in the example and I have added a "delete" button using the following

          <telerik:GridButtonColumn UniqueName="DeleteButtonColumn" ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure?" ConfirmDialogType="Classic" ConfirmTitle="Are you sure?" />

I have set up the DataKeyNames and ClientDataKeyNames in the MasterTableView to be DataKeyNames="GUID" and ClientDataKeyNames="GUID"

In the code behind I have added an ItemCommand event that gets called, however

(GridDataItem)e.Item.GetDataKeyValue("GUID") is blank

(GridDataItem)e.Item.KeyValues contains "{GUID:""""}"

 

Can I use programmatic binding method with a GridButtonColumn with type ImageButton in this way?

Attila Antal
Telerik team
 answered on 04 Sep 2019
2 answers
375 views

Hi Telerik Team,

 

Our company is working on upgrade application to cloud environment. We are using RadAsyncUpload control on teleirk 2014.2.724.40 version and found  an issue with TemporaryFolder. Can we customized how to read / write files in TemporaryFolder ?

 

Thanks in advance,

Lan

lan luo
Top achievements
Rank 1
Iron
 answered on 04 Sep 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?