Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
658 views
Hi
i have a column called image in my grid and this images i am binding from database and it's displaying in the radgrid but this image is not exporting to excel using Exporttoexcel command name.

what is the code/properties to export grid data with images into excel.



Thanks
Santosh
Shinu
Top achievements
Rank 2
 answered on 28 Dec 2012
1 answer
737 views
Hi,
I have added a dropdown in InsertItemTemplate as below:

<InsertItemTemplate>
<asp:DropDownList ID="ddlGender" runat="server">
 <asp:ListItem Text="Male" Value="Male"></asp:ListItem>
 <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
</asp:DropDownList>
</InsertItemTemplate>

How to add the dropdown in ItemTemplate as well as the EditItemTemplate of the RAD Grid.

How to set the selectedValue in the ItemTemplate and EditItemTemplate?

Thanks
Princy
Top achievements
Rank 2
 answered on 28 Dec 2012
0 answers
53 views
Hi,
I am inserting data in grid but i want to keep grid in edit mode if validation false. For that i am using e.canceled=true in else part.
But after that cancel is not working in one time i have to click it two times. Please help
 
 protected void rgBankAccount_UpdateCommand(object source, GridCommandEventArgs e)
        {
            if (ViewState["CommandName"] != null)
                strCommandName = ViewState["CommandName"].ToString();
            if (e.Item.OwnerTableView.Name == "Master")
            {
                UserControl ParentUserControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
                TextBox txtAccount = ParentUserControl.FindControl("txtAccount") as TextBox;
               //Label lblError = ParentUserControl.FindControl("lblError") as Label;
                RadDatePicker rdpAsof = ParentUserControl.FindControl("rdpAsof") as RadDatePicker;
                RadNumericTextBox RNTXTAccountNumber = ParentUserControl.FindControl("RNTXTAccountNumber") as RadNumericTextBox;
                RadNumericTextBox RNTXTBeginningBalance = ParentUserControl.FindControl("RNTXTBeginningBalance") as RadNumericTextBox;
                if (strCommandName == "Update")
                {
                    int AccountID = 0;
                    if (ViewState["AccountID"] != null)
                        AccountID = Convert.ToInt32(ViewState["AccountID"].ToString());
                    int AccountCount = objGetData.GetAccountExist(txtAccount.Text, AccountID, GroupID);
                    if (AccountCount == 0)
                    {
                        objUpdateData.UpdateBankAccount(AccountID, rdpAsof.SelectedDate.ToString(), txtAccount.Text,                        RNTXTAccountNumber.Text, Convert.ToDouble(RNTXTBeginningBalance.Text));
                        ViewState["AccountID"] = null;
                        lblError.Visible = false;
                     
                    }
                    else
                    {
                        lblError.Visible = true;
                        lblError.Text = "Please select another name";
                                             e.Canceled = true; *********************************** //// I have used it here
                    }
                }
                else
                {
                    int AccountCount = objGetData.GetAccountExist(txtAccount.Text, 0, GroupID);
                    if (AccountCount == 0)
                    {
                    objAddData.AddBankAccount(rdpAsof.SelectedDate.ToString(), txtAccount.Text, RNTXTAccountNumber.Text, Convert.ToDouble(RNTXTBeginningBalance.Text), GroupID);
                    lblError.Visible = false;
                    }
                    else
                    {
                        lblError.Visible = true;
                        lblError.Text = "Please select another name";
                       e.Canceled = true; *********************************** //// I have used it here
                    }
                }
            }
        }

Thanks
Manish
Manish
Top achievements
Rank 2
 asked on 28 Dec 2012
3 answers
260 views
Hi,

I am adding TreeListSelectColumn programatically:

 

 

Dim selectColmn As New TreeListSelectColumn()

 

selectColmn =

 

New TreeListSelectColumn()

 

selectColmn.HeaderText =

 

"select"

 

selectColmn.UniqueName =

 

"select"

 

RadTreeList1.Columns.Add(selectColmn)


and I have a template column for displaying Invoice # but column value is 'inv_id'

templateColumn =

 

New TreeListTemplateColumn()

 

templateColumn.HeaderText =

 

"Invoice #"

 

 

 

templateColumn.UniqueName = "inv_id"

 

templateColumn.ItemTemplate =

 

New InvTemplColumn(templateColumn.DataField)

 

RadTreeList1.Columns.Add(templateColumn)

After selecting few invoices I want to perform some actions like- export,print, for which I need inv_id of selected rows(inv_id is not visible in treelist), but I am not able to get inv_id of selected rows.Is there any option using which I can bind value to selectcolumn. Please let me know if you have any solution. It's very urgent.
Thanks in advance.

Shinu
Top achievements
Rank 2
 answered on 28 Dec 2012
0 answers
36 views

RadPane2 is hidden initially on my page. However, I have RadGrid1 in RadPane1, which is visible.

So when I select a row from RadGrid1, this causes the indexchanged event method to fire.  RadPane2.Visible is set to True in that method and I populate the detail fields.  Using the debugger, I see values going into those detail fields. Unfortunately, on my page RadPane2 does not refresh and show me those updated fields.

What am I missing? Any suggestions?


code:
----------------------------

        public void RadDataGrid1_IndexChanged(object sender, EventArgs e)
        {
            RadGrid grid = (sender as RadGrid);
 
            if (grid != null && RadDataGrid1.SelectedIndexes.Count > 0)
            {
                int index = grid.SelectedIndexes[0].GetIntOrZeroIfError();
 
                item = grid.Items[index];

                // Detail fields                  lblDetail_Name.Text = item["Name"].Text;
                lblDetail_Address.Text = item["Address"].Text;



                
                RadPane2.Visible = true;             }         }

----------------------------
Thanks,
Tammie

Tammie
Top achievements
Rank 1
 asked on 27 Dec 2012
2 answers
312 views
I have a grid where I would like to maintain the scroll position when an item in the grid is deleted, but I would like to reset the scroll position to the top when the page is changed.

I think it might be easier to set the SaveScrollPosition to true and reset the scroll on page change, but I am not sure how to implement this in the code behind.  I am using the "NeedDataSource" event to populate the grid.

Thanks.

-Angie
Angie
Top achievements
Rank 1
 answered on 27 Dec 2012
8 answers
1.0K+ views
I am trying to create two of my columns of telerik:GridBoundColumn as Hyperlinks. When the user clicks on the column a popup window comes with the value of the column and user can update that value. I am also using the SUM to add the columns(Price, Price2) and the Grand Total(That is sum of two columns Price, Price2).
I am able to do the SUM and the Grand Total but i am not able to make my two columns (Price and Price2) as links and when user click on the column Price or Price2 a window pops up with the value of the Column. Then the User can update the value and then it updates the SUM and the Grand Total.
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
   <telerik:RadGrid ID="RadGrid1" Width="100%" AllowSorting="True" ShowFooter="True" OnPreRender="RadGrid1_PreRender"
       PageSize="15" AllowPaging="True" OnItemDataBound="RadGrid1_ItemDataBound" AllowMultiRowSelection="True"
       ShowChooser="true" EnableLinqExpressions="False" runat="server" GridLines="None"
       AutoGenerateColumns="False" CellSpacing="0" DataSourceID="SqlDataSource1">
       <MasterTableView Width="100%" Summary="RadGrid table" RetrieveAllDataFields="false"
           DataSourceID="SqlDataSource1">
           <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
           <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
           </RowIndicatorColumn>
           <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
           </ExpandCollapseColumn>
           <Columns>
               <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" DataType="System.Int32"
                   SortExpression="ProductID" FilterControlAltText="Filter ProductID column" ReadOnly="True"
                   UniqueName="ProductID">
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="ID" HeaderText="ID" DataType="System.Int32" FilterControlAltText="Filter ID column"
                   SortExpression="ID" UniqueName="ID">
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" FilterControlAltText="Filter ProductName column"
                   SortExpression="ProductName" UniqueName="ProductName">
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="Price" HeaderText="Price" SortExpression="Price" UniqueName="price">
               </telerik:GridBoundColumn>
               <telerik:GridBoundColumn DataField="Price2" HeaderText="Price2" SortExpression="Price2" UniqueName=Price2>
               </telerik:GridBoundColumn>
         
           </Columns>
           <EditFormSettings>
               <EditColumn FilterControlAltText="Filter EditCommandColumn column">
               </EditColumn>
           </EditFormSettings>
       </MasterTableView>
       <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
       <FilterMenu EnableImageSprites="False">
       </FilterMenu>
   </telerik:RadGrid>
   <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Rajeev_DBConnectionString %>"
       SelectCommand="SELECT * FROM [product]"></asp:SqlDataSource>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using Telerik.Web.UI;
 
namespace Telerik_Master_Pages
{
    public partial class TestSum : System.Web.UI.Page
    {
 
        Decimal total;
        Decimal total2;
        Decimal grantotal;
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                Decimal fieldValue = Convert.ToDecimal(dataItem["Price"].Text);
                Decimal Fieldvalue2 = Convert.ToDecimal(dataItem["Price2"].Text);
 
 
                total += fieldValue;
                total2 += Fieldvalue2;
               // grantotal = fieldValue + Fieldvalue2;
            }
            if (e.Item is GridFooterItem)
            {
                grantotal = Convert.ToDecimal(total) + Convert.ToDecimal(total2);
 
                GridFooterItem footerItem = e.Item as GridFooterItem;
                footerItem["Price"].Text = "total: " + total.ToString();
 
                footerItem["Price2"].Text = "total Price2: " + total2.ToString() + "      " + " Grand Total " + grantotal;
 
                 
 
            }
 
 
           
        }
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
             
        }
 
    }
}
Rajeev
Top achievements
Rank 1
 answered on 27 Dec 2012
2 answers
94 views
Hi,

I am using the ImageManager in a RadEditor and wanted to remove the path at the top of the file area - what I believe is called the AddressBox.  I found instructions on your site and copied the EditDialogs folder and its content to my project.
I modified FileBrowser.ascx and specified VisibleControls="Grid,TreeView,ContextMenus,Toolbar" for the RadFileExplorer (i.e., excluded the AddressBox). 

When I try to build my solution I get the following 2 errors at lines 1771 thru 1780 in StyleBuilder.ascx:

Error    204    'Telerik.Web.UI.Editor.ColorPicker' does not contain a definition for 'ClientIDMode' and no extension method 'ClientIDMode' accepting a first argument of type 'Telerik.Web.UI.Editor.ColorPicker' could be found (are you missing a using directive or an assembly reference?)    C:\Visual Studio 2010 Jim\Projects\ITOptimizerNewDev\ITOptimizerWeb\StyleBuilder.ascx    1771

Error    205    The type or namespace name 'ClientIDMode' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)    C:\Visual Studio 2010 Jim\Projects\ITOptimizerNewDev\ITOptimizerWeb\StyleBuilder.ascx    1771   

If I remove the ClientIDMode="Static" from the 4 statements that include it, the build completes successfully and I get the result I was looking for - no AddressBox.

Any idea how to address these errors?

Thanks

Jim 

Jon
Top achievements
Rank 1
 answered on 27 Dec 2012
2 answers
239 views
I have been using VS2008 Pro for several years now.  Today I installed VS2012 Express [for Web] on my computer.  I would like to be able to do 3 things with my Telerik subscription:

  1. Install the Telerik controls in the Toolbox so I can use them with a New Project.
  2. Load my existing app into VS2012 and rest assured that the Telerik controls (ie. Treeview, Slider, ListBox, etc.) will just work.
  3. Install and use JustCode, if possible.

#1 & #2 are absolute requirements.  #3 is optional

Further to #1, I right-clicked in the Toolbox area of the VS2012 IDE and chose "Choose Items".  On the ".NET Framework Components" tab of the dialog box I chose Browse.  I navigated here: C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q3 2012\Bin45
Three files appeared:

  1. Telerik.Web.Design.dll
  2. Telerik.Web.UI.dll
  3. Telerik.Web.UI.Skins.dll

I tried clicking on the first two.  It said "Loading the selected file(s)"  Then later, when I pressed OK this message appeared: "The following controls were successfully added to the toolbox but are not enabled in the active designer:"  After that, no Telerik tools appeared in the Toolbox.

While I had hoped I could save the cost of buying VS2012 Professional, this is not a very good start.  Time is Money.

I would like a definitive answer from Telerik Support to my 3 questions above.  Can I do all of that with the Express version of VS2012: Yes or No?

Robert

Robert
Top achievements
Rank 1
 answered on 27 Dec 2012
0 answers
67 views
Hi ,

I have rad scheduler with drag and drop like this example
http://demos.telerik.com/aspnet-ajax/scheduler/examples/draganddropintegration/defaultcs.aspx?product=scheduler

How can i change dragging appointment style looks like appointment. its looks like grid record so i need to change 

Let me know 

Thanks,
Prasanna
Prasanna
Top achievements
Rank 1
 asked on 27 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?