Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
75 views
Firstly, i select with
combo.SetText("abc")

it works but when page is going to postback it clears the combo

then i get the item

 

item = combo.FindItemByText("abc");
item.Select()

it works in postback ...but when i use tab button to treverse more control...it again clear or select any other item...

please help to select the combo wrt to above problems

thanks

Shinu
Top achievements
Rank 2
 answered on 29 Apr 2013
1 answer
82 views
Hello everyone ,

i've database contain some data :
Name
Age
Image Dbtype " Image "

i already created this database

now i want to add data in it , and am using binary image to show the image , how can i upload the image in the grid and after upload it , to be shown
Princy
Top achievements
Rank 2
 answered on 29 Apr 2013
3 answers
255 views
Hi guys,

I currently have a RadGridView that populates data from a SQL database, i have added a 'telerik:GridTemplateColumn' with a Delete hyperlink inside of it.

<telerik:GridTemplateColumn UniqueName="TemplateDeleteColumn">
<ItemTemplate>
<asp:HyperLink ID="DeleteLink" runat="server" Text="Delete"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>

What happens is, when the gridView populates every row now has a delete link in it. How would i go about using C#  to delete that specific record from the SQL database
Princy
Top achievements
Rank 2
 answered on 29 Apr 2013
3 answers
514 views
We have the requirement that for a textbox with autocomplete functionality that submits when an asp button is clicked or the user presses enter while the textbox has focus (the use may have entered or selected from the dropdown).

We also need the AllowCustomEntry functionality that RadAutoCompleteBox supplies.

I cannot seem to find a solution in the Telerik tools:
-  RadAutoCompleteBox does not submit on enter. Via JQuery I was able to detect enter and run the click event for my button which submitted to the server ok but the text field for the RadAutoCompleteBox  was blank. When I added a focus event (for the button) before the click event my solution did work in Chrome but not in IE. 

- RadSearchBox. This control does submit on enter but it does not behave like a true text box. That is it does not display the value entered after the selection is made and does not seem to support an ASP button to kick off the search (this is part of the look and feel of our application). It also submits as soon as you select from the drop down which could be confusing for our users.

RADAutoCompleteBox is the closest solution but the fact that it does not post back to the server when enter is pressed is a show stopper for us. Apart from running the JQuery focus event prior to the button click event do you know of any other action I might take.

What I really would like is an autocomplete box that supported a 2 step process: the user selects the entry from the dropdrown which is displayed in the text box and then the user can either press enter or click on the search button to post the text back to the server.

I hope that this is not too much feedback and my questions are clear. Cheers
Peter
Top achievements
Rank 1
 answered on 28 Apr 2013
1 answer
157 views
Hello,

I have two RadListBoxes and a button in my page, my requirement is after clicking the button the selected items in RadListBox1 should move to RadListBox2.

<telerik:RadListBox ID="RadListBox1" Width="200px" Height="300px"
     SelectionMode="Multiple" runat="server"></telerik:RadListBox>
<telerik:RadListBox ID="RadListBox2" Width="300px" Height="300px" runat="server">
     </telerik:RadListBox>

void button1_Click(object sender, EventArgs e)
{
  foreach (RadListBoxItem selectedItem in RadListBox1.SelectedItems)
  {
     RadListBox2.Items.Add(
new RadListBoxItem(selectedItem.Text));
  }
}

My problem is every time I click the button its removing already present item in RadListBox2 and adding the the currently selected item of RadListBox1. I want it to append the item to the already existing items of RadListBox2.

Can anyone help me here please.

Thanks,
Saquib
Saquib
Top achievements
Rank 1
 answered on 28 Apr 2013
2 answers
220 views
I'm using the embedded skin "Office2010Black" for my RadGrid.  Everything looks and works great except the label "Page Size" color on the page panels is black. Which makes it almost invisible on the dark gray background. The actual page numbers and the page count and item count are all white on dark gray.  So those are fine.

I've tried setting forecolor to white in the PagerStyle and I've try specifying a CSS with color=white for PagerStyle too.  No help with either of hese.  I tried creating a custom skin based on Office2010Black, but got stuck when I couldn't get the page radcombobox to display correctly and gave that up.

I can't see where I might be affecting this, but I can't believe that there is this issue with this skin (I aslo had the same problem when I tried the "Black" embedded skin too. ).  Here's the mark-up code:

<telerik:RadGrid ID="rgLog" runat="server" ShowGroupPanel="False" AllowPaging="true"
     ItemStyle-BackColor="#ffe394" BackColor="White" Visible="true"
     Height="200" PageSize="25"
     Skin="Office2010Black" AllowSorting="true" AutoGenerateColumns="false" BorderWidth="0px"
     Width="1000" AllowCustomPaging="True"
     OnNeedDataSource="rgLog_NeedDataSource" OnItemDataBound="rgLog_ItemDataBound">
 
     <AlternatingItemStyle BackColor="White" />
     <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowGroupExpandCollapse="True"
         ReorderColumnsOnClient="True" AllowDragToGroup="False">
         <Scrolling AllowScroll="False" UseStaticHeaders="True" />
         <Resizing AllowColumnResize="true" AllowRowResize="true" />
     </ClientSettings>
     <GroupingSettings ShowUnGroupButton="False" />
     <PagerStyle AlwaysVisible="true" Position="TopAndBottom" />
      
     <MasterTableView TableLayout="Fixed" CommandItemDisplay="Top">
         <NoRecordsTemplate>
             <br />
             No Records matched this search.<br />
             <br />
         </NoRecordsTemplate>
         <CommandItemSettings ShowExportToWordButton="false" ShowExportToExcelButton="false"
             ShowExportToCsvButton="true" ShowExportToPdfButton="false" ShowAddNewRecordButton="false" />
         <Columns>
             <telerik:GridTemplateColumn HeaderText="View Events" ItemStyle-HorizontalAlign="Center">
                 <ItemTemplate>
                     <a href="<%# GetURL( Eval("Number")) %>">
                         <img src='images/1258747021_old-edit-find.png' alt="View Detail" border="0" />
                     </a>
                 </ItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridTemplateColumn HeaderText="View Report" ItemStyle-HorizontalAlign="Center">
                 <ItemTemplate>
                     <a href="<%# GetChartURL( Eval("Number")) %>">
                         <img src='images/1259005159_pie_chart_search.png' width="24" alt="View Detail" border="0" />
                     </a>
                 </ItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridBoundColumn DataField="Number" Visible="false" />
             <telerik:GridBoundColumn DataField="Percent %" HeaderText="% of Total" ItemStyle-HorizontalAlign="Right"
                 DataFormatString="{0:p}" />
             <telerik:GridBoundColumn DataField="COUNT" HeaderText="Event Count" ItemStyle-HorizontalAlign="Right"
                 DataFormatString="{0:###,###,###}" />
         </Columns>
     </MasterTableView>
      
 </telerik:RadGrid>

Any help or suggestions on this are appreciated..
Hunter
Top achievements
Rank 1
 answered on 28 Apr 2013
0 answers
125 views
I have the following Column in my RadGrid,

<Telerik:DDLGridColumn UniqueName="ProductType"
                    Query="select Name AS ProductType, ID AS ProductTypeID From ProductTypes WHERE RetailerID={1}"
                    GetRetailerIDFromSession="True"
                    DataField="ProductType" DataValueField="ProductTypeID"
                    HeaderText="ProductType" SortExpression="ProductType">
                    <ItemTemplate>
                        <%# Eval("ProductType")%>
                    </ItemTemplate>
</Telerik:DDLGridColumn>

This is the code,

    
public class DDLGridColumn: GridTemplateColumn
    {
        protected override void SetupFilterControls(System.Web.UI.WebControls.TableCell cell)
        {
            RadComboBox rcBox = new RadComboBox();
            rcBox.ID = this.UniqueName + "_rcbox";
            rcBox.AutoPostBack = true;
            rcBox.DataTextField = this.DataField;
            rcBox.DataValueField = DataValueField ?? this.DataField;
            rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged;
            rcBox.Width = FilterControlWidth;
            string query = query = string.Format(this.Query, this.DataField);
            DataTable table = DBLayer.GetDataTable(query, CommandType.Text);
            DataRow row = table.NewRow();
            table.Rows.InsertAt(row, 0);
            rcBox.DataSource = table;
            cell.Controls.Add(rcBox);
        }
        private void rcBox_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
        }
        protected override void SetCurrentFilterValueToControl(TableCell cell)
        {
            if (!(this.CurrentFilterValue == ""))
            {
                ((RadComboBox)cell.Controls[0]).Items.FindItemByValue(this.CurrentFilterValue).Selected = true;
            }
        }
        protected override string GetCurrentFilterValueFromControl(TableCell cell)
        {
            string currentValue = ((RadComboBox)cell.Controls[0]).SelectedItem.Value;
            this.CurrentFilterFunction = (currentValue != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
            return currentValue;
        }
    }

I want the RadComboBox to filter with ID, but on UI it should show name. Is it possible
ABC
Top achievements
Rank 1
 asked on 28 Apr 2013
0 answers
80 views
Dear Telerik.
I am a beginner ASP.NET AJAX (Visual studio 2010 (4.0)).

 I want to Telerik help me code with '3 tier', use SQL Server (2008): same this website: http://demos.telerik.com/aspnet-ajax/carrental/

 However, my only concern is this part same bellow image:
Image 'snapshot_2013-04-28_144645.png'. Hover over a Item Car Product a tooltip appearance have any Information of that Item Car Product.

 And when click Item(a car product) appearance a window same bellow image:
Image link 'snapshot_2013-04-28_150445.png'

I don't need Tab 'Schedule & Reservation' only need Tab 'Information'.

If can, Telerik detailed instructions by "file.doc" step by step, I can learn.
Thank you Telerik.

Trân nhân
Top achievements
Rank 1
 asked on 28 Apr 2013
0 answers
146 views
Hi,
I have a combo box in edit mode of a telerik grid, but I am getting null value for selected value on onchange event. Please see code below

partail view:

 

 

Html.Telerik().ComboBox().Name("StyleImage").ClientEvents(events => events
.OnChange("onChange")
 )

here is js code

function onChange(e) {
    alert(e.value);
}

 here is grid onedit

function Grid_onEdit(e) {
           var styleImage = $('#StyleImage').data('tComboBox');
            $.getJSON(appUrl("Controller/Action"),
                { styleId: styleValue },
                function (data) {
                    styleImage.dataBind(data.value);
                    styleImage.value(e.dataItem['DefaultImage']);
                }
            );
        }
 
    }

 Here is controller code

public JsonResult Action(string styleId)
       {
          List<string> images=new List<string>();           
          return Json(new { success = true, value = images }, JsonRequestBehavior.AllowGet);
       }

this is how I am seeing rendered code for combo box
<div class="t-animation-container" style="width: 150px; height: 214px; position: absolute; z-index: 10002; top: 382.817px; left: 599.733px; display: none;">

<div class="t-popup t-group" style="display: block; height: auto; overflow: auto; width: 148px; margin-top: -214px;">
<ul class="t-reset">
<li class="t-item" unselectable="on">GWTUTU2-BRMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-PIMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-SILTX</li>
<li class="t-item t-state-selected" unselectable="on">GWTUTU2-BLMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-YELLL</li>
<li class="t-item" unselectable="on">GWTUTU2-MPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-DPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-BUMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-BLKLL</li>
<li class="t-item" unselectable="on">GWTUTU2-DGRLL</li>
</ul>
</div>
</div>



Thanks..
simmaneni
Top achievements
Rank 1
 asked on 28 Apr 2013
0 answers
131 views

I figured out how to set defaults for the multiple check boxes.

Here is my example:

DataTable tableMonths = new DataTable();
tableMonths.Columns.Add("name", typeof(int));
tableMonths.Columns.Add("value", typeof(string));
tableMonths.Rows.Add(12, "12");
tableMonths.Rows.Add(24, "24");
tableMonths.Rows.Add(36, "36");
tableMonths.Rows.Add(48, "48");
tableMonths.Rows.Add(60, "60");
tableMonths.Rows.Add(72, "72");
RadComboBoxMonths.DataSource = tableMonths;
RadComboBoxMonths.DataTextField = "name";
RadComboBoxMonths.DataValueField = "value";
RadComboBoxMonths.DataBind();
// preselect these terms by default
RadComboBoxMonths.SelectedValue = "12";
RadComboBoxItem twelveMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
twelveMonths.Checked = true;
RadComboBoxMonths.SelectedValue = "24";
RadComboBoxItem twentyFourMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
twentyFourMonths.Checked = true;
RadComboBoxMonths.SelectedValue = "36";
RadComboBoxItem thritySixMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
thritySixMonths.Checked = true;
Mike
Top achievements
Rank 1
 asked on 27 Apr 2013
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?