Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
219 views
I'm almost there on this solution. I have a RadGrid that I received assistance with to create RadioButtons in the columns so that only one row value can be selected at a time per column. This works perfectly and now I'm trying to submit the results using an external button so that the values can be saved in the database. All of the rows are put into edit mode when the page loads. The problem is that the update command is only firing for the first row using my code...

Here is the code for the external button
protected void btn_submit_Click(object sender, EventArgs e)
{
    GridItem[] items = RadGrid1.MasterTableView.GetItems(GridItemType.EditItem);
 
    for (int i = 0; i < items.Length; i++)
    {
        int itemIndex = items[i].ItemIndex;
        if (RadGrid1.EditItems[i].ItemIndex == itemIndex)
        {
            (items[i] as GridEditableItem).FireCommandEvent("Update", String.Empty);
        }
    }
 
    RadGrid1.EditIndexes.Clear();
    for (int i = 0; i < RadGrid1.PageSize; i++)
        RadGrid1.EditIndexes.Add(i);
    RadGrid1.Rebind();
}


If I change this line...
if (RadGrid1.EditItems[i].ItemIndex == itemIndex)

so that "i" is the row index I want to submit, I can get the values to submit for that particular row.

I'm not sure why the for loop stops after the first run through though. Using this code, shouldn't it fire off the Update command for each row that it finds? I checked the value of items.Length and got 8 (which is correct...there are 8 rows), so it should run this 8 times and fire off the Update command for row indexes 0-7.

Let me know if I'm not understanding how this works properly...thanks =)
Shinu
Top achievements
Rank 2
 answered on 04 Dec 2010
3 answers
169 views

I am migrating RadTabStrip from older classic  to new Ajax supported version .In the code we are not using css file but used Skin="Outlook".
In new page now its giving extra padding around the text . Attached is the image showing difference between older and new UI.

I have tried following lines of code in css file but still padding is not removed.

.RadTabStrip

 

.rtsOut,

 

.RadTabStrip

 

.rtsTxt,

 

.RadTabStrip

 

.rtsLI,

 

.RadTabStrip

 

.rtsLink,

 

.RadTabStrip

 

.rtsIn {

 

 

padding:0px 0px 0px 0px;

 

 

margin:0px 0px 0px 0px;

 

 

font-size:10px;

 

 

/*background-color:Red;*/

 

 

}


Shinu
Top achievements
Rank 2
 answered on 04 Dec 2010
4 answers
95 views
Not sure if this is even possible with RadGrid, but I thought I'd put it out there to see if this is something that it can do...

I'm trying to create a selection grid where each row would have a person's name in the first column, and then 5 columns representing categories. A person can be selected for more than one category, but a category can only have one person selected.

In trying to think this through, the first thought was that the entire grid would have to put into edit mode with in-place editing...that seems simple enough to figure out. The next thought was how to create a column where the selection in one row de-selects the other rows. Finally, I would need a button that would submit all the rows on the grid.

Do you think this is something that RadGrid can do or should I be looking for a different solution for this type of functionality?

Thanks =)
Philip Senechal
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
62 views
Disregard. . .stupid error on my part.
John Husted
Top achievements
Rank 1
 answered on 03 Dec 2010
7 answers
229 views
Hi! I'm working on a dashboard type web page. I require several RadGrids on it. Now, with all the grids, the page is pretty long in Y-axis. I need to have the grid's collapse using it's caption bar (if possible). I'm in no mood to use AjaxTool:RoundedCornersExtender at this stage. Kindly suggest a way to accomplish this.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 03 Dec 2010
4 answers
200 views

Greetings

I am to implement ways for improving the performance of my RadScheduler.I cannot bind the control in the client given that one of the requirements of my application is to create a datatable or a dataset dynamically based on the return values.

My RadScheduler binds perfectly, however, performance wise, the scheduler is taking to long to generate the view upon view change. I had an opportunity to read the optimized query example, and I like it a lot. I was thinking to implement something alike by doing a LINQ to Datatable and then binding the RadScheduler control. In this instance, I believe the Datasource_Selecting Event wont be the best choice.

Is it there an available event - say - RadScheduler_BeforeRangeChange or ViewRangeChange - so I could go ahead and bind the control per view instance? 

Say in that event

IEnumerable<DataRow> query =
    from rows in MyDataTable.AsEnumerable()
    where rows.Field<DateTime>("START") > RadScheduler1.VisibleRangeStart AND
    rows.Field<DateTime>("END") < RadScheduler1.VisibleRangeEnd
    select rows;
  
DataTable boundTable = query.CopyToDataTable<DataRow>();
  
RadScheduler1.DataSource = boundTable;


If there not an availabel event ,is there a work around? Also, after the RadScheduler taking too long is returning me the view, but right after error - System.webforms.pagerequestManagerServerError Exception - ViewState Mac Failed

How could I be about fixing these performance issues?

Please let me know,
Thanks


Sergio
Top achievements
Rank 1
 answered on 03 Dec 2010
3 answers
493 views
I would like to ask the knowledgeable people of this forum this:
Given a radcombobox, declared as:
<telerik:RadComboBox ID="SearchComboBox" runat="server" EnableLoadOnDemand="true" AutoPostBack="false"
                    EmptyMessage="Αυτό που ψάχνεις" Width="169px" WebServiceSettings-Path="~/RetrieveHeadlines.asmx"
                    WebServiceSettings-Method="GetHeadlines" Skin="Sunset"
                    EnableItemCaching="true">
 </telerik:RadComboBox>

Given the webservice-declaration:
[WebMethod(EnableSession = true)]
[System.Web.Script.Services.ScriptMethod]
public RadComboBoxItemData[] GetHeadlines(RadComboBoxContext context, int divisionID)

How do I send a value to the "divisionID" parameter?

Thanks in advance: /Christos
Kalina
Telerik team
 answered on 03 Dec 2010
1 answer
94 views
I am having an issue only in IE7, it works fine in IE8. The issue is that the drop down is only active when hovering over the text of the selected item not when over the rest of the drop down not even the arrow. I have added screenshots of what is happening also. The control is in a user control on a page with other user controls. The aspx is below:

 

 

 

<div id="LoadReportPanel">
         <div style="float: right">
            ...
         </div>
         <div style="float: right; padding-top: 2px;">
            <div style="position: absolute; top: 38px; left: 4px; z-index: 9999999;">
               ...
            </div>
            <asp:Label ID="Label1" runat="server" Text="Report Template: "></asp:Label>
            <telerik:RadComboBox ID="ReportTemplatesDropDown" runat="server" Width="300px" Height="250">
               <ItemTemplate>
                  <div id="ReportTemplatesDropDownTreeViewDIV">
                     <telerik:RadTreeView ID="ReportTemplatesDropDownTreeView" runat="server" Expanded="True">
                     </telerik:RadTreeView>
                  </div>
               </ItemTemplate>
               <Items>
                  <telerik:RadComboBoxItem runat="server" Text="Select a Report Template" />
               </Items>
            </telerik:RadComboBox>
         </div>
      </div>

Simon
Telerik team
 answered on 03 Dec 2010
2 answers
168 views
I have a RadComboBox using LoadOnDemand with CloseDropDownOnBlur set to true. I also let the user enter custom text. However, if the user enters the text and tabs out of the field before the combo is done "loading" the values, the dropdown won't disappear until you go back to the cell and leave it again.

Any ideas?
Kalina
Telerik team
 answered on 03 Dec 2010
5 answers
123 views
Hi,

I'm trying to create a gridview with multiple columns that can contain different kinds of System.Web.UI.Controls in Code-Behind. One of them is a radComboBox.
When I add the radComboBox performance drops down dramatically, but I can't find the exact problem.
Is there something I am doing wrong, or is this a known issue?

Below is the Code-Behind file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
using System.ComponentModel;
using System.Collections;
using System.Collections.Specialized;
 
namespace WebApplication1
{
     
    // Default Page
    public partial class _Default : System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            if (IsPostBack)
                createStaticControls();           
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                createStaticControls();           
        }
 
 
        private void createStaticControls()
        {
            int index = 0;
 
            GridViewExtension gridView = new GridViewExtension();
            gridView.EnableInsert = true;
            gridView.rowSize = 20;
            Panel1.Controls.Add(gridView);
 
            while (index != 5)
            {
                TemplateField tfield = new TemplateField();
                tfield.Visible = true;
                tfield.ItemTemplate = new DynamicControl(index);
                tfield.HeaderText = index.ToString();
                gridView.Columns.Add(tfield);
 
                index++;
            }
 
            gridView.DataBind();
 
            Button b = new Button();
            Panel1.Controls.Add(b);
        }
    }
 
 
    // Control - ITemplate, now always an RadComboBox
    public class DynamicControl : ITemplate
    {
        private int index;
 
        public DynamicControl(int _index)
        {
            index = _index;
        }
 
        public void InstantiateIn(System.Web.UI.Control container)
        {
            RadComboBox realControl = new RadComboBox();
            //Label realControl = new Label();      // Label much faster
 
            realControl.Enabled = true;
            realControl.Visible = true;
            realControl.ID = index.ToString();
            realControl.Text = index.ToString();
 
            container.Controls.Add(realControl);
        }
    }
 
 
    // GridView Extension, make empty rows with staticControls
    public class GridViewExtension : System.Web.UI.WebControls.GridView
    {
        public int rowSize;
        public bool EnableInsert;
 
        // Override the creation of childControls to create empty rows
        protected override int CreateChildControls(System.Collections.IEnumerable dataSource, bool dataBinding)
        {
            //create table
            Table table = new Table();
            table.ID = this.ID;
 
            //create a new header row
            GridViewRow row = base.CreateRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
 
            //convert the exisiting columns into an array and initialize
            DataControlField[] fields = new DataControlField[this.Columns.Count];
            this.Columns.CopyTo(fields, 0);
            this.InitializeRow(row, fields);
            table.Rows.Add(row);
 
            this.Controls.Add(table);
 
            while (rowSize != 0)
            {
                this.CreateInsertRow(rowSize, false);
                rowSize--;
            }
 
            return 0;
        }
 
        protected virtual void CreateInsertRow(int rowIndex, bool allowPaging)
        {
            GridViewRow row = this.CreateRow(rowIndex, -1, DataControlRowType.DataRow, DataControlRowState.Insert);
            row.ID = rowIndex.ToString();
 
            DataControlField[] fields = new DataControlField[this.Columns.Count];
            this.Columns.CopyTo(fields, 0);
 
            if (this.HasControls())
            {
                int index = ((Table)this.Controls[0]).Rows.Count - (this.ShowFooter ? 1 : 0) - (allowPaging ? 1 : 0);
                ((Table)this.Controls[0]).Rows.AddAt(index, row);
            }
 
            this.InitializeRow(row, fields);
        }
    }
}


Thanks,
Klaas
Simon
Telerik team
 answered on 03 Dec 2010
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?