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

I am setting up an upload form to allow a user to upload/crop/resize an image and save it to our server. Things work great except I don't want the save dialog. I want to save it to the specific location without them having to enter things. The saving it is not an issue. I have that working now. I just need to know how to eliminate the save dialog box that pops up when you click the toolbar save button?

 

I have looked through many articles but cannot find one that pertains just to this. Can I use a separate button outside of the editor and still get the cropped/resized image info?

Vessy
Telerik team
 answered on 17 Aug 2015
8 answers
739 views

I have a RadGrid and a RadComboBox outside of RadGrid (say comboOutside), inside a Web Form.
Inside RadGrid, there is 1 more RadComboBox (say comboRadGrid). On selection of items from comboOutside, comboRadGrid is bind i.e., If item 'Company' is selected from comboOutside, then all the company names will be bind in comboRadGrid; and then user select specific company from comboRadGrid and records are added in RadGrid.

For all items, functionality is working fine but I am facing issue in binding of a specific comboOutside item. i.e., When I choose a specific item from comboOutside, say I have 100 items inside comboOutside, and when I select 35th items from it, then comboRadGrid always throw this error while binding records for 35th item (since 35th item has 2000+ records to bind in comboRadGrid)
Error is attached below: 

Funcitonality is working fine for all the items except 1 specific item of RadComboBox. I don't understand why. Due to this I am unable to add records in RadGrid
Below is my code- 

C# code​

public DataTable GetAccCode(string CompanyCode)
    {
        SqlConnection con = new SqlConnection(strcon);
        SqlCommand cmd = new SqlCommand("[Invoice].[usp_tbl_AccountCode_DL_Test]", con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@CompanyCode", CompanyCode);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        try
        {
            con.Open();
            da.Fill(dt);
            con.Close();
        }
        catch (Exception ex)
        {
        }
        return dt;
    }
protected void RGGSTAcCode_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            //bind dropdwon while "Add"
            string CompanyCode = ddlCompany.SelectedValue.ToString();
            GridEditableItem item = (GridEditableItem)e.Item;
 
            //code to bind inside RadComboBox list  
            RadComboBox rcb = (RadComboBox)item.FindControl("ddlAccountCode");
            rcb.DataSource = GetAccCode(CompanyCode);
            rcb.DataTextField = "AccountDescription";
            rcb.DataValueField = "AccountCodeID";
            rcb.DataBind();
            rcb.Items.Insert(0, new RadComboBoxItem("- Select -", string.Empty));
 
            Session["AccCode"] = rcb.SelectedValue.ToString();
            string a = rcb.SelectedValue.ToString();
 
            //Select particular dropdown value while "Edit"
            Label lblAcCode2 = item.FindControl("lblAcCode2") as Label;
            if (!string.IsNullOrEmpty(lblAcCode2.Text))
            {
                rcb.SelectedValue = lblAcCode2.Text;
                rcb.SelectedItem.Text = lblAcCode2.Text;
            }
        }
    }
     //code to bind outside RadComboBox list
        protected void BindComapnyDL()
        {
            SqlConnection con = new SqlConnection(strcon);
            SqlCommand cmd = new SqlCommand("General.usp_tbl_BuyerCode_Query", con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            try
            {
                con.Open();
                da.Fill(dt);
                con.Close();
            }
            catch (Exception ex)
            {
            }
 
            ddlCompany.DataTextField = "Title";
            ddlCompany.DataValueField = "Code";
            ddlCompany.DataSource = dt;
            ddlCompany.DataBind();
 
            Session["Comp"] = ddlCompany.SelectedValue.ToString();
            string a = ddlCompany.SelectedValue.ToString();     
        }
 
        //RadComboBox select index changed event
        protected void ddlCompany_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (ddlCompany.SelectedValue == null || ddlCompany.SelectedValue == "")
            {
                GridCommandItem cmditem = (GridCommandItem)RGGSTAcCode.MasterTableView.GetItems(GridItemType.CommandItem)[0];
                System.Web.UI.WebControls.Button ctrl = (System.Web.UI.WebControls.Button)cmditem.FindControl("AddNewRecordButton");
                ctrl.Enabled = false;
 
                System.Web.UI.WebControls.LinkButton btn = (System.Web.UI.WebControls.LinkButton)cmditem.FindControl("InitInsertButton");
                btn.Enabled = false;
 
                string content = "Please select company first";
                ScriptManager.RegisterStartupScript(this, typeof(string), "Successful", "alert('" + content + "');", true);
            }
            else
            {
                RGGSTAcCode.Rebind();
            }
        }

HTML Code:

 

<telerik:RadComboBox ID="ddlCompany" runat="server" Height="200" Width="240"
          DropDownWidth="310" EmptyMessage="- Select Product -" HighlightTemplatedItems="true" CausesValidation="false"
          Filter="Contains" AppendDataBoundItems="true" AllowCustomText="true" AutoPostBack="true"
          DataTextField="Title" DataValueField="Code" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
        </telerik:RadComboBox>
 
<telerik:RadGrid ID="RGGSTAcCode" runat="server"
                   ShowFooter="True" GroupingEnabled="False" ShowStatusBar="true" EmptyDataText="No record available."
                   AllowAutomaticInserts="False" AllowAutomaticUpdates="False" AllowAutomaticDeletes="true"
                   OnNeedDataSource="RGGSTAcCode_NeedDataSource" OnItemDataBound="RGGSTAcCode_ItemDataBound"
                   OnInsertCommand="RGGSTAcCode_InsertCommand" OnDeleteCommand="RGGSTAcCode_DeleteCommand"
                   OnUpdateCommand="RGGSTAcCode_UpdateCommand" OnItemCommand="RGGSTAcCode_ItemCommand">
                  <mastertableview ShowHeadersWhenNoRecords="true" autogeneratecolumns="false" datakeynames="AccountCodeID" InsertItemDisplay="Top"
                    insertitempageindexaction="ShowItemOnCurrentPage" ShowFooter="True" CommandItemDisplay="Top" ClientIDMode="Static">                                  
                         <Columns>
                             <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
 
                             <telerik:GridTemplateColumn UniqueName="AccountCode" HeaderText="Account Code">
                                <ItemTemplate>
                                  <asp:Label ID="lblAcCode" runat="server" Text='<%# Eval("AccountCode")%>'></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                   <asp:Label ID="lblAcCode2" runat="server" Text='<%# Eval("AccountCode") + " - " + Eval("AccountDescription")%>' Visible="false"></asp:Label>
 
                                   <telerik:RadComboBox ID="ddlAccountCode" runat="server" Height="200" Width="240"
                                       DropDownWidth="310" HighlightTemplatedItems="true" CausesValidation="true"
                                       Filter="Contains" AppendDataBoundItems="true" DataTextField="AccountDescription" DataValueField="AccountCodeID">
                                   </telerik:RadComboBox>
                                </EditItemTemplate>
                             </telerik:GridTemplateColumn>
 
                             <telerik:GridBoundColumn DataField="AccountDescription" HeaderText="Description" UniqueName="AccountDescription" SortExpression="AccountDescription" InsertVisiblityMode="AlwaysHidden" ReadOnly="true" ></telerik:GridBoundColumn>
                             <telerik:GridBoundColumn aggregate="SUM" DataField="Amount" HeaderText="Amount" FooterAggregateFormatString="Total : {0:###,##0.00}" DataFormatString="{0:n}" FooterStyle-BackColor="#ffc04c" UniqueName="Amount" SortExpression="Amount"></telerik:GridBoundColumn>
                             <telerik:GridBoundColumn DataField="Remark" HeaderText="IFCA Remark" UniqueName="Remark" SortExpression="Remark">
 
                             </telerik:GridBoundColumn>   
 
                             <telerik:GridButtonColumn ConfirmTextFormatString="Are you sure you want to Delete {0} Account Code?" ConfirmTextFields="AccountCodeID"
                             ConfirmDialogType="RadWindow" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"></telerik:GridButtonColumn>                                                                           
                      </Columns>
                      <EditFormSettings>
                         <EditColumn ButtonType="ImageButton" />
                      </EditFormSettings>
                      <CommandItemSettings AddNewRecordText="Add new record" RefreshText="Refresh"></CommandItemSettings>
                  </mastertableview>
                </telerik:RadGrid>

 Please let me know how to resolve. What shall I change in my code.

I have to populate/bind the RadComboBox (comboRadGrid) which is inside of RadGrid, based on the Items that are outside of RadGrid of RadComboBox (comboOutside). Please note that I am very new in Telerik and asp.net Please let me know how to modify my comboRadGrid binding code (based on outside Combo List items) so that this issue do not occur again ? Please reply​

 

Eyup
Telerik team
 answered on 17 Aug 2015
2 answers
100 views
Hello, I am having the issue that when one of our customers uses the ExportToCSV functionality, the resulting CSV has an HTML line break (<br/>) in it.  Is there a way to prevent this from happening?
Jeff
Top achievements
Rank 1
 answered on 17 Aug 2015
11 answers
757 views
Hi All,

I want to use custom shape, means an image instead of circles/rectangles. Do anybody have any idea to do this.

Thanks in Advance,
Shaikh
Vessy
Telerik team
 answered on 17 Aug 2015
1 answer
145 views
I am using the Telerik Ajax controls in a Single Page App type scenario. I use the client side API of the Telerik controls combined with web service calls when I need to communicate with the server. I can't post back the page as it is currently implemented or I will have all kinds of lost client state issues to contend with. However, I need to be able to upload single files from the client to the server through this SPA page. Can the AsycnUpload control support such a scenario? It seems that all of the demos demonstrate the need to post back the page. I guess I could open a secondary page in a popup RandWindow and have this window do the uploading, but this is not very seamless. -Thanks for your thoughts.
Ivan Danchev
Telerik team
 answered on 17 Aug 2015
2 answers
82 views

With 1 dock in a dockzone it works fine (picture 1)

but with 2 docks, the previous dock's header is being cut off. (picture 2)

anyway to fix this?

I've tried increasing div.RadDock.rdCollapsed height.  Does not help.

Danail Vasilev
Telerik team
 answered on 17 Aug 2015
4 answers
225 views
Team,

In my scenario, I have an autogenerated Radgrid control to bind two Bound columns and remaining columns are Dropdown list. The bound and dropdown list control is binded in Grid. But when I try to get the value from the Dropdown list, I can't able to get the control Id (even i used FindControl).

IN ASPX
----------
 <telerik:RadGrid ID="dgPassanger" runat="server" AllowSorting="true" Visible="true"
                                            PageSize="5" AllowPaging="true" AllowFilteringByColumn="true" PagerStyle-AlwaysVisible="true"
                                            OnItemDataBound="Passenger_ItemDataBound" Width="715px">
                                            <MasterTableView CommandItemDisplay="None" AllowFilteringByColumn="false" AutoGenerateColumns="true">
                                                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                                            </MasterTableView>
                                            <ClientSettings>
                                                <Scrolling AllowScroll="true" />
                                                <Selecting AllowRowSelect="true" />
                                            </ClientSettings>
                                        </telerik:RadGrid>

IN ASPX.CS
---------------
        protected void PreparePaxGrid(List<Passenger> PaxList)
        {
            DataTable pivotedList = new DataTable();
            try
            {
                if (Session["PostflightTrip"] != null)
                {
                    TripLog = (PostflightTrip)Session["PostflightTrip"];

                    // Adding Dynamic Columns
                    GridBoundColumn boundColumn;
                    GridTemplateColumn templateColumn;
 
                    boundColumn = new GridBoundColumn();
                    boundColumn.DataField = "PaxCode";
                    boundColumn.HeaderText = "Pax Code";
                    dgPassanger.MasterTableView.Columns.Add(boundColumn);

                    boundColumn = new GridBoundColumn();
                    boundColumn.DataField = "PaxName";
                    boundColumn.HeaderText = "Pax Name";
                    dgPassanger.MasterTableView.Columns.Add(boundColumn);

                    foreach (var item in TripLog.TripLegs)
                    {

                        templateColumn = new GridTemplateColumn();
                        templateColumn.HeaderText = item.POLegsDescription;
                        templateColumn.ItemTemplate = new GridTemplate(item.LegID); // Bind Dropdown List
                        templateColumn.UniqueName = "FlightPurpose";

                        dgPassanger.MasterTableView.Columns.Add(templateColumn);
                    }

                    // Bind List into Grid
                    dgPassanger.DataSource = PaxLegList;
                    dgPassanger.DataBind();

                }
            }
            catch (Exception ex) { }
        }

        private class GridTemplate : ITemplate
        {
            protected DropDownList ddList;
            private int _legId = 0;

            public GridTemplate(int legId)
            {
                _legId = legId;
            }

            public void InstantiateIn(System.Web.UI.Control container)
            {
                ddList = new DropDownList();
                ddList.ID = "ddlFP" +_legId.ToString();
                ddList.DataBinding += new EventHandler(ddList_DataBinding);
                container.Controls.Add(ddList);
            }

            protected void ddList_DataBinding(object sender, EventArgs e)
            {
                DropDownList dl = (DropDownList)sender;
                GridDataItem container = (GridDataItem)dl.NamingContainer;
                dl.Items.Add(new ListItem("1","1"));
                dl.Items.Add(new ListItem("2", "2"));
                //dl.AutoPostBack = true;
                //dl.SelectedIndexChanged += new EventHandler(DisplayDDList_IndexChanged);
            }
        }

For Retrieving Value from Dropdown, I used the below code
 foreach (GridDataItem Item in grid.MasterTableView.Items)
                {

                    DropDownList ddlFlightPurpose = (DropDownList)Item["FlightPurpose"].FindControl("ddlFP1");

}

ISSUE: Every time it shows the NULL value.

Please resolve as soon as possible.
Gajanan
Top achievements
Rank 2
 answered on 17 Aug 2015
10 answers
640 views
hi want to add rad controls dynamically in rad grid .After clicking edit dependin on the value of category id row should have checkbox,drop down,textbox
category id =0 -->checkbox
category id =1 -->dropdown
category id=2-->textbox

following is th aspx code

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RadCont.ascx.cs" Inherits="RadCont" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<table id="Tab">

    <tr>
        <td>
        <asp:SqlDataSource
            ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CAAConnectionString %>"
            SelectCommand="SELECT [name] FROM [record_status]">
        </asp:SqlDataSource>
       
       
            <telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="False" runat="server" GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound">
           
            <MasterTableView  DataKeyNames="CategoryId">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="ParameterVal" Name="Value">
                   
               
                </telerik:GridTableView>
            </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" DataField="Name" HeaderButtonType="TextButton" UniqueName="ShortName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  SortExpression="CategoryId" HeaderText="Id" DataField="CategoryId" HeaderButtonType="TextButton" Visible="False" Display="False" UniqueName="CategoryId"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" DataField="Description" HeaderButtonType="TextButton" UniqueName="Description"></telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn UniqueName="EditCol">
                    </telerik:GridEditCommandColumn>
                </Columns>
               
                <EditFormSettings EditFormType="Template">
                    <EditColumn UniqueName="EditCol">
                   
                    </EditColumn>
                    <FormTemplate>
                        <table id="Table1">
                        <tr>
                           
                       
                        </tr>
                       
                       
                        </table>
                   
                   
                    </FormTemplate>
                    <PopUpSettings ScrollBars="None" />
                </EditFormSettings>
                <ExpandCollapseColumn Resizable="False" Visible="False">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
            </MasterTableView>
            <ClientSettings AllowColumnsReorder="True">
               
            </ClientSettings>
            </telerik:RadGrid>
        </td>
   

    </tr>



</table>
Gajanan
Top achievements
Rank 2
 answered on 17 Aug 2015
1 answer
249 views

Hi Team,

Hi tried to access the radgrid inside another radgrid  but  Iam not succeed ...How i suppose to access rad grid ...

 

hi have 

 

<telerik:radgrid id="rgparent" runat="server">

<mastertable>

<nestedview>

<teleri:radgrid id="rgchild" runat="server">

</telerik:radgrid>

</nested>
</mastertable>
</telerik:radgrid>

 

 

 

How may i suppose to access the  "rgchild" clinet side  not server side...

Eyup
Telerik team
 answered on 17 Aug 2015
4 answers
658 views

Hi there,

 I need a hand on how to achieve this.  I have a page with a dynamically loaded treeview working fine on the left, and content on the right based on the tree view node that has been clicked.  When the content on the right is saved, it needs to reload both that content and the treeview - because the treeview might change based on the right content save.  I'm doing a full page reload, passing through the selected treeview node ID in the URL.

On reloading, I need the selected ID node to be selected still (this is working fine), but also I need :-

- the treeview to be expanded down to that node so that the selected node is visible to the user
- to trigger the click even of that node such that the content on the right is reloaded from that event as currently

How can I achieve this?  I can't find any loaded/rendered event to work with (I tried the page document.ready event but the treeview isn't available to the DOM at that point so threw an error, and also the dataBound event of the treeview but that didn't seem to trigger either, it just did nothing).

Any help would be appreciated.

Thanks, Mark

Mark
Top achievements
Rank 1
 answered on 17 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?